Name
Not Keyword
Syntax
notBoolean expressionnotInteger expression
Description
The not operator
performs a negation. If the operand has type
Boolean, the negative is a logical negation
(not
False =
True and not
True = False). If the operand
is an integer, the not operator performs a bitwise
negation of each bit in the integer value. In other words, it
performs a complement operation.
Tips and Tricks
The ByteBool, LongBool, and
WordBool types interpret any non-zero ordinal
value as True. When not returns True, it always
returns an ordinal value of -1. In other words,
not
not
X
does not always have the same ordinal value as X.
If the ordinal value of a logical variable matters, you should use an
integer type and not a logical type.
See Also
| And Keyword, Boolean Type, False Constant, Integer Type, Or Keyword, True Constant, Xor Keyword |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access