NET/MASTER Network Control Language (NCL) Programmer's Guide
Displaying Text on the OCS Command Input Line
Interaction With Users and Terminals
106160 Tandem Computers Incorporated 13–3
The following example combines the CMDLINE and PAUSE verbs:
zex1301n: PROCEDURE
DO FOREVER
DO 5
SAY "What a lovely day!"
END
CMDLINE "GO ID="&SYS.NCLID" Continue (Y/N) _Y"
PAUSE VARS=(&var1, &var2, &var3)
&var3 = SUBSTR( &var3, 1, 1 )
IF UPPER( &var3 ) = Y THEN
ITERATE
ELSE
LEAVE
END
END zex1301n
In this example, text is displayed by a SAY statement in a DO loop. The CMDLINE
verb positions the cursor on the Y at the end of the line it places in the OCS command
input line: the line asks whether to continue displaying the text in the DO loop.
The PAUSE verb reads the information after the GO command: &VAR1 holds
Continue, &VAR2 holds (Y/N), and &VAR3 holds the answer to the question. The
NCL process uses the SUBSTR built-in function to extract the first character of &VAR3
and the UPPER built-in function to convert this character to uppercase. The IF core
statement determines its course of action: if the value is Y, the DO loop is repeated; if
not, the NCL process terminates.
The following screen shows the results of executing the procedure:
(12:35) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX1301N
What a lovely day!
What a lovely day!
What a lovely day!
What a lovely day!
What a lovely day!
|NM1060 PROCEDURE ZEX1301N NCLID 1016 PAUSED
GO ID=1016 Continue (Y/N) Y
What a lovely day!
What a lovely day!
What a lovely day!
What a lovely day!
What a lovely day!
|NM1060 PROCEDURE ZEX1301N NCLID 1016 PAUSED
GO ID=1016 Continue (Y/N) XYZ
NNM1005 START ZEX1301N PROCESSING COMPLETE. NCLID 001016
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The NCL process terminates execution after the second iteration of the DO loop.