TRUE

TRUE is a predefined constant to be used in boolean expressions.

Syntax

TRUE

Usage

TRUE is a predefined constant that can be used as a boolean value in boolean expressions.

The TRUE constant is equal to 1 (one), as an INTEGER type.

For backward compatibility reasons, the TRUE constant is not of type BOOLEAN. This can have impact on data conversions, for example when using a JSON API where true / false are expected.

TRUE and FALSE are typically used as return values of functions that give a boolean result.

Example

MAIN
  DEFINE short BOOLEAN
  LET short = is_short("abcdef")
  IF short THEN
     DISPLAY "String is short."
  END IF
END MAIN

FUNCTION is_short(s)
  DEFINE s STRING
  IF s.getLength() < 10 THEN
     RETURN TRUE
  ELSE
     RETURN FALSE
  END IF
END FUNCTION