pTAL Conversion Guide

Procedures, Subprocedures, and Procedure
Pointers
pTAL Conversion Guide527302-002
16-19
Parameters and VARIABLE and EXTENSIBLE
Procedures
Parameters and VARIABLE and EXTENSIBLE Procedures
In pTAL as in TAL, memory is allocated for all parameters to VARIABLE or
EXTENSIBLE procedures; therefore, your program can store default values for those
parameters the caller does not pass.
TAL
In TAL, in addition to using the $PARAM routine, you can also directly access the
parameter mask of a VARIABLE or EXTENSIBLE procedure to determine which
parameters were passed.
pTAL
In pTAL, you cannot directly access the parameter mask. You must use the $PARAM
routine to determine which parameters were passed by the caller.
VARIABLE, EXTENSIBLE, and RETURNSCC Procedures as
Actual Parameters
TAL
In TAL, you can pass the name of any procedure as a parameter if the formal
parameter in the called procedure is declared PROC and then call the procedure by
specifying the identifier of the formal parameter, as in Example 16-15 on page 16-19.
Example 16-15. VARIABLE, EXTENSIBLE, and RETURNSCC Procedures as
Actual Parameters (TAL)
PROC p1 (i, j) EXTENSIBLE;
INT i, j;
EXTERNAL;
PROC p2( p );
PROC p;
BEGIN
INT i, j;
...
CALL p(i, j);
END;
PROC p3;
BEGIN
CALL p2(p1);
END;