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

Single and Repetitive Execution
Controlling Execution Flow
106160 Tandem Computers Incorporated 5–3
The following screen shows the results of executing the procedure twice:
(11:20) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0501N 1
First statement
Second statement
Third statement
NNM1005 START ZEX0501N PROCESSING COMPLETE. NCLID 000021
START ZEX0501N
Fourth statement
Fifth statement
Sixth statement
NNM1005 START ZEX0501N PROCESSING COMPLETE. NCLID 000022
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The first time the procedure is executed, the value 1 is passed and the first, second,
and third statements are executed. The second time the procedure is executed, no
value is passed and the fourth, fifth, and sixth statements are executed.
Repetitive Execution Using
Counters
You can use the DO statement with counters to execute a DO loop, that is, a sequence
of statements bound by the DO and END core statements that is executed more than
once. The counters control the number of times the DO loop is executed. You can
control repetition with counters in two ways: using an expression or using a control
variable.
Using an Expression to Control Repetitive Execution
The syntax of a DO loop that uses a single expression to control repetitive execution is
the following:
DO
exprr
statement1
statement2
statement3
END
exprr
specifies an expression that must evaluate to a nonnegative integer. This gives the
number of times the loop is to be executed.