TRUE, FALSE, NULL

Statement

Syntax

Name fixed values: TRUE and FALSE are truth values, NULL means no value, and PI is 3.141592653589793.

TRUE
FALSE
NULL
PI

Also written : TRUE, FALSE, NULL, PI

Good to know

  • TRUE is not 1, and FALSE is not 0. A variable set to TRUE prints true and is not equal to 1. Test it with IF ready THEN, or with IF NOT ready THEN.
  • A comparison stored in a variable gives 1 or 0, not TRUE or FALSE: done = (3 > 2) stores 1.
  • NULL is the start value of a HANDLE and of a task handle. Str(NULL) gives null. NULL is false in a condition, but 0 = NULL is false.
  • TRUE, FALSE and NULL are written in any case. PI is upper case only: pi or Pi is an unknown name and stops the program with "pi is not defined".

Example

ready = TRUEConsole(Str(ready))   ' trueIF ready THEN Console("ready")   ' readyIF ready = 1 THEN Console("never shown")done = (3 > 2)Console(Str(done))    ' 1h AS HANDLEIF h = NULL THEN Console("no handle yet")   ' no handle yetConsole(Str(PI))      ' 3.141592653589793
In the manual : Constants and operators