Events

 

 

Events are function signatures for notifications, which can be received by other objects.

One or more events can be defined for each class.

 

Example:

Create an event definition in the class of an object:

 

The event can be triggered at runtime simply by calling the event:

 

 

The event can be received by defining an event receiver, either at the object definition of the object or TCE object pointer.

 

 

The main advantage is complete encapsulation and reusability. The Object EventReceiver "knows" nothing about the existence of the Class EventSender.

If there are more than one event receivers for an event of an object, all receivers are triggered. The sequence of the triggering is not predictable.

 

Note:

Events cannot have a return value. The return value has to be declared As Void always.

 

More:

Event