GA8Ya‖

AaD4r‖XOR Operator

kbfD6‖Performs a logical Exclusive-Or combination of two expressions.

DpFcu‖Syntax:


kc98h‖Result = Expression1 XOR Expression2

JdDdD‖Parameters:

Ei285‖ Result: Any numeric variable that contains the result of the combination.

SFko4‖ Expression1, Expression2: Any numeric expressions that you want to combine.

J4RFt‖A logical Exclusive-Or conjunction of two Boolean expressions returns the value True only if both expressions are different from each other.

M3HqC‖A bitwise Exclusive-Or conjunction returns a bit if the corresponding bit is set in only one of the two expressions.

ZHPEa‖Example:


Sub ExampleXOR
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
Gzh2F‖    vOut = vA > vB XOR vB > vC ' returns 0
nQd4j‖    vOut = vB > vA XOR vB > vC ' returns -1
BdYTS‖    vOut = vA > vB XOR vB > vD ' returns -1
iwMA7‖    vOut = (vB > vD XOR vB > vA) ' returns 0
q4sE4‖    vOut = vB XOR vA ' returns 2
End Sub