| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== EVENT (return event number) ====== | [[errorfile return error filename .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[exists return file existence .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} **EVENT( )** {{blk2blue.jpg|blk2blue.jpg}} The **EVENT** procedure returns a number indicating what caused ACCEPT to alert the program that something has happened that it may need to handle. There are EQUATEs listed in [[commonly used equates.htm|EQUATES.CLW]] for all the events the program may need to handle. There are two types of events generated by ACCEPT: field-specific and field-independent events. Field-specific events affect a single control, while field-independent events affect the window or program. The type of event can be determined by the values returned by the ACCEPTED, SELECTED, and FIELD procedures. If you need to know which field has input focus on a field-independent event, use the FOCUS procedure. //For field-specific events:// The FIELD procedure returns the field number of the control on which the event occurred. The ACCEPTED procedure returns the field number if the event is EVENT:Accepted. The SELECTED procedure returns the field number if the event is EVENT:Selected. //For field-independent events:// The FIELD, ACCEPTED, and SELECTED procedures all return zero (0). | **Return Data Type:** | SIGNED | **Example:** **ACCEPT** ** CASE ****EVENT****()** ** OF EVENT:Selected** **  CASE SELECTED()** **  OF ?Control1** **   !Pre-edit code here** **  OF ?Control2** **   !Pre-edit code here** **  END** ** OF EVENT:Accepted** **  CASE ACCEPTED()** **  OF ?Control1** **   !Post-edit code here** **  OF ?Control2** **   !Post-edit code here** **  END** ** END** **END** **See Also:** [[accept the event processor .htm|ACCEPT]] [[field return control with focus .htm|FIELD]] [[focus return control with focus .htm|FOCUS]] [[accepted return control just completed .htm|ACCEPTED]] [[selected return control that has received focus .htm|SELECTED]] [[modal events.htm|Modal Events]] [[post post user defined event .htm|POST]]