IF

Syntax

IF statement [then-instructions] [else-instructions]

IF statement THEN instructions ELSE instructions

Explanation

IF runs the instructions if the result of the conditional statement is TRUE. If the conditional statement is FALSE, nothing is done unless ELSE follows the instructions.

See also IFFALSE and IFTRUE.

Examples

? TO TRY :NUMBER

>   IF :NUMBER >100 THEN PR [THE NUMBER IS TOO BIG] STOP

>   FD :NUMBER

>   LT 90

> END

TRY defined.

? TRY 85

? TRY 105

THE NUMBER IS TOO BIG

?