552
XOR( ) Function
Logical Exclusive OR
Format
XOR(value1[$],value2[$][,ERR=stmtref])
Where:
stmtref
Program line number or label to transfer control to.
value1[$]
Compared values. String or numeric expressions/variables. If strings,
value2[$]
value1$ must be the same length as value2$
Returns
Result of logical exclusive 'OR' comparison of two expressions/variables.
Description
The XOR( ) function performs a bit-wise exclusive 'OR' comparison of two string or
numeric expressions/variables, and generates a value as a result. The length of the
two string expressions must be equal or ProvideX returns an Error #46: Length
of string invalid.
Binary
Result
0 XOR 0
0
1 XOR 0
1
0 XOR 1
1
1 XOR 1
0
Sample Comparison Results:
XOR($41$,$42$) yields Hex 03, 00000011
XOR($41$,$25$) yields Hex 64, 01100100
XOR($5A$,$DD$) yields Hex 87, 10000111
See Also
Examples
0040 READ (1,END=1000)F$
0050 R$=XOR(F$(1,2),$2020$) ! Convert to lower case
0060 ...
IF POS($00$=XOR(UCS(X$),LCS(X$)))=0 THEN PRINT X$," is all alpha!"