Utility Routines 

*SYSTEM

Event Handling Object 

Format

Initializes Event Handling Object: DEF OBJECT obj_id, "*SYSTEM"

Where:

*SYSTEM

Keyword used in defining PxPlus Event Handling Object.

obj_id

Numeric variable that will be used to save the object reference.

Description

This object simplifies event handling in PxPlus. Use this object to turn event handling on and off and to isolate any syntax changes from your programs. To prevent an application from looping endlessly, a limit of 64 nested events has been imposed.

The interface supports the following syntax options:

SetTimer(secs)

Method Call. Fires a "timeout" event in PxPlus on intervals the number of seconds indicated by secs. The timer will continue to fire "timeout" events until a SETTIMER(0) is issued. The handling method will not receive any value when the event occurs. (Windows Only)

SignalOnData(chan, 0 | 1)

Method Call. Fires a "data available" event on the channel number given. A 1 indicates that the function is enabled; a 0 indicates that it is not.

The channel number (chan) must refer to only certain kinds of files: console, TCP, serial connection, pipes and I/O redirection. The handling method will receive the channel number when the event occurs.

SignalOnClose(chan, 0 | 1)

Method Call. Fires a "file close" event for the channel number given. A 1 indicates that the function is enabled; a 0 indicates that it is not. The handling method will receive the channel number.

SignalOnOpen(0 | 1)

Method Call. Fires a "file close" event for the channel number given. A 1 indicates that the function is enabled; a 0 indicates that it is not. The handling method will receive the channel number.

SignalLoadClass(0 | 1)

Method Call. Fires a "LoadClass" event whenever a class definition needs to be loaded into the system either through a NEW or LIKE directive. The handling method will be passed the name of the class required.

Once the event is serviced, the system will re-check to see if the desired class is now present; if not (or no event service provided), the standard load of a ".pvc" file will occur.