Not Operator

Negates an expression by inverting the bit values.

Sintakse:


Result = Not Expression

Parametri:

Rezultats: jebkurŔ skaitliskais mainīgais, kurŔ satur negācijas rezultātu.

Izteiksme1, Izteiksme2: jebkuras izteiksmes, kuras jūs vēlaties salīdzināt.

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.

Piemērs:


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
    mIzv = Not vA ' atgriež -11
    mIzv = Not(vC > vD) ' atgriež -1
    mIzv = Not(vB > vA) ' atgriež -1
    mIzv = Not(vA > vB) ' atgriež 0
End Sub

Please support us!