pTAL Reference Manual (H06.08+)

Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual523746-006
14-18
Procedure Body
subproc-decl
is a subprocedure declaration, as described in Subprocedure Declarations on
page 14-19.
statement
is any statement described in Section 12, Statements.
Example 14-6. Procedures
INT c; ! Global declaration
PROC first;
BEGIN ! Procedure body
INT a, ! Local declarations
b;
...
END;
PROC second;
BEGIN ! Procedure body
...
CALL first; ! Call first procedure
...
END;
Example 14-7. FORWARD Declaration for a Procedure
INT g2;
PROC procb (param1); ! FORWARD declaration for procb
INT param1;
FORWARD;
PROC proca;
BEGIN
INT i1 := 2;
CALL procb (i1); ! Call procb
END;
PROC procb (param1); ! Body for procb
INT param1;
BEGIN
g2 := g2 + param1;
END;