NET/MASTER Network Control Language (NCL) Reference Manual

ON
Core Statements
2–38 106126 Tandem Computers Incorporated
Considerations
If an event occurs and there is no ON block to handle it, NCL terminates the
procedure with an error statement. Errors that occur when executing the NCL
FILE verbs are an exception. Such errors are ignored if there is no user coded ON
block, and the NCL procedure is resumed from the statement after the one that
caused the error.
The execution of any statements within an ON block that is defined in a procedure
or function does not include the complement of shared variables in any CALL
from outside that procedure or function.
NCL, before executing an ON statement within a DO group, records the definition
(if any) of the ON statement for the same condition in an outer block. This enables
NCL to reestablish the ON block environment if necessary. If there are ON blocks
defined within a DO group, and the DO group terminates, NCL terminates those
ON blocks. NCL reinstates any previously established ON blocks as the current
ON blocks.
A GOTO statement, executed in an ON block to a label outside of the ON block,
returns the execution environment back to what it was at the time of the ON
statement (including terminating all intermediate procedures or functions and
restoring all shared variables). This can involve exiting from any active DO
groups, for example. The variable domain for the NCL procedure containing the
target label of the GOTO statement is the variable domain of the procedure or
function that established the current ON block.
SIGNAL statements and internal errors can both generate conditions. When such
events occur, NCL starts executing from the first statement in the ON block, as if
called from the point at which the condition was generated. NCL records that
point for possible later return.
See also GOTO, RESUME, RETRY, REVERT, and SIGNAL. These core statements
are all relevant to condition and error handling. The GOTO statement causes an
active ON block to be terminated. The RESUME statement ignores the statement
that generated the condition or error. The RETRY statement retries the statement
that generated the condition or error. The REVERT statement deactivates an ON
block. The SIGNAL statement generates a condition.
System variables that have the prefix &SYS.ERROR. can be referred to only from
within an ON block.