The arithmetic IF statement branches to one of three specified statements, depending on the value of an arithmetic expression.
Parameter |
Description |
e | Arithmetic expression: integer, real, double precision, or quadruple precision |
s1, s2, s3 | Labels of executable statements |
The IF statement transfers control to the first, second, or third label if the value of the arithmetic expression is less than zero, equal to zero, or greater than zero, respectively.
The restrictions are:
The s1, s2, s3 must be in the same program unit as the IF statement.
The same statement label can appear more than once in a IF statement.
The statement control jumps to must be executable, not DATA, ENTRY, FORMAT, or INCLUDE.
Control cannot jump into a DO, IF, ELSE IF, or ELSE block from outside the block.
N = 0 IF ( N ) 10, 20, 30
Since the value of N is zero, control is transferred to statement label 20.