| IF | |
| Syntax | IF expression [then-instructions] IF expression [then-instructions] [else-instructions] IF expression THEN instructions IF expression THEN instructions ELSE instructions |
| Explanation | IF runs the first set of instructions if the result of the expression is TRUE. If the expression is FALSE, the second set of instructions, if present, is run. |
| Examples | TO TRY :NUMBER IF :NUMBER >100 THEN PR [THE NUMBER IS TOO BIG] STOP FD :NUMBER LT 90 END TRY defined TRY 105 THE NUMBER IS TOO BIG TO AGAIN? PRINT "|Do you want to play again?| IF RQ = "Y [GAME] [PRINT "|Thanks for playing!| TOPLEVEL] END AGAIN? defined AGAIN? Do you want to play again? N Thanks for playing! |