NET/MASTER Network Control Language (NCL) Programmer's Guide
Declaring Procedures and User-Written Functions
Procedures and Functions
106160 Tandem Computers Incorporated 6–9
Declaring Procedures
and User-Written
Functions
You can declare both procedures and user-written functions explicitly but you can
declare only procedures implicitly. This subsection discusses how to begin and
terminate a procedure and function declaration. It discusses the following core
statements:
END
FUNCTION
PROCEDURE
Explicit Declaration The PROCEDURE and FUNCTION core statements begin an explicit declaration.
You must name the procedure or function with one or more labels. The name
identifies the procedure or function and is used to call it.
If the PROCEDURE or FUNCTION statement is the first executable statement in a
source file, then it is declaring that the source file is an external NCL procedure or
function. If the external procedure or function is called (by its source file name), then
the top-level internal procedure or function is executed.
If the PROCEDURE or FUNCTION statement is not the first executable statement in a
source file, then it is declaring an internal procedure or function within a source file.
You must use the END statement to close an explicit procedure and function
declaration. You can follow the END statement by the label (or any one of the labels if
there is more than one) that precedes the initial PROCEDURE or FUNCTION
statement. During compilation, this allows the compiler to check that a procedure or
function is correctly nested.
The following example shows an explicitly declared NCL procedure with two labels:
zex0604n: profile: PROCEDURE
/* Procedure with two labels */
CMD "PROFILE MONMSG=NO"
CMD "PROFILE UNSOL=NO"
CMD "PROFILE EMS=NO"
CMD "PROFILE CMDKEEP=NO"
CMD "PROFILE TRUNC=NO"
END zex0604n
This NCL procedure executes a series of PROFILE commands, which modify the
current OCS profile.