|Navigation: Language Reference > 13 - Built-in Functions >====== SELECTED (return control that has received focus) ======|
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
CASE SELECTED() !Process pre-edit code
OF ?Cus:Company !Pre-load field value
OF ?Cus:CustType !Pre-load field value