NET/MASTER Network Control Language (NCL) Reference Manual
SIGNAL
Core Statements
2–64 106126 Tandem Computers Incorporated
SIGNAL The SIGNAL core statement either generates a specified condition or transfers control
to a specific label.
SIGNAL {
cond-expr
| LABEL
label
}
cond-expr
generates a user-specified condition or a system condition. If a handler for the
condition is active (has been created by an ON statement), control passes to the
handler. The handler can be in an outer procedure.
NCL checks the condition name
cond-expr
against the active condition handlers,
as created by ON statements. If NCL finds an active condition handler, then
control passes to that condition handler. NCL includes external active procedures
in its search.
If NCL cannot find the specified condition name, it converts this condition to the
standard NCL error condition, ERROR, and retries the search. If this also fails,
NCL issues a run-time error. However, NCL carries out an implicit RESUME for
the statement that generated the FILE_ERROR condition, if no error handler exists.
See FILE_ERROR in Table 2-2.
Using
cond
-
expr
preserves the DO and GOSUB nesting for the current
procedure. The handler determines the action to take. This action could be to
resume execution at the next statement following the SIGNAL statement.
LABEL
label
transfers control to a specific label.
label
specifies a constant or an expression
that determines the target label for the SIGNAL statement. See Section 8,
“Compiler Operation,” for the definition of an NCL label. This label must be in
the current procedure and not embedded within any DO groups. The search for
the label always starts at the top of the procedure. This is different from the
method of searching for labels in the GOTO and GOSUB core statements.
When control arrives at the target label, NCL terminates all active DO groups and
GOSUB nestings for the current procedure. NCL also deactivates any established
ON blocks, other than those established at the open code level.
Considerations
Using a label with the SIGNAL core statement within an active ON statement rolls
all intermediate procedure and function calls back to the scope containing the
label.
If you use the word LABEL to define
label
, you must place it in parentheses:
SIGNAL LABEL (LABEL)
See the ON core statement in this section for a definition of an ON block.