Not Operator

Negates an expression by inverting the bit values.

āļšāˇāļģāļš āļģāˇ“āļ­āˇ’āļē:


Result = Not Expression

āļ´āļģāˇāļ¸āˇ’āļ­āˇ“āļąāˇŠ:

Result:āˇƒāļ‚āļšāļŊāļąāļēāˇš āļ´āˇŠâ€āļģāļ­āˇ’āļĩāļŊāļē āļ…āļŠāļ‚āļœāˇ” āˇ€āļą āļ•āļąāˇ‘āļ¸ āˇƒāļ‚āļ›āˇŠâ€āļēāˇāļ­āˇŠāļ¸āļš āˇ€āˇ’āļ āļŊāˇŠâ€āļēāļēāļšāˇŠ.

Expression1, Expression2: āļ”āļļāļ§ āˇƒāļ¸āˇŠāļļāļąāˇŠāļ° āļšāļģāˇ“āļ¸āļ§ āļ…āˇ€āˇāˇŠâ€āļē āļ•āļąāˇāļ¸ āˇƒāļ‚āļ›āˇŠâ€āļēāˇāļ­āˇŠāļ¸āļš āļ´āˇŠâ€āļģāļšāˇāˇāļąāļēāļąāˇŠ.

When a Boolean expression is negated, the value True changes to False, and the value False changes to True.

In a bitwise negation each individual bit is inverted.

āļ‹āļ¯āˇāˇ„āļģāļĢāļē:


Sub ExampleNot
Dim vA As Variant, vB As Variant, vC As Variant, vD As Variant
Dim vOut As Variant
    vA = 10: vB = 8: vC = 6: vD = Null
    vOut = Not vA ' Returns -11
    vOut = Not(vC > vD) ' Returns -1
    vOut = Not(vB > vA) ' Returns -1
    vOut = Not(vA > vB) ' Returns 0
End Sub

Please support us!