Intel fortran-80 Laptop User Manual


 
Program Execution Controls
4-4
An
ELSE
block consists
of
all the executable statements after the
ELSE
statement
up
to,
but
not
including, the next
END
IF statement
that
has the same nesting level
as the
ELSE
statement.
For
each block IF statement, there must be a corresponding
END
IF
statement in the
same
program
unit.
IF
...
ELSE
IF
...
IIF
BLOCK
ELSE IF BLOCK
IF
...
=:J
:
IF
BLOCK
END
IF
ELSE
_______________
--,
IF
...
IF.
. . ]
IF
BLOCK
ENDIF
IF
BLOCK ELSE BLOCK
END
IF
________
_
END
IF
______________
_
4.1.7 Block I F Statement
The
format
of
the block IF
is
IF
(exp)
THEN
where
'exp'
is
a logical expression.
If
the value
of
'exp'
is
TRUE,
execution continues with the first statement
of
the
IF
block.
If
the
IF
happens
to
be empty
and
'exp'
is
TRUE,
control passes to the next
END
IF statement
on
the. same nesting level as the block
IF
statement.
If
'exp'
is
FALSE,
control passes
to
the next
ELSE
IF, ELSE,
or
END
IF
on the same nesting
level as the block
IF
statement.
Control
cannot
be transferred into
an
IF block from outside the
IF
block (but see
section F.2.9.3).
If
the last statement in the IF block does
not
transfer control
to
another
executable
statement, control passes
to
the next
END
IF statement
that
has the same nesting
level as the block
IF
statement.
An
example
if
shown following the description
of
the
END
IF statement.
4.1.8 ELSE I F Statement
The ELSE
IF
statement has the
format
ELSE IF
(exp)
THEN
where
'exp'
is
a logical expression.
FORTRAN-SO