NET/MASTER Network Control Language (NCL) Reference Manual
PROCEDURE
Core Statements
106126 Tandem Computers Incorporated 2–43
PROCEDURE The PROCEDURE core statement indicates the start of a callable procedure. If this
statement is the first executable statement in a source file, it declares the source file a
procedure. If the first executable statement in a source file is not a PROCEDURE or a
FUNCTION statement, NCL assumes it is a procedure. NCL interprets the name of
the procedure as a single label, equal to the source file name; NCL also assumes a
matching END statement for each such procedure.
The PROCEDURE statement must be in code that is not nested in a DO group and
must not be the target of an IF, ELSE, WHEN, ON, or OTHERWISE statement.
You can supply arguments to a procedure either on the OCS command line when you
start a procedure, or by using an ARGS list in the CALL core statement when you call a
procedure. NCL places the values of these arguments in the variables &1, &2, and so
on to the number required.
If you want to execute an NCL procedure from another NCL procedure, you must use
the CALL statement; see the second and third examples for this core statement.
However, you can execute NCL procedures independently of the CALL statement.
The START and EXEC commands can execute an NCL procedure from OCS, or you
can use the CMD core statement or the INTCMD verb. The START command
immediately executes an asynchronous NCL process; EXEC queues the NCL
procedure as a process for serial execution (in relation to other NCL processes).
label
: PROCEDURE [ EXTPARSE { SIMPLE | SMART } ]
[ FOLD | NOFOLD ]
[ { SHARE | NOSHARE } {
share-list
| NO } ]
statement
…
END [
label
]
share-list
=
element
[,
element
] …
element
:
&*
&
simple-variable
[ * ]
&
stem-variable
. [ * ]
CALLER
label
specifies the name of the procedure. You must specify at least one label. The
CALL statement uses this label to call an NCL procedure.
See Section 8, “Compiler Operation,” for the definition of an NCL label.
EXTPARSE
specifies how NCL parses a supplied parameter string when you begin a new
NCL process.