TApxScript.CancelScript

TApxScript

procedure CancelScript;

Cancels the background script.

Once a script is started, it executes all commands in the background without any help or interference from the foreground process. The only way to stop the script, short of letting it run to completion, is to call CancelScript. CancelScript stops the script and removes any resources (i.e., triggers, event handlers) the script may have installed. CancelScript does not free any components (TApxComPort or TApxProtocol) that the script may have created. Those components are re-used in subsequent calls to StartScript and are freed only when the script component is destroyed.