FORTRAN 77 Language Reference

Description

You can make a series of independent tests, and each test can have its own sequence of statements.

An ELSE IF block consists of all the executable statements following the ELSE IF statement up to, but not including, the next ELSE IF, ELSE, or END IF statement at the same IF level as the ELSE IF statement.

An ELSE IF block can be empty.

Execution of the ELSE IF (e) proceeds as follows, depending on the value of the logical expression, e:

  1. e is evaluated.

  2. If e is true, execution continues with the first statement of the ELSE IF block. If e is true and the ELSE IF block is empty, control is transferred to the next END IF statement at the same IF level as the ELSE IF statement.

  3. If e is false, control is transferred to the next ELSE IF, ELSE, or END IF statement at the same IF level as the ELSE IF statement.