ON EVENT keyword

Executes a SUB is generated when a specified custom EVENT is generated.

Syntax

ON EVENT "name", sub, limit

Parameters

  • name: custom event name (required)
  • sub: subroutine to execute (required)
  • limit: maximum number of executions, by default unlimited

Example

ON EVENT "main", startMain, 1

SUB startMain
'...
END SUB

'Generate the event
EVENT "main"

Go back to list of Keywords.