pTAL Conversion Guide

Procedures, Subprocedures, and Procedure
Pointers
pTAL Conversion Guide527302-002
16-22
Declaring STRUCTs as Formal Parameters
pTAL
In pTAL, you cannot declare a definition STRUCT as a formal parameter. You can
achieve the same effect in pTAL by using a referral STRUCT as a formal parameter,
and having it reference a previously declared structure, as in Example 16-20 on
page 16-22.
Example 16-19. Structures as Formal Parameters (TAL)
PROC p(i, j);
INT i;
STRUCT .J;
BEGIN
INT a;
INT b;
END;
BEGIN
...
END;
Example 16-20. Referral Structures as Formal Parameters (pTAL)
STRUCT s (*); ! Template
BEGIN
INT a;
INT b;
END;
PROC p (i, j);
INT i;
STRUCT .j (s); ! Define fields of j by referring to
BEGIN ! template s
...
END;