The Xor operator is used to perform a logical exclusion on two
expressions, where the expressions are Null, or are of Boolean subtype
and have a value of True or False.
The Xor operator can also be used a "bitwise operator" to make a bit-by-bit comparison of
If both bits are the same in the comparison (both are 0's or 1's), then a 0 is returned.
Otherwise, a 1 is returned.
<% =True Xor True %>
=True Xor False %>
<% =False Xor True %>
<% =False Xor False %>
<% expression1 = True %>
<% expression2 = False %>
<% =expression1 Xor expression2 %>
In this example, the Xor performs a bitwise comparison on the 3 (in binary 011)
and the 5 (in binary 101), and returns a 6 (in binary 110).
Expression1 = 3
Expression2 = 5
Result = Expression1 Xor Expression2
Response.Write "Result = " & Result
Result = 6
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.