Main program
A main program is the program unit that receives control from the
system when the executable program is invoked at run time.
- PROGRAM_statement
- See PROGRAM for syntax details
- specification_part
- is a sequence of statements from the statement groups numbered 2 , 4 , and 5 in Order of statements and execution sequence
- execution_part
- is a sequence of statements from the statement groups numbered 4 and 6 in Order of statements and execution sequence, and which must begin with a statement from statement group 6
- internal_subprogram_part
- See Internal procedures for details
- END_PROGRAM_statement
- See END for syntax details
A main program cannot contain an ENTRY statement, nor can it specify an automatic object.
A RETURN statement can appear in a main program. The execution of a RETURN statement has the same effect as the execution of an END statement.