Performs an exclusive bit-wise OR on two bit patterns, whereby the first pattern must be in an integer variable.
i ^= j
i:ivar
j:integer expression
i ^= j sets in the integer variable i only the bits which are set in i but are clear in j and vice versa.
The type of the operation is determined by the data type of the variable x. For integer variables GFA-BASIC 32 generates integer code.
Local i%
OpenW # 1
Print Bin$(3, 4) // Prints 0011
Print Bin$(10, 4) // Prints 1010
i% = 3
i% ^= 10
Print Bin$(i%, 4) // Prints 1001
i=i Xor j is synonymous with i ^= j and can be used instead.
&=, |=, ^=, ^, Operator Hierarchy
{Created by Sjouke Hamstra; Last updated: 18/09/2014 by James Gaite}