OnSend / OnReceive Event Procedures

<< Click to Display Table of Contents >>

Navigation:  Reference (Scripting) >

OnSend / OnReceive Event Procedures

Docklight Scripting supports two dedicated procedures that are called by the Docklight Scripting engine before transmitting a new Send Sequence or after detecting a Receive Sequence.

 

Procedure Definition

Description

Sub DL_OnSend()

... my script code ...

End Sub

 

DL_OnSend() is called after a new 'send' operation has been triggered (manual send or DL.SendSequence). Special manipulation functions are available to read out and modify the data before it is actually transmitted. See Send Sequence Data Manipulation.

Sub DL_OnReceive()

... my script code ...

End Sub

DL_OnReceive() is called after a Receive Sequence has been detected. Special manipulation functions are available to read out and further process the data received. See Evaluating Receive Sequence Data.

 

The procedures can be defined anywhere in the script code at module-level (not within a class). See Send Sequence Data Manipulation for an example.

 

NOTE: The DL_OnSend() and DL_OnReceive() code is only executed while the script is running. Sending a Send Sequence does not automatically execute the related DL_OnSend() code. The script must be started manually using the menu Scripting > Startscript_new Run Script. Any error during script execution will stop the script and prevent that further DL_OnSend() / DL_OnReceive() procedure calls are made.

 

NOTE: DL_OnSend() and DL_OnReceive() events are queued and can be processed at a later point. See Timing and Program Flow for more information.

 

TIP: If your script consist only of the DL_OnSend() and DL_OnReceive() procedures and nothing else, use a simple endless loop at module-level to prevent the script from terminating immediately. See the Send Sequence Data Manipulation example.