GLBasic User Manual

Main sections

THEN

IF a#$ = < <= > >= <> b#$ THEN ...



The THEN command specifies a single command to be executed if the condition to its left evaluates to TRUE. For multiple commands to be executed, ommit the THEN and use a code block followed by an ENDIF statement.

Example:
 
a=5; b=3

IF a < b
PRINT "a < b", 100, 100
ELSE
PRINT "a < b is FALSE", 100, 100
ENDIF

IF a<>b THEN PRINT "a is not b", 100, 150

SHOWSCREEN
MOUSEWAIT


Output:
a < b is FALSE
a is not b

See also...