| THEN | |
| Syntax | IF expression THEN instructionlist |
| Explanation | THEN denotes the operational clause in an IF...THEN statement. If the input expression to IF is TRUE, then the Logo instruction list following THEN is executed. If the expression is FALSE, then the Logo instruction list following THEN is not executed. If there is an ELSE clause, the Logo instruction list following ELSE is executed.
Note that the word THEN is optional and may be omitted, as in the examples below. |
| Examples | IF 5 > 4 THEN PRINT [GREATER] GREATER IF 2 = 2 PRINT [YES] YES IF 3 = 2 PRINT [YES] ELSE PRINT [NO] NO TO ASK.OPINION PRINT [DO YOU THINK LOGO IS FUN?] MAKE "OPINION READWORD IF :OPINION = "YES THEN PRINT [I THINK SO TOO!] END ASK.OPINION defined ASK.OPINION DO YOU THINK LOGO IS FUN? YES I THINK SO TOO! |