@EVENT

Top  Previous  Next

Syntax:

 

@EVENT(D)

 

Description:

 

This function returns the name of the last event to have occurred. It returns a null string if no event has occurred. After the function has been called the event is cleared, so it should be stored in a variable if you need to test it more than once.

This function has an optional parameter D, for use in programs that have more than one dialog. If present, the event name will be followed by a field separator and a number indicating the dialog that issued the event. The main window has the value 0. A child window will have the value 1. There may be more than one child dialog in which case the number will reflect the order they were created but the number will change if earlier dialogs are closed, because the number is actually the position in a list.

 

OK:

 

Unchanged.

 

Example:

 

:LOOP

  WAIT EVENT

  GOTO @EVENT()

:OKBUTTON

  INFO You pressed OK

  GOTO LOOP

:CANCELBUTTON

  INFO You pressed Cancel

  GOTO LOOP

 

See also: