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 and 2.40.8 (c2ng).

See also: RunHook, Elementary Commands

This is a testing version.
It may be incomplete, and have more bugs (or features) than the public live version at planetscentral.com.