488
NOT( ) Function
Invert String Bits/Logical Condition
Formats
Where:
data$
Data whose bits are to be inverted. String expression.
num
Value for inverting a logical condition. Numeric expression.
stmtref
Program line number or label to transfer control to.
Returns
Inverted value, string or numeric.
Description
This function returns the inverted value of a string or numeric (i.e., with all ON bits
turned OFF and vice versa).
Format 1: Invert String
NOT(data$[,ERR=stmtref])
The NOT( ) function inverts the value of the bits in the character string specified. The
string returned by the NOT( ) function will be the same length as the given data
string. All OFF bits in the string will be returned ON, while all ON bits will be
returned OFF. The string expression can be a literal like "abc" or $8A$, a variable
such as A$, or an expression using operators, such as A$="1234"; e.g.,
yields
A$=NOT($0010$)
A$=$FFEF$
yields
A$=NOT($FF00FF$)
A$=$00FF00$
yields
A$=NOT($5A5A$)
A$=$A5A5$
Format 2: Invert Logical Condition
NOT(num[,ERR=stmtref])
Use this format to invert a logical condition. If the result of the condition is 0 (false),
this function returns 1 (true). Otherwise this function returns 0 (false); e.g.,
IF NOT(CST_ID$=CMPR_ID$)
THEN GOSUB NO_MATCH