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

Single and Repetitive Execution
Controlling Execution Flow
5–4 106160 Tandem Computers Incorporated
Using a Constant Expression. If the expression following the DO keyword is a constant,
the DO loop executes the number of times specified by the constant.
The following example shows an NCL procedure that uses a constant expression in a
DO loop:
zex0502n: PROCEDURE
/* Constant expression in a DO loop */
DO 2
SAY " __ __ ______ ___"
SAY "| \ | | / _____| | |"
SAY "| \ | | | / | |"
SAY "| |\ \| | | | | |"
SAY "| | \ | | \_____ | |______"
SAY "|__| \__| \ ______| |__________|"
SAY
END
END zex0502n
The DO loop in this example displays a large NCL banner on the OCS message display
area. The DO loop is executed exactly twice.
The following screen shows the results of executing the procedure:
(07:18) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0502N
__ __ ______ ___
| \ | | / _____| | |
| \ | | | / | |
| |\ \| | | | | |
| | \ | | \_____ | |______
|__| \__| \ ______| |__________|
__ __ ______ ___
| \ | | / _____| | |
| \ | | | / | |
| |\ \| | | | | |
| | \ | | \_____ | |______
|__| \__| \ ______| |__________|
NNM1005 START ZEX0502N PROCESSING COMPLETE. NCLID 028104
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The NCL banner is displayed twice on the OCS screen.