Collabora Office 24.04 Help
Izvršava logičku Ekskluzivnu-ILI kombinaciju dva izraza.
Result = Expression1 XOR Expression2
Result: Any numeric variable that contains the result of the combination.
Expression1, Expression2: Any numeric expressions that you want to combine.
Logički Ekskluzivni-ILI dva bool-ova izraza vraća vrijednost True samo ako su dva izraza različita jedan od drugoga.
A bitwise Exclusive-Or conjunction returns a bit if the corresponding bit is set in only one of the two expressions.
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
vOut = vA > vB XOR vB > vC ' returns 0
vOut = vB > vA XOR vB > vC ' returns -1
vOut = vA > vB XOR vB > vD ' returns -1
vOut = (vB > vD XOR vB > vA) ' returns 0
vOut = vB XOR vA ' returns 2
End Sub