XL Fortran for AIX 8.1

Language Reference


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-'
 
 
>>-+--------------------+--------------------------------------><
   '-specification_part-'
 
 
>>-+----------------+------------------------------------------><
   '-execution_part-'
 
 
>>-+--------------------------+--------------------------------><
   '-internal_subprogram_part-'
 
 
>>-END_PROGRAM_statement---------------------------------------><
 
 

PROGRAM_statement
See PROGRAM for syntax details

specification_part
is a sequence of statements from the statement groups numbered (2), (3), and (4) in Order of Statements and Execution Sequence

execution_part
is a sequence of statements from the statement groups numbered (3) and (5) in Order of Statements and Execution Sequence, and which must begin with a statement from statement group (5)

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.

+-------------------------------IBM Extension--------------------------------+

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.

+----------------------------End of IBM Extension----------------------------+

A main program cannot reference itself, directly or indirectly.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]