not()

Function group Execute on client Platform(s)
General YES All

Syntax

not(expression)

Description

Returns the logical Not of an expression.

All expressions in Omnis have a Boolean (truth) value. Firstly, non-zero numeric values (including negative values) are TRUE, zero values are FALSE. Secondly, string values are TRUE or FALSE depending on their numeric equivalent. String '1' has boolean value 1, therefore not('1') is 0. 'Bill' has boolean value 0, 'YES' has numeric value 0.

The numeric value of an expression that evaluates to true is 1, therefore not(true) is 0. Similarly, not(false) is 1.

You can also use not() to make method code more readable.

Example

Calculate lVar1 as  not(2501)
# returns 0

Calculate lVar1 as not('Hello there!')
# is the same as not(0) which returns 1

Calculate lVar1 as not(31<45)
# is the same as not(true) which returns false

Do method ProcessList Returns Done
If not(Done)
  # do something
End If
# can be used to make code more readable