NET/MASTER Network Control Language (NCL) Programmer's Guide
Sharing Variables to Procedures and Functions
Procedures and Functions
6–32 106160 Tandem Computers Incorporated
The following screen shows the results of executing the procedure:
(12:54) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0616N
Pre-procedure call var_1 is One
Post-procedure call var_1 is One
Post-procedure call (SHARE), var_1 is Two
NNM1005 START ZEX0616N PROCESSING COMPLETE. NCLID 002077
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
When the CONTROL_PROC procedure is called for the first time, the default setting
of CONTROL NOSHRVARS is in effect: the value of &VAR_1 does not change. When
the CONTROL_PROC procedure is called for the second time, because the CALL core
statement explicitly specifies variable sharing (for &VAR_1), the value of &VAR_1 is
changed.
The Contents of a Share
List
A share list is the list of elements after either a SHARE, NOSHARE, SHRVARS, or
NOSHRVARS keyword. A share list can consist of three types of elements:
A variable specification
The NO keyword
The CALLER keyword
Using a Variable Specification in a Share List
A variable specification in a share list can be either a single variable or a variable
prefix.
The variables in the share list must be simple or stem variables (this includes mapped
data object (MDO) variables). No complex, compound, nested, or global variables are
permitted. If you specify a stem variable, the entire set of compound variables for that
stem are shared. System variables cannot be returned (they are compound variables).
You can include the following variables in a share list:
&abc /* Simple variable */
&abc. /* Stem variable */
&a* /* Simple variable prefix */