NET/MASTER Network Control Language (NCL) Programmer's Guide
Calling Procedures and Functions
Procedures and Functions
106160 Tandem Computers Incorporated 6–43
Calling Procedures
and Functions
This subsection explains how to call a procedure or function. It describes procedure
and function call syntax. It discusses how the syntax of the call affects how NCL
searches for a procedure or function. Finally, it describes how NCL searches for the
labels of internal procedures and functions.
Calling a Procedure There are three main ways to call an NCL procedure:
Using the NCL CALL core statement inside a procedure or function.
Using the NonStop NET/MASTER MS START and EXEC commands from a
command input line or inside a procedure or function. These commands are
discussed in Section 8, “Executing NCL Procedures.”
Using the NCL START verb inside a procedure or function. The START verb is
discussed in Section 16, “Environments and Command Processing.”
Note The CALL core statement does not create another NCL process (in contrast to the NonStop
NET/MASTER MS START and EXEC commands and the START verb). An NCL procedure called by the
CALL core statement is not allocated an NCL process identifier. It does not create or dismantle any type
of environment.
Calling a Procedure Using the CALL Core Statement
You use the CALL core statement to call an NCL procedure from within an NCL
process.
When you want to call an internal procedure you call it by the label (or one of the
labels if more than one) by which you named it. When you want to call an external
procedure you must call it by the source file name.
Although you can follow CALL by the PROCEDURE keyword when you call a
procedure, normal practice is to omit it altogether. You can abbreviate PROCEDURE
to PROC.
The following statements, which illustrate how to use CALL, are synonymous:
CALL PROCEDURE abc (&A, &B, &C) SHARE &D*, &E*
CALL PROC abc (&A, &B, &C) SHARE &D*, &E*
CALL abc (&A, &B, &C) SHARE &D*, &E*
They all call the procedure ABC, pass the parameters &A, &B and &C to it, and share
all variables beginning with &D and &E.