User Tools

Site Tools


focus_return_control_with_focus_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== FOCUS (return control with focus) ====== Previous pageReturn to chapter overviewNext page

NewC7.jpg

FOCUS( )

blk2blue.jpg

The FOCUS procedure returns the field number of the control which has received the last EVENT:SELECTED event among the other controls (not menu items) of the active window.

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:

W WINDOW

  ENTRY(@N4),USE(Control1)

  ENTRY(@N4),USE(Control2)

  ENTRY(@N4),USE(Control3)

  END

CODE

OPEN(W)

ACCEPT

 CASE EVENT()

  OF EVENT:LoseFocus

  OROF EVENT:CloseWindow

   CASE FOCUS()         !Control edit control

    OF ?Control1        !Field number 1

     UPDATE(?Control1)

    OF ?Control2        !Field number 2

     UPDATE(?Control2)

    OF ?Control3        !Field number 3

     UPDATE(?Control3)

   END

 END

END

See Also:

ACCEPTED

SELECTED

FIELD

EVENT

focus_return_control_with_focus_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1