Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
IF (Arithmetic IF)
◄Up► ◄Contents► ◄Index► ◄Back►
─────IF (Arithmetic IF) ────────────────────────────────────────────────────
Action
Transfers control to one of three statement labels, depending on
the value of <expression>.
Syntax
IF (expression) label1, label2, label3
Parameter Description
expression An integer or real expression.
label1, label2, Labels of executable statements in the same
label3 program unit. The same statement label may
appear more than once.
Remarks
The arithmetic IF statement transfers control depending on the
value of expression:
If expression is: The next statement executed is:
< 0 The statement at <label1>
0 The statement at <label2>
> 0 The statement at <label3>
GOTO statements may not transfer control into a DO, IF, ELSEIF,
or ELSE block from outside the block. The $DO66 metacommand can
override this restriction for DO loops.
See Also: ◄$DO66►
Example
DO 40 j = -1, 1
n = j
C The following statement transfers control to statement 10
C for j = -1, to statement 20 for j = 0, and to statement 30
C for j = +1.
IF (n) 10, 20, 30
10 CONTINUE
.
.
.
20 CONTINUE
.
.
.
30 CONTINUE
.
.
.
40 CONTINUE
-♦-