Skip to content

NOT

Binary Inversion

This string function returns the logical inverse, bit-by-bit, of a string expression.

NOT (string-value [,ERR=line-ref|,ERC=error-code])
string value
is any valid string.
line-ref
is the program line number or label to branch to if an error is produced by this function.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

The NOT operation outputs a 1 if the evaluated bit is 0 and outputs a 0 if the evaluated bit is a 1.

This operation is often referred to as a ones-complement operation.

NOT ("A")

returns the inverse of 0100 0001 which is 1011 1110.

LET NULL_STRING$ = AND(STRING$,NOT(STRING$))

assigns a string of null bytes (0000 0000) equal to the length of STRING$ to NULL_STRING$.

LET HIGH_VALUE$ = XOR(STRING$,NOT(STRING$))

assigns a string of high-value bytes (1111 1111) equal to the length of STRING$ to NULL_STRING$.

AND, IOR, and XOR functions

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF