On event Do command

 On event Do
   commands
 EndDo

Execute command on event. Stores the specified command to be executed when the event happens.

The event is an identifier or ByName() expression. Predefined identifiers for event are listed here.

You can define any number of commands for each event. You can also invent your own events, and trigger them using RunHook.

Version Differences: PCC 1.x allows canceling execution of event handlers registered later on using a command such as On event Do Return. This was never documented, and does not work in PCC2.

Version Differences: The multi-line form is supported since PCC2 2.0.8.

Since: PCC 1.0.9, PCC2 1.99.9

See also: RunHook, Elementary Commands