BitXor - Execute a binary XOR operation on a list of values

Top  Previous  Next

Syntax

<nReturnValue> := BitXor( <nVal1>, <nVal2> {,<nValn>} )

Parameters

<nVal1..n>

 

Numeric parameters containing LONG values to be used in the binary XOR operation.

Return value

The result of binary XORing all parameters.

Description

BitXor executes a binary exclusive-or operation (32 bits wide) with all parameters passed. All parameters must be LONG values. The return value is a LONG value with those bits set to 1 which were set in an odd number of parameters. This function is used when the macro (a ^^ b) is expanded.

Classification

Core

Category

Bit manipulation

Quick Info

Library: cckptcor.lib / cckptcor.dll

See also

^^, BitNot, BitAnd, BitOr

Example

 

#INCLUDE "CockpitCoreLibs.ch"

#INCLUDE "cmacros.ch"

 

FUNCTION Main

 

* This will output the value 5

? BitXor(1,2,6)  

 

* This is the equivalent in (almost) C syntax supported by Cockpit

? (1 ^^ 2 ^^ 6)

 

RETURN NIL