pTAL Reference Manual (H06.08+)
Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual—523746-006
14-23
Procedure Entry-Point Identifiers
Procedure Entry-Point Identifiers
Here are guidelines for using procedure entry point identifiers:
•
Declare all entry-point identifiers for a procedure within the procedure.
•
Place each entry-point identifier and a colon (:) at a point in the procedure at which
execution is to start.
•
You can call a procedure entry-point identifier from anywhere in the program. (For
functions, use the entry-point identifier in an expression; for other procedures, use
a CALL statement.)
•
Pass actual parameters as if you were calling the procedure identifier.
•
You cannot use a GOTO statement to branch to a procedure entry-point identifier.
•
To obtain the address of a procedure entry-point identifier, preface the identifier
with @.
•
You can specify FORWARD or EXTERNAL procedure entry-point declarations,
which look like FORWARD procedure declarations and EXTERNAL procedure
declarations.
Example 14-9. Procedure Entry-Point Identifiers
INT to_this := 314; ! Declare global data
PROC add_3 (g2);
INT .g2;
BEGIN
ENTRY add_2; ! Declare entry-point identifiers
ENTRY add_1;
INT m2 := 1;
g2 := g2 + m2;
add_2: ! Location of entry-point identifier add_2
g2 := g2 + m2;
add_1: ! Location of entry-point identifier add_1
g2 := g2 + m2;
END;
PROC mymain MAIN; ! Main procedure
BEGIN
CALL add_1 (to_this); ! Call entry point add_1
END;










