E Language Reference |
The event keyword declares a special type of function that will be called when that event name is raised using the raise keyword . Event functions can also be defined for any type of class and can include a conditional execution statement which may result in the event function not being called. The raise keyword calls any events using the same name and parameter declaration as that which was specified in the call to the event.
Remarks An event type function is very similar to a normal function but returns no value. The on condition is evaluated as if it were placed at the start of the function body, returning if the condition evaluated to false before the function body is executed . The for tag specifies the class type this event will be defined for. If the event is specified to be an object event, the this keyword can be used throughout the function body and the on condition to access the instance this event was called on. This way events can be dynamically added to a class without it needing to declare any information about it. An event function is syntactically similar to [class-name:] alias ([parameters]) null { [if (!condition) {return }] -* function body *- }. Example
To make a suggestion or report a bug about Help or another feature of this product, go to the sourceforge project.
|