pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
ExampleSublocal Variable
INT array[0:5];Direct array
INT ro_array = 'P' := [0,1,2,3,4,5];Read-only array
Example 208 Function Subprocedure
PROC p;
BEGIN
SUBPROC p1;
BEGIN
INT .a[0:9];
INT .ext b[0:9];
a[0] := 1;
b[9] := 2;
END;
CALL p1;
END;
PROC q;
BEGIN
SUBPROC q1;
BEGIN
STRUCT .s;
BEGIN
INT i;
INT j;
END;
END;
END;
Entry-Point Declarations
The entry-point declaration associates an identifier with a secondary location in a procedure or
subprocedure where execution can start.
identifier
is an entry-point identifier to be placed in the procedure or subprocedure body. It is an alternate
or secondary point in the procedure or subprocedure at which to start executing.
Topics:
• Procedure Entry-Point Identifiers (page 260)
• Subprocedure Entry-Point Identifiers (page 262)
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.
260 Procedures, Subprocedures, and Procedure Pointers