Xor: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
''result'' = ''x'' | ''result'' = ''x'' XOr ''y'' | ||
== Description == | |||
XOr returns the logical, exclusive disjunction of two expressions. ''result'' is TRUE, if and only if one of the expressions ''x'' and ''y'' evaluate to TRUE, otherwise, ''result'' is FALSE. | |||
== Example == | |||
<pre> | <pre> | ||
Rem XOr Example | |||
' | 'XOr performs exclusive disjunctions | ||
Dim Test1, Test2, x, y | |||
x = 2 | x = 2 | ||
y = 9 | y = 9 | ||
Test1 = x > 0 | Test1 = x > 0 XOr y < 10 | ||
Test2 = x > 0 | Test2 = x > 0 XOr y > 10 | ||
Print "Logical:" | |||
Print " x > 0 XOr y < 10 = " & CStr(Test1) | |||
Print " x > 0 XOr y > 10 = " & CStr(Test2) | |||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
Logical: | Logical: | ||
x > 0 | x > 0 XOr y < 10 = False | ||
x > 0 | x > 0 XOr y > 10 = True | ||
</pre> | </pre> | ||
== Related Items == | |||
[[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[not|NOT]], [[or|OR]] | [[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[not|NOT]], [[or|OR]] |
Revision as of 04:26, 17 August 2012
result = x XOr y
Description
XOr returns the logical, exclusive disjunction of two expressions. result is TRUE, if and only if one of the expressions x and y evaluate to TRUE, otherwise, result is FALSE.
Example
Rem XOr Example 'XOr performs exclusive disjunctions Dim Test1, Test2, x, y x = 2 y = 9 Test1 = x > 0 XOr y < 10 Test2 = x > 0 XOr y > 10 Print "Logical:" Print " x > 0 XOr y < 10 = " & CStr(Test1) Print " x > 0 XOr y > 10 = " & CStr(Test2)
Output
Logical: x > 0 XOr y < 10 = False x > 0 XOr y > 10 = True