Xor
The Xor operator performs the boolean exclusive-or
operation. This operator will return True if one of
the two expressions evaluates to true. However, if both of
the expressions evaluate to True, the operator evaluates
as False.
| Expr1 |
Expr2 |
Result |
| False |
False |
False |
| False |
True |
True |
| True |
False |
True |
| True |
True |
False |
You should use this operator if you want to check if one of the
two expressions are true (but not both of the expressions are
true). In most cases, you can simply use the Or operator
since you won't care to exclude the case where both expressions
are True.
If Weekday(Date()) = vbMonday Xor Month(Date()) = 1 Then Response.Write "It is Monday or it is January" Response.Write "But it is not Monday and January" End If
|
 |

|