THEN

BASin

THEN

Statement

THEN Separates the condition from the code to be executed in an IF statement.

How to use THEN

THEN is preceded by IF, and a condition. It is followed by one or more statements, for example

10 IF x=0 THEN PRINT "YOU LOSE!" : STOP

If the condition (x=0 above) is true then the program PRINTs "YOU LOSE!" and then executes a STOP statement. If x is any other value then neither of the statements following THEN will be executed, and the program will continue on to the next line.

Format

  • IF cond THEN statement [: statement]

See also

Chapter 3.