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

Conditional Execution
Controlling Execution Flow
5–32 106160 Tandem Computers Incorporated
The following screen shows the results of executing the procedure four times:
(12:51) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0521N 123
First parameter is neither a nor b
NNM1005 START ZEX0521N PROCESSING COMPLETE. NCLID 000101
START ZEX0521N XYZ
First parameter is neither a nor b
NNM1005 START ZEX0521N PROCESSING COMPLETE. NCLID 000102
START ZEX0521N A
First parameter = a
NNM1005 START ZEX0521N PROCESSING COMPLETE. NCLID 000103
START ZEX0521N B
First parameter = b
NNM1005 START ZEX0521N PROCESSING COMPLETE. NCLID 000104
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The values entered are 123, XYZ, A, and B.
Performing a Test of Strict Equality Using SELECT. The following example shows an NCL
procedure that performs a test of strict equality using the SELECT statement:
zex0522n: PROCEDURE EXTPARSE SMART NOFOLD
/* Second form of SELECT with STRICT */
SAY "Value of &1 is "&1
SELECT &1
WHEN " abc" THEN SAY "SIMPLE SELECT 1st WHEN"
WHEN "abc" THEN SAY "SIMPLE SELECT 2nd WHEN"
OTHERWISE SAY "SIMPLE OTHERWISE"
END
SELECT &1 STRICT
WHEN " abc" THEN SAY "STRICT SELECT 1st WHEN"
WHEN "abc" THEN SAY "STRICT SELECT 2nd WHEN"
OTHERWISE SAY "STRICT OTHERWISE"
END
END zex0522n
This procedure uses two SELECT statements to evaluate the parameter entered when
the procedure is executed. The first SELECT statement uses a test of simple equality to
evaluate the parameter. The second SELECT statement uses a test of strict equality.
Note The EXTPARSE SMART keywords following the PROCEDURE keyword in the procedure declaration
means that blanks are significant in parameters enclosed in quotes that are passed to the procedure
when it is executed. The NOFOLD keyword ensures that the alphabetic characters in the parameters are
not automatically converted to uppercase.