TAL Programmer's Guide
Using Parameters
Using Procedures
096254 Tandem Computers Incorporated 11–25
VARIABLE or EXTENSIBLE Procedures as Parameters. When you call a VARIABLE or
EXTENSIBLE procedure declared as a formal parameter, include an actual parameter
list as usual. For each omitted actual parameter, however, you must specify an empty
comma for each word of the parameter. For example, to omit a FIXED parameter,
specify four empty commas, one for each word of the omitted quadrupleword.
In the actual parameter list, you must also include a parameter mask that indicates
which parameters are passed and which are omitted.
In the following example, the actual parameter list in the call to PARAM_PROC
includes:
Two empty commas, one for each word of omitted INT(32) parameter named P2.
A parameter mask (%B101, where 1 denotes a passed parameter and 0 denotes an
omitted parameter)
PROC var_proc (p1, p2, p3) VARIABLE; !Declare VAR_PROC
INT(32) p1, p2, p3;
BEGIN
!Lots of code
END;
PROC ext_proc (p1, p2, p3) EXTENSIBLE; !Declare EXT_PROC
INT(32) p1, p2, p3;
BEGIN
!Lots of code
END;
PROC normal_proc (param_proc); !Declare NORMAL_PROC
PROC param_proc;
BEGIN
CALL param_proc ( !Call PARAM_PROC
0d, !Pass parameter for p1
, , !Omit parameter for p2 (two words)
-1d, !Pass parameter for p3
%B101); !Pass parameter mask
END;
PROC m MAIN;
BEGIN
CALL normal_proc (var_proc);
CALL normal_proc (ext_proc);
END;
“Parameter Masks” later in this section describes the format of VARIABLE and
EXTENSIBLE parameter masks. Section 17, “Mixed-Language Programming”
describes the use of procedures as parameters in other languages.