LOTUSSCRIPT LANGUAGE


Xor operator
Performs a logical exclusion on two expressions.

Syntax

expr1 Xor expr2

Elements

expr1, expr2


Usage

The following table explains how LotusScript determines the result of the Xor operation.
expr1expr2Result
TRUE TRUE FALSE
TRUE FALSE TRUE
FALSE TRUE TRUE
FALSE FALSE FALSE
TRUENULLNULL
NULLTRUENULL
FALSENULLNULL
NULL FALSENULL
NULL NULL NULL
In addition to performing a logical exclusion, the Xor operator compares identically positioned bits in two numeric expressions (known as a bit-wise comparison) and sets the corresponding bit in the result according to the following table.
Bit n in expr1Bit n in expr2 Bit n in result
1 1 0
1 0 1
0 1 1
0 0 0

Example

' Boolean usage
Dim johnIsHere As Boolean, jimIsHere As Boolean

Dim oneButNotBothIsHere As Boolean

johnIsHere = TRUE

jimIsHere = FALSE

oneButNotBothIsHere = johnIsHere Xor jimIsHere

Print oneButNotBothIsHere         ' Prints True

' Bit-wise usage
Dim z As Integer, y As Integer
z% = &b11110000
y% = &b11001100
Print Bin$(z% Xor y%)              ' Prints 111100

See Also