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

Eqv Operator

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

Used to perform a logical equivalence on two expressions. Syntaxresult=expression1Eqvexpression2 The Eqv operator syntax has these parts:

PartDescription
resultRequired; any numeric variable.
expression1Required; any expression.
expression2Required; any expression.

Remarks If either expression is Null, result is also Null. When neither expression is Null, result is determined according to the following table:

If expression1 isAnd expression2 isThe result is
TrueTrueTrue
TrueFalseFalse
FalseTrueFalse
FalseFalseTrue

The Eqv operator performs a bitwise comparison of identically positioned bits in two numeric expressions and sets the corresponding bit in result according to the following table:

If bit in expression1 isAnd bit in expression2 isThe result is
001
010
100
111

Example

This example uses the Eqv operator to perform logical equivalence on two expressions.

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