NET/MASTER Network Control Language (NCL) Programmer's Guide
Single and Repetitive Execution
Controlling Execution Flow
5–16 106160 Tandem Computers Incorporated
The following example shows an NCL procedure that specifies both the WHILE and
UNTIL keywords in a DO loop:
zex0510n: PROCEDURE
/* DO loop with the WHILE and UNTIL keywords */
&while = 1
&until = 1
DO WHILE &while < 10 UNTIL &until > 5
SAY "&while is "&while
SAY "&until is "&until
&while = &while + 1
&until = &until + 1
END
SAY "The final value of &while is "&while
SAY "The final value of &until is "&until
END zex0510n
This procedure executes a DO loop that is executed while the value of &WHILE is less
than 10, until the value of &UNTIL is greater than 5.
The following screen shows the results of executing the procedure:
(14:50) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0510N
&while is 1
&until is 1
&while is 2
&until is 2
&while is 3
&until is 3
&while is 4
&until is 4
&while is 5
&until is 5
The final value of &while is 6
The final value of &until is 6
NNM1005 START ZEX0510N PROCESSING COMPLETE. NCLID 017504
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
In this example, the condition that evaluates to 0 (FALSE) first is the UNTIL condition,
not the WHILE condition. The DO loop terminates when the value of &UNTIL is 6.