Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Boolean OR 'OR' operator compares two operands and returns TRUE (-1) if either value is TRUE (non-zero), or returns FALSE (0) if both operands are FALSE (0). Boolean OR can be used in both variable and constant expressions. Example:

Code Block
X := Y OR Z

The above example compares the value of Y with the value of Z and sets X to either: TRUE (-1) if either Y or Z is non-zero, or FALSE (0) if both Y and Z are zero. During the comparison, it promotes each of the two values to -1 if they are non-zero, making any value, other than 0, a -1, so that the comparison becomes: "If Y is true or Z is true…"

...