NET/MASTER Network Control Language (NCL) Programmer's Guide

Single and Repetitive Execution
Controlling Execution Flow
5–14 106160 Tandem Computers Incorporated
Repetitive Execution Using the UNTIL Keyword
An UNTIL clause introduces an expression that is tested after each iteration of a DO
loop. The syntax of a DO loop that uses the UNTIL keyword is the following:
DO UNTIL
expru
statement1
statement2
statement3
END
expru
specifies an expression that must evaluate to 1 (TRUE) or 0 (FALSE). If the
expression is false, the loop is reexecuted. If the expression is true, execution
continues with the statement following the END statement.
The following example shows an NCL procedure that uses the UNTIL keyword in a
DO loop:
zex0509n: PROCEDURE
/* DO loop with the UNTIL keyword */
&number = 1
DO UNTIL &number > 10
SAY &number
&number = &number + 1
END
SAY "The final value of &number is "&number
END zex0509n
The DO loop is executed until the value of the variable &NUMBER is greater than 10.