FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-30
ELSE Statement
ELSE Statement
The ELSE statement defines the beginning of a block of statements to execute as an
alternative to the block of statements that follows an IF or ELSE IF statement. For
more information about the ELSE statement, see the IF Statement—Block on
page 7-60.
ELSE IF Statement
The ELSE IF statement defines the end of a block of statements that began with an IF
statement or ELSE IF statement, and defines the beginning of a block of statements to
execute as an alternative to the block of statements that follows the preceding IF or
ELSE IF statement. For more information about the ELSE IF statement, see the IF
Statement—Block on page 7-60.
END Statement
The END statement identifies the physical end of a program unit.
Considerations
If a subprogram reaches the END statement during program execution, the
subprogram returns to the program unit that called it.
If a main program reaches the END statement during program execution,
FORTRAN terminates your program.
The END statement is the only FORTRAN statement that you must write on one
line; it cannot have any continuation lines.
If the source file includes comment lines following the END statement of the last (or
only) program unit of a compilation, the compiler prints them but otherwise ignores
them.
Example
PROGRAM main
PRINT*, 'On vacation!'
END
END