NOT Function

The NOT function returns the logical inverse of a given expression.

Format

NOT(expr)

Parameter(s)

expr

Expression to be logically inverted.

Description

The NOT function returns the logical complement of the value of expr. If the expression evaluates to true, the NOT function returns a value of false. If the value of expr is false, the NOT function returns a value of true.

An expression is considered false if it evaluates to 0 or the null string (""). If an expression evaluates to any other value, it is considered true. See Format, Data and Expressions for more information on logical values.

Example

This example demonstrates how the NOT function can be used to verify that meaningful data has been input by the user:

PRINT "ENTER YOUR ACCOUNT NUMBER : " :  

INPUT ACCT,6, "?"_    

IF NOT(NUM(ACCT)) THEN STOP

The account number input must be numeric in order to be valid. If it is not, the program is aborted.

See Also

Statement and Function Reference