In ABL, class events are always defined as part of a class-based object definition, which can include one of the following object types:
A class event has a signature, similar to a method, that can define parameters for passing data in response to event notification. An ABL application receives notice of a class event when the object that defines the event publishes it. In an ABL application, you can subscribe one or more ABL class methods or internal procedures as event handlers, which execute when a given event is published. These event handlers must all be defined with a signature that is compatible with the event that they are subscribed to handle.
Class events provide similar features for class-based objects that named events provide for procedure-based objects, but using different mechanisms. You publish a named event using the
PUBLISH statement and manage named event handler subscriptions using the
SUBSCRIBE statement and
UNSUBSCRIBE statement. However, you publish a class event using the
Publish( ) event method and manage class event handler subscriptions using the
Subscribe( ) event method and
Unsubscribe( ) event method. Among the differences between the two types of events, a named event is defined when it is published and without a strongly-typed signature, while a class event must be defined before it is published and with a strongly-typed signature.