NET/MASTER Network Control Language (NCL) Programmer's Guide
Single and Repetitive Execution
Controlling Execution Flow
106160 Tandem Computers Incorporated 5–9
The following screen shows the results of executing the procedure:
(10:00) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0505N 5
1
2
3
4
5
The final value of &control is 6
NNM1005 START ZEX0505N PROCESSING COMPLETE. NCLID 008502
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The value of the parameter &1 passed to the procedure is 5. The value of the control
variable is changed at the bottom of the loop. The test for leaving the DO loop is made
after this. Accordingly, the final value of the control variable is 6.
Using a Control Variable With the BY Keyword. The BY keyword sets the value by which to
increment or decrement the control variable in a repetitive DO loop. The syntax of a
DO loop that uses the BY keyword with a control variable is the following:
DO
cvar
=
expri
[ TO
exprt
] BY
exprb
[ FOR
exprf
]
statement1
statement2
statement3
…
END
exprb
specifies an expression that must evaluate to a number. It does not have to be an
integer and it can be either a positive or negative number. This gives the value
you want to add to the value of the control variable at the bottom of the loop. If
you omit the BY keyword, NCL assumes an increment of 1.