NET/MASTER Network Control Language (NCL) Programmer's Guide

Sharing Variables to Procedures and Functions
Procedures and Functions
6–36 106160 Tandem Computers Incorporated
The following screen shows the results of executing the procedure:
(13:25) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0618N
Pre-procedure call var_1 is One
Post-procedure call var_1 is One
Post-procedure call var_1 is Two
NNM1005 START ZEX0618N PROCESSING COMPLETE. NCLID 001119
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The first procedure call attempts to share &VAR_2 and &VAR_3, but these variables
do not exist. The second procedure call specifies that &VAR_1 is to be shared. The
CONTROL_PROC procedure declaration does not explicitly specify &VAR_1 in its
share list. However, using the CALLER keyword ensures that the CONTROL_PROC
procedure accepts all variables that are shared to it.
Interaction Between
Variable Sharing Methods
If a caller procedure or function wants to share variables with a callee procedure or
function, it must ensure that the callee is prepared to accept the variables. Likewise, if
a callee wants to accept variables from a caller, it must ensure that the caller is
prepared to pass the variables.
This depends on the interaction between the three methods of sharing variables and
the keywords that are used.
The Caller and Callee Specifications
The share list specified by a caller is called a caller list. The share list specified by a
callee is called a callee list. The caller specifies the list of variables to share to a callee
through a CONTROL verb or a CALL core statement. The callee specifies the list of
variables it will accept on the procedure or function declaration.
A variable list specified through the CALL core statement overrides the current setting
of the CONTROL verb (if any) for that CALL core statement only.