Eqv operator (LotusScript® Language)
Performs a logical equivalence on two expressions.
Syntax
expr1 Eqv expr2
Elements
expr1, expr2
Any expressions. Their values must lie within the range for Long values.
Usage
The following table explains how LotusScript® determines the result of the Eqv operation.
expr1 |
expr2 |
Result |
---|---|---|
TRUE |
TRUE |
TRUE |
TRUE |
FALSE |
FALSE |
FALSE |
TRUE |
FALSE |
FALSE |
FALSE |
TRUE |
TRUE |
NULL |
NULL |
NULL |
TRUE |
NULL |
FALSE |
NULL |
NULL |
NULL |
FALSE |
NULL |
NULL |
NULL |
NULL |
In addition to performing a logical equivalence, the Eqv operator compares identically positioned bits in two numeric expressions (known as a bit-wise comparison) and sets the corresponding bit in the result according to the following table.
Bit n in expr1 |
Bit n in expr2 |
Bit n in result |
---|---|---|
1 |
1 |
1 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
Example
Dim a As Variant, b As Variant, c As Variant
a = &HF
b = &HF0
c = &H33
Print TRUE Eqv TRUE ' Prints True
Print FALSE Eqv FALSE ' Prints True
Print TRUE Eqv FALSE ' Prints False
Print Hex$(a Eqv b) ' Prints FFFFFF00
Print Hex$(a Eqv c) ' Prints FFFFFFC3
Print Hex$(b Eqv c) ' Prints FFFFFF3C