NET/MASTER Network Control Language (NCL) Programmer's Guide
Sharing Variables to Procedures and Functions
Procedures and Functions
6–38 106160 Tandem Computers Incorporated
The following screen shows the results of executing the procedure:
(13:41) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0619N
Pre-procedure call vars are One 1 First Begin
Post-procedure call vars are One 1 First Begin
Post-procedure call vars are One 1 Last Begin
NNM1005 START ZEX0619N PROCESSING COMPLETE. NCLID 001138
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The default is no variable sharing (CONTROL NOSHRVARS) and so no variables are
shared on the first procedure call. The second procedure call overrides the setting of
the CONTROL verb by specifying a list of variables to share, &VAR_1, &VAR_2, and
&VAR_3. Since the CONTROL_PROC procedure specifies the SHARE keyword and a
list of variables that can be shared on the procedure declaration, the intersection of the
two share lists, &VAR_3, is shared. Accordingly, &VAR_3 is the only variable that is
changed.
The following table summarizes the interaction between the SHARE keyword on the
second procedure call and the SHARE keyword on the procedure declaration:
All Available Variables
Variables Shared by
Second Procedure
Call
Variables Shared by
Control Procedure
Declaration
Result of Variable
Sharing Interaction
&VAR_1 Yes No No
&VAR_2 Yes No No
&VAR_3 Yes Yes Yes
&VAR_4 No Yes No
The table shows that, in a finite set of variables (the set is &VAR_1, &VAR_2, &VAR_3,
and &VAR_4), specifying a subset of variables to share does not necessarily result in
those variables being shared: it is the interaction between the caller and the callee that
is important.