| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== SELECTED (return control that has received focus) ====== | [[select select next control to process .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[send send message to file driver .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} **SELECTED( )** {{blk2blue.jpg|blk2blue.jpg}} The **SELECTED** procedure returns the field number of the control receiving input focus when an EVENT:Selected event occurs. SELECTED returns zero (0) for all other events. Positive field numbers are assigned by the compiler to all WINDOW controls, in the order their declarations occur in the WINDOW structure. Negative field numbers are assigned to all APPLICATION controls. In executable code statements, field numbers are usually represented by field equate labels--the label of the USE variable preceded by a question mark (?FieldName). **Return Data Type:     **SIGNED **Example:** **CASE ****SELECTED****()       !Process pre-edit code** **OF ?Cus:Company       !Pre-load field value** **OF ?Cus:CustType      !Pre-load field value** **END** **See Also:** [[accept the event processor .htm|ACCEPT]] [[select select next control to process .htm|SELECT]]