ON ERROR action


Function The action allows to handle processing of error states.
Declaration
 ON ERROR label/NONE/ON/OFF 
Parameters
label in Label (a sequence of characters that meets the conditions for the given object name).
Description If an error occurs during the execution of a sequence of defined actions, the script interpreter is controlled according to the setting to process the error. The local variables _ERR_LINE, _ERR_NR and _ERR_MSG are always adjusted and explain in more details the error.

The possible current setting of the processing and the operation at an error occurrence:
  • ON ERROR label
    At an error occurrence, the script continues the execution of the action, which follows the given label.
  • ON ERROR NONE
    The label to handle an error is not defined after the action execution. The script occurs in this state after its start. An error occurrence causes logging into the log database and the script termination.
  • ON ERROR OFF
    An error occurrence does not interrupt the sequence of the actions' execution, the execution continues directly by the following action (for the action IF THEN, too). Detection of an error occurrence is enabled by using the test of a value of the predefined local variable _ERR_NR. Accessing the local variable _ERR_NR in this mode causes that it is set to the value _ERR_NO_ERROR!!!.
  • ON ERROR ON
    To avoid the effect of the action ON ERROR OFF. If a label to handle an error is defined before the action, the label becomes the active one.

Napíšte komentár