Sólo tienes que pulsar F1-Ayuda y te sale el mensaje explicándolo
Aquí un ejemplo:
Código Delphi
[-]var
num1, num2, num3 : Integer;
letter : Char;
begin
num1 := $25;
num2 := $32;
letter := 'G';
if (num1 > 0) Xor (letter = 'G')
then ShowMessage('Only one of the values is true')
else ShowMessage('Both values are true or false');
num3 := num1 Xor num2;
ShowMessageFmt('$25 Xor $32 = $%x',[num3]);
end;
Cita:
The Xor keyword is used in two different ways:
1. To perform a logical or boolean 'Exclusive-or' of two logical values. If they are different, then the result is true.
2. To perform a mathematical 'Exclusive-or' of two integers. The result is a bitwise 'Exclusive-or' of the two numbers. For example:
10110001 Xor 01100110 = 11010111
|
Como ves, 1 xor 0 es 1, 0 xor 1 es 1, 0 xor 0 es 0 y 1 xor 1 es 1.