Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

$ZBITXOR (legacy function)

Bitstring function – XOR.

Synopsis

$ZBITXOR(bitstring1,bitstring2)

Description

This page describes the legacy function $ZBITXOR. It is described here for compatibility with legacy applications.

$ZBITXOR returns a bitstring formed by the (bitstring1 XOR bitstring2) operation. The length of the resulting bitstring equals the shorter length of the two bitstrings.

The following table shows the four possible results obtained by performing the XOR operation on two bits (b1 and b2):

b1 b2 equals
0 0 0
0 1 1
1 0 1
1 1 0

Example

If bitstring 1=[0,0,1,1,0] and bitstring 2=[0,1,1,0], then the result of $ZBITXOR would be [0,1,0,1]. That is:

Position 1: 0 XOR 0 = 0

Position 2: 0 XOR 1 = 1

Position 3: 1 XOR 1 = 0

Position 4: 1 XOR 0 = 1

Position 5: 0 XOR null = null

See Also