EVENT action


Function
Synchronous/asynchronous starting of a subevent.
Declaration
 EVENT eventIdent [(pubLoc1=param1, pubLoc2=param2, ... , pubLoc10=param10)] [ASYNC]
Parameters
eventIdentinIdentifier of a Event type object.
pubLoc1, pubLoc2, ..., pubLoc10inLocal variables of PUBLIC type in the called event, the specified parameters will be assigned to.
param1, param2, ..., param10inLocal variables - their values will be assigned to the local variables of PUBLIC type.
Description
Before the subevent starts there are automatically filled:
  • the values of PUBLIC local variables.
  • the predefined variables _FROM_HIP, _HIP_PAR_STR, _HIP_USER_DESC according to the script called.

Without the keyword ASYNC, the subscript is to be started synchronously. The action EVENT is terminated after the subevent termination. Values of PUBLIC local variables are to be assigned to the called event (IN OUT parameters in principle). If the called event is terminated by an error, the calling event is not terminated and continues in the execution of the next action.

For asynchronous calling an event (the keyword ASYNC), the calling event doesn't wait for the termination of the running event.

When you are using local variables of the RECORD type, it is necessary that the types of the variables must be the same in the called and calling events, in regard to the NOALIAS attribute.

Examples
Asynchronous calling of the script (no parameters)
 
 ;script that calls
 BEGIN
 MESSAGE "script began" ON srvskol1v.HIP
  EVENT E.podevent ASYNC
 MESSAGE "script ended" ON srvskol1v.HIP
 END 
 
 ;called script "E.podskript"
 BEGIN
 MESSAGE "subscript began" ON srvskol1v.HIP
 DELAY 200[ms]
 MESSAGE "subscript ended" ON srvskol1v.HIP
 END 
 
Synchronous calling of the subscript (no parameters)
 
 ;script that calls
 BEGIN
  MESSAGE "script began" ON srvskol1v.HIP
  EVENT E.podevent
 MESSAGE "script ended" ON srvskol1v.HIP
 END 
 
 ;called script "E.podskript"
 BEGIN
  MESSAGE "subscript began" ON srvskol1v.HIP
 DELAY 100[ms]
 MESSAGE "subscript ended" ON srvskol1v.HIP
 END 
Napíšte komentár