BitXor Function (Binary, Binary) | |
Perform a bitwise exclusive OR operation on two or more values of Numeric, Varbinary, or Blob type and returns the result.
There is a numeric and a binary version of the syntax.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax FUNCTION BitXor(
Arg1 AS BINARY,
Arg2 PARAMS BINARY[]
) AS BINARY
public static Binary BitXor(
Binary Arg1,
params Binary[] Arg2
)
Request Example
View SourceParameters
- Arg1
- Type: Binary
Specifies Varbinary or Blob values to perform the bitwise AND operation.
- Arg2
- Type: Binary
Specifies Varbinary or Blob values to perform the bitwise AND operation.
Return Value
Type:
BinaryNumeric or
Varbinary.
BitXOR( ) returns the result of the bitwise exclusive OR operation performed on the specified expressions.
For
Varbinary or
Blob values, the return value is calculated as if all values are padded with 0h00 on the right of the value
up to the length of the longest value. The appropriate operation is then performed between those values.
Remarks BitXOR( ) compares each bit in eExpressionN to the corresponding bit in eExpressionN+1. If the bits in eExpressionN and eExpressionN+1 are the same,
the corresponding result bit is set to 0; otherwise, the corresponding result bit is set to 1.
The following table shows the result of an exclusive OR operation on corresponding eExpressionN and eExpressionN+1 bits:
eExpressionN bit | eExpressionN+1 bit | Result bit |
---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Examples 1Var1 = 5
2Var2 = 6
3? BitXOR(Var1,Var2)
See Also