Booleans

Prev Next

Voids

The boolean data type takes two values which are reserved keywords: true and false. Boolean results are provided with comparisons.
Attention: The keywords are case-sensitive. True and TRUE are a string values, as well as 'true' and "false".

  echo(true, " / ", type(true));        // Boolean true
  echo(True, " / ", type(True));        // This is a string value (T is upper case.)
  echo(5 > 6, " / ", type(5 > 6));      // Boolean false
  echo(true & false);                   // Logical AND
  echo(true | false);                   // Logical OR
true / boolean
True / string
false / boolean
false
true
Try it yourself: Open LAN_Features_data_types_booleans.b4p in B4P_Examples.zip. Decompress before use.