Eqv Operator

рджреЛ рдПрдХреНрд╕рдкреНрд░реЗрд╢рди рдХреЗ рд▓реЙрдЬрд╝рд┐рдХрд▓ рдЗрдХреНрд╡рд┐рд╡реЗрд▓реЗрдВрд╕ рдХреА рдЧрдгрдирд╛ рдХрд░рддрд╛ рд╣реИ.

Syntax:

рдкрд░рд┐рдгрд╛рдо = рдПрдХреНрд╕рдкреНрд░реЗрд╢рди1 Eqv рдПрдХреНрд╕рдкреНрд░реЗрд╢рди2

рдкреИрд░рд╛рдореАрдЯрд░

Result: Any numeric variable that contains the result of the comparison.

Expression1, Expression2: Any expressions that you want to compare.

When testing for equivalence between Boolean expressions, the result is True if both expressions are either True or False.

In a bit-wise comparison, the Eqv operator only sets the corresponding bit in the result if a bit is set in both expressions, or in neither expression.

рдЙрджрд╛рд╣рд░рдг:

Sub ExampleEqv

Dim A As Variant, B As Variant, C As Variant, D As Variant

Dim vOut As Variant

    A = 10: B = 8: C = 6: D = Null

    vOut = vA > vB Or vB > vD REM -1

    vOut = vB > vA Or vB > vC REM -1

    vOut = vA > vB Or vB > vD REM -1

    vOut = (vB > vD Or vB > vA) REM 0

    vOut = vB Xor vA REM returns 2

End Sub