XL Fortran for AIX 8.1

Language Reference

ELSE IF

Purpose

The ELSE IF statement is the first statement of an optional ELSE IF block within an IF construct.

Format



>>-ELSE IF--(--scalar_logical_expr--)--THEN--+-------------------+-><
                                             '-IF_construct_name-'
 
 

IF_construct_name
is a name that identifies the IF construct

Rules

scalar_logical_expr is evaluated if no previous logical expressions in the IF construct are evaluated as true. If scalar_logical_expr is true, the statement block that follows is executed and the IF construct is complete.

If you specify an IF_construct_name, it must be the same name that you specified in the block IF statement.

Examples

IF (I.EQ.1) THEN
    J=J-1
ELSE IF (I.EQ.2) THEN
    J=J-2
ELSE IF (I.EQ.3) THEN
    J=J-3
ELSE
    J=J-4
END IF

Related Information


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