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

Sharing Variables to Procedures and Functions
Procedures and Functions
106160 Tandem Computers Incorporated 6–37
Using Two SHARE Keywords
If both the caller and callee have specified a list of variables to share using the SHARE
keyword, then the intersection of both lists is shared.
The following example shows how specifying the SHARE keyword on both a
procedure declaration and a procedure call affects variable sharing:
zex0619n: PROCEDURE
/* Two SHARE keywords */
/* Default is CONTROL NOSHRVARS */
&var_1 = One
&var_2 = 1
&var_3 = First
&var_4 = Begin
SAY "Pre-procedure call vars are "&var_1,
&var_2,
&var_3,
&var_4
CALL control_proc
SAY "Post-procedure call vars are "&var_1,
&var_2,
&var_3,
&var_4
CALL control_proc SHARE &var_1, &var_2, &var_3
SAY "Post-procedure call vars are "&var_1,
&var_2,
&var_3,
&var_4
control_proc: PROCEDURE SHARE &var_3, &var_4
&var_1 = Two
&var_2 = 2
&var_3 = Last
&var_4 = End
END control_proc
END zex0619n