NOT Function

Returns the logical inverse of an expression.

Syntax

NOT(expression)

Syntax Elements

expression is any valid DataBasic expression or any string, substring, or value; expressed as a variable name, a value, or a string enclosed in quotes.

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.

expression must evaluate to a numeric quantity or a numeric string.

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.

Go to top button