XOR

result = expr1 XOR expr2

The logical exclusion operator.


expr1The first expression evaluating to either True or False (Boolean)
expr2The second expression evaluating to either True or False (Boolean)

REMARKS
* This is an Operator.
* The result is True only if one (and only one) evaluate to True.
* You can use the AND operator for logical and.
* You can use the NOT operator for logical not.
* You can use the OR operator for logical or.
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print True Xor True         '= False  
Debug.Print True Xor False '= True
Debug.Print False Xor False '= False
Debug.Print False Xor True '= True
Debug.Print (1 = 2) Xor (1 = 1) '= True
Debug.Print 1 = 2 Xor 1 = 1 '= True
Debug.Print 1 Xor 0 '= 1
Debug.Print 1 Xor -1 '= -2

Debug.Print True Xor Null '= Null
Debug.Print Null Xor True '= Null
Debug.Print False Xor Null '= Null
Debug.Print Null Xor False '= Null
Debug.Print Null Xor Null '= Null

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top