NET/MASTER Network Control Language (NCL) Programmer's Guide
Introducing NCL Procedures and Functions
Procedures and Functions
6–6 106160 Tandem Computers Incorporated
Note Be sure to match opening parentheses (() with closing parentheses ()) and to position commas correctly
when nesting built-in functions.
External Procedures and
External, User-Written
Functions
External procedures and external, user-written functions are separate, self-contained,
source files of NCL statements. (An external function is called a user-written function
because it is written by you and not distributed as part of NCL.) External procedures
and functions can be called from any other NCL procedure or function, including NCL
procedures and functions within the source file itself.
The name of an external procedure or function is the name of the TEDIT source file
that contains the NCL statements. The external procedure or function is called by the
name of the source file.
You can display the names of external procedures and functions by using the SHOW
FILEINFO command from the OCS command input line. When you enter Edit
Services, the names of external procedures and functions are automatically displayed.
Internal Procedures and
Internal, User-Written
Functions
Internal procedures and internal, user-written functions are sequences of NCL
statements inside a TEDIT source file. (An internal function is called a user-written
function because it is written by you and not distributed as part of NCL.) An internal
procedure or function can be called only from within the same source file.
The name of an internal procedure or function is given by the label preceding the
PROCEDURE or FUNCTION core statement that declares it. An internal procedure or
function is called by this label. The END statement terminates the procedure or
function declaration.
Figure 6-1 shows the structure of an internal procedure. The name of the procedure is
given by the label, TOP_LEVEL_P, before the PROCEDURE core statement. The END
core statement explicitly terminates the declaration of the procedure. The NCL
statements between the PROCEDURE and END statements form the body of the
procedure.
Figure 6-1. Structure of an Internal Procedure
top_level_p: PROCEDURE
statement1
statement2
statement3
…
END top_level_p