NET/MASTER Network Control Language (NCL) Reference Manual

LEAVE
Core Statements
2–34 106126 Tandem Computers Incorporated
LEAVE The LEAVE core statement exits a repetitive DO group. Logically, this is the same as
transferring to the NCL statement after the END statement that closes that DO group.
The LEAVE statement also terminates any nesting within the active DO group and
terminates any current ON blocks.
If you use the LEAVE core statement in an ON block, it causes the termination of all
intermediate active procedure and function calls, back to the time at which the ON
block was established. (The ON core statement, described later in this section, defines
an ON block.)
When using the LEAVE statement, NCL preserves the value of any control variable
associated with an iterative DO group (a group that requires repeated execution of
NCL statements within it).
LEAVE [
label-ref
]
label-ref
specifies a reference to a label in an iterative DO group that encloses the LEAVE
statement.
label-ref
must be a constant.
If you omit
label-ref
, NCL assumes you want to leave the innermost repetitive
DO group that contains the LEAVE statement.
The LEAVE statement terminates other DO groups inside the target group. NCL
generates a compilation error if the label specified is not that of an enclosing
iterative DO group.
See Section 8, “Compiler Operation,” for the definition of an NCL label.
Consideration
See also DO and ITERATE. The ITERATE core statement provides you with a method
of interrupting a DO loop without terminating it.