NOT Function

Returns the logical inverse of an expression.

Syntax

NOT(expression)

Syntax Elements

expression A DataBasic expression to be evaluated as a logical expression:

For details of the logical values of different types of expression, refer to Logical Expressions.

Comments

NOT returns a value of true (1) if expression evaluates to 0 and returns a value of false (0) if expression evaluates to a nonzero quantity.

Examples

X = NOT(X="")

Assigns the value 1 to variable X, because NOT(X="") is a true statement.

A = 1
B = 5
PRINT NOT(A AND B)

Prints 0 (zero), because the logical inverse of A AND B evaluates to false.

IF NOT(X1) THEN STOP

Terminates program if current value of variable X1 is 0.

PRINT NOT(M)

Prints a value of 1 if the current value of variable M is 0 or a null string; otherwise, prints a zero. If M is nonnumeric, an error message is returned.

PRINT NOT(5 LT 1)

Prints a value of 1.