Table of contents
TOC
Collapse the table of content
Expand the table of content

Not Operator

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Used to perform logical negation on an expression. Syntaxresult=Notexpression The Not operator syntax has these parts:

PartDescription
resultRequired; any numeric variable.
expressionRequired; any expression.

Remarks The following table illustrates how result is determined:

If expression isThen result is
TrueFalse
FalseTrue
NullNull

In addition, the Not operator inverts the bit values of any variable and sets the corresponding bit in result according to the following table:

If bit in expression isThen bit in result is
o1
10

Example

This example uses the Not operator to perform logical negation on an expression.

Dim A, B, C, D, MyCheck
A = 10: B = 8: C = 6: D = Null    ' Initialize variables.
MyCheck = Not(A > B)    ' Returns False.
MyCheck = Not(B > A)    ' Returns True.
MyCheck = Not(C > D)    ' Returns Null.
MyCheck = Not A    ' Returns -11 (bitwise comparison).
© 2018 Microsoft