NET/MASTER Network Control Language (NCL) Reference Manual
&SYS.PARMCNT
System Variables
106126 Tandem Computers Incorporated 5–91
&SYS.PARMCNT The &SYS.PARMCNT system variable contains a count of the number of variables
entered when a function or a procedure is invoked.
When a function is invoked, parameters (arguments) can be passed to it. Similarly,
when a procedure is invoked implicitly, or by using the EXEC command, START
command, or CALL core statement, parameters (arguments) can be passed to the
procedure. There is no practical limit to the number of arguments that can be passed
to an NCL function or procedure. Arguments are passed to the function or procedure
by specifying them after the name of the function or procedure. NCL makes the
arguments available to the function or procedure in variables that are given the
variable names (&1, &2, and so on). &SYS.PARMCNT is set to the number of variables
created.
&SYS.PARMCNT
Considerations
&SYS.PARMCNT is only set when a procedure is invoked and remains set to that
initial value for the duration of processing. Subsequent functions do not change
the value.
&SYS.PARMCNT applies only to the current nesting level. Each new nesting level
establishes its unique &SYS.PARMCNT value.
See also &SYS.ALLPARMS, which is a single variable that contains the value of all
variables supplied on entry to the invoked procedure.
For more information and examples on passing variables between procedures,
refer to the NonStop NET/MASTER NCL Programmer’s Guide.
See the CALL core statement in Section 2, “Core Statements.”
See also &SYS.ALLPARMS, which contains a string of parameters supplied to an
NCL process by a user.
Example
The following example shows an NCL procedure called PARMCNT that uses the
&SYS.PARMCNT system variable. &SYS.PARMCNT, in this example, contains the
value 2. The variable &1 is given the value NCP1; the variable &2 is given the value
NCP4. These values are displayed when the procedure is started by using the EXEC
command with the parameters NCP1 and NCP4 (EXEC PARMCNT NCP1 NCP4):
PARMCNT: PROCEDURE
SAY &SYS.PARMCNT " IS THE VALUE OF &SYS.PARMCNT"
SAY &1 " IS THE VALUE OF &1"
SAY &2 " IS THE VALUE OF &2"
END PARMCNT