HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
ELSE
Chapter 10334
ELSE
Provides a default path of execution for IF construct.
Syntax
ELSE [
construct-name
]
construct-name
is the name given to the IF construct. If
construct-name
is specified, the
same name must also appear in the IF statement and in the END IF
statement.
Description
The ELSE statement is used in an IF construct to provide a statement block for execution if
none of the logical expressions in the IF and ELSE IF statements in the IF construct
evaluates to true.
An IF construct may contain (at most) one ELSE statement. If present, it must follow all ELSE
IF statements within the IF construct.
Examples
IF (a > b) THEN
max = a
ELSE IF (b > max) THEN
max = b
ELSE
PRINT *, 'The two numbers are equal.'
STOP 'Done'
END IF
Related statements
ELSE IF, END IF, and IF (construct)
Related concepts
See “IF construct” on page 145.