NET/MASTER Network Control Language (NCL) Programmer's Guide
Language Elements
NCL Summary
106160 Tandem Computers Incorporated 2–9
DO, ITERATE, and LEAVE Core Statements
The DO core statement delineates a block of statements to execute as a group, either
once only (as a DO group) or repetitively (as a DO loop). The ITERATE core statement
executes the next iteration of a DO loop. The LEAVE core statement terminates a DO
loop.
IF and SELECT Core Statements
The IF and SELECT core statements provide conditional execution of a statement,
depending on the evaluation of a test condition.
IF allows a two-way decision to be made based on the evaluation of a test condition. If
the condition evaluates to 1 (TRUE), the statement introduced by the THEN keyword
executes. If the condition evaluates to 0 (FALSE), the statement introduced by the
ELSE keyword executes. THEN is mandatory but ELSE is optional. If ELSE is not
present, execution continues with the statement following the IF statement.
SELECT allows a decision to be made when there are more than two choices. SELECT
selects and executes one of several alternative statements, based on the value of an
expression. Choices are introduced by the WHEN keyword and evaluate to either
TRUE or FALSE. Statements are introduced by the THEN keyword. SELECT executes
the first choice that evaluates to TRUE. If no choice is matched, NCL executes the
statement introduced by the OTHERWISE keyword. OTHERWISE is optional. It is
required only when no choice is TRUE. If OTHERWISE is not present and no choice is
TRUE, a run-time error is raised.
FLUSH Core Statement
When an NCL procedure is executed, by using the START or EXEC command or the
START verb, it is called an NCL process. The FLUSH core statement terminates an
NCL process from any nesting depth.
Note Compare the NCL FLUSH core statement with the NonStop NET/MASTER MS FLUSH command. The
core statement and the command both perform the same function. However, the FLUSH command
raises a run-time error but the FLUSH core statement does not.
ON, RESUME, RETRY, REVERT, and SIGNAL Core Statements
There are five core statements associated with handling run-time (not compilation)
errors. The ON core statement declares an error handler to handle run-time errors.
The RESUME core statement transfers control from an error handler to the statement
following the statement that raised the error handler. The RETRY core statement
reexecutes the statement that raised the error handler. The REVERT core statement
releases an error handler. The SIGNAL core statement, without the LABEL keyword,
explicitly raises a specified error handler.
The EXIT and FLUSH core statements are also used with error handlers, to terminate
execution of an NCL procedure or NCL process, respectively.