pTAL Reference Manual (H06.03+)
Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual—523746-005
14-5
Procedure Attributes
Procedure Attributes
Procedures can have the following attributes:
MAIN
causes the procedure to execute first when you run the program. When the MAIN
procedure completes execution, it passes control to the PROCESS_STOP_
system procedure, rather than executing an EXIT instruction.
If more than one procedure in a compilation has the MAIN attribute, the compiler
emits a warning and uses the first main procedure it sees as the main procedure.
For example, in the following source code, procedures main_proc1 and
main_proc2 have the MAIN attribute, but in the object file only main_proc1 has
the MAIN attribute:
PROC main_proc1 MAIN; ! This MAIN procedure is MAIN
BEGIN ! in the object file
CALL this_proc;
CALL that_proc;
END;
PROC main_proc2 MAIN; ! This MAIN procedure is not MAIN
BEGIN ! in the object file
CALL some_proc;
END;
MAIN
INTERRUPT
CALLABLE
PRIV
VARIABLE
( count )
EXTENSIBLE
RETURNSCC
OVERFLOW_TRAPS
NOOVERFLOW_TRAPS
LANGUAGE
C
COBOL
FORTRAN
PASCAL
UNSPECIFIED
VST635.vsd
RESIDENT










