OnExternalEvent action


Function
This action defines the handler procedure of event generated by an external library.
Declaration
 ON  externalEvent GOTO procName [PRTY prtyIdent] 

Parameters
externalEvent in Textual constant that specifies a name of event generated by an external library.
procName in Name of RPC or RPCX procedure in ESL script. The procedure must consists of one parameter of structured variable type. The values of this structured variable depend on the particular external event which is handled.
prtyIdent in Optional parameter of Int type. A priority when calling RPC.

Description
The action specifies a procedure (by procName), which will be called back if an event with the given name is generated in an external library. The called procedure must be defined in ESL script that is executed in the same process as the script that works with the external functions of library. When defining the handler of the same external event in the several ESL scripts, the information about event will be sent to all scripts.
The key word PRTY enables to enter the priority of executing the registered RPC procedure. This feature ensures preferred executing of registered RPC procedure.
The list of generated events and their description is included in the documentation for extended libraries of D2000 System.
Example
 ; the function that will process an information about event
 RPC PROCEDURE OnExternalEvent (IN RECORD NOALIAS (SD.ExternalEventParams) _params
 END OnExternalEvent 
 
 BEGIN
 ; registering the event handler with the name "ExternalEvent"
 ON "ExternalEvent" GOTO OnExternalEvent
 END 


Related pages:

Napíšte komentár