IF (block)
Purpose
The block IF statement is the first statement in an IF construct.
Syntax
Rules
The block IF statement evaluates a logical expression and executes at most one of the blocks contained within the IF construct.
If the IF_construct_name is specified, it must appear on the END IF statement, and optionally on any ELSE IF or ELSE statements in the IF construct.
Examples
WHICHC: IF (CMD .EQ. 'RETRY') THEN
IF (LIMIT .GT. FIVE) THEN ! Nested IF constructs
...
CALL STOP
ELSE
CALL RETRY
END IF
ELSE IF (CMD .EQ. 'STOP') THEN WHICHC
CALL STOP
ELSE IF (CMD .EQ. 'ABORT') THEN
CALL ABORT
ELSE WHICHC
GO TO 100
END IF WHICHC
Related information
- IF construct
- ELSE IF
- ELSE
- END (Construct), for details on the END IF statement



