Purpose
The logical IF statement evaluates a logical expression and, if true, executes a specified statement.
Format
>>-IF--(--logical_expr--)--stmt-------------------------------->< |
When a logical IF statement is executed, the logical_expr is evaluated. If the value of logical_expr is true, stmt is executed. If the value of logical_expr is false, stmt does not execute and the IF statement has no effect (like a CONTINUE statement).
Execution of a function reference in logical_expr can change the values of variables that appear in stmt.
stmt cannot be a SELECT CASE, CASE, END SELECT, DO, DO WHILE, END DO, block IF, ELSE IF, ELSE, END IF, END FORALL, another logical IF, ELSEWHERE, END WHERE, END, END FUNCTION, END SUBROUTINE statement, FORALL construct statement or WHERE construct statement.
IF (ERR.NE.0) CALL ERROR(ERR)
Related Information