THEN

THEN

EXECUTES THE NEXT STATEMENT OR THE NEXT BLOCK OF STATEMENTS IF THE CONDITION C IS TRUE

  • Type: Command
  • Parameter: 0
  • Group: Structures

ACTION

The command is a part of the "IF" command : IF condition THEN command(s), and is used to define the statement or the block of statements to be executed when the logical condition is true.

The "condition" is a single logical expression (built with comparators >, <, >=, <>, =, ...) or a complex expression combined with logical operators AND, OR, NOT and parenthesis. Only the result (True or False) is used to execute or not the statement or the block of statements after THEN.

SYNTAX: IF C THEN command(s)

  • C: logical expression.

USE

  • Thes command THEN is used to execute a statement or a block of statements depending on a logical condition.
  • "IF Condition THEN" is used to execute one statement or a few statements which can be written in the same line of the source.

ERROR

  • If C is not a correct logical expression.

EXAMPLE

dim a, b

a=1:b=2

if b>a then print "b is greater than a"

SEE ALSO

IF

END_IF

AND

OR

NOT