TAL Reference Manual

Procedures
TAL Reference Manual526371-001
13-5
Procedure Attributes
Procedure Attributes
Procedures can have the following attributes:
MAIN
The MAIN attribute 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 X and Y have the MAIN attribute,
but in the object file only X has the MAIN attribute:
PROC main_proc1 MAIN; !This procedure is MAIN in
BEGIN ! the object file
CALL this_proc;
CALL that_proc;
END;
PROC main_proc2 MAIN; !This MAIN procedure is not
BEGIN ! MAIN in the object file
CALL some_proc;
END;
VST1305.vsd
INTERRUPT
MAIN
PRIV
CALLABLE
RESIDENT
EXTENSIBLE
VARIABLE
LANGUAGE
count
)
(
C
COBOL
PASCAL
UNSPECIFIED
FORTRAN