NET/MASTER Network Control Language (NCL) Programmer's Guide
Single and Repetitive Execution
Controlling Execution Flow
5–18 106160 Tandem Computers Incorporated
In this example, the condition that terminates the DO loop is the evaluation of the FOR
keyword—the loop executes five times only.
Executing a Loop Forever The FOREVER keyword explicitly executes a DO loop until it is terminated by a
condition such as failing a WHILE test or branching out of the loop. The syntax of a
DO loop that uses the FOREVER keyword is the following:
DO FOREVER
statement1
statement2
statement3
…
END
The following example shows an NCL procedure that specifies the FOREVER
keyword:
zex0512n: PROCEDURE
/* DO loop with the FOREVER keyword */
DO FOREVER
SAY Do the first task
SAY Do the second task
SAY Do the third task
END
END zex0512n
The following screen shows the results of executing the procedure:
(15:03) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0512N
Do the first task
Do the second task
Do the third task
Do the first task
Do the second task
Do the third task
Do the first task
Do the second task
Do the third task
Do the first task
Do the second task
Do the third task
Do the first task
Do the second task
Do the third task
Do the first task
Do the second task
Do the third task
Do the first task
Do the second task
MSGS LOST ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>