Changes the status of a bit in an integer expression.
i = Bchg( m, n)( function)
Bchg v, n( command)
m, niexp
v:ivar
Bchg( m, n) sets the n-th bit in the integer expression m to 1 (if this bit is 0), or to 0 (if this bit is 1).
OpenW # 1
Dim i% = 10 // 10 => 1010
i% = Bchg(i%, 0) : Print Bin$(i%, 4) // Prints 1011
Bchg i%, 1 : Print Bin$(i%, 4) // Prints 1001
{Created by Sjouke Hamstra; Last updated: 24/09/2014 by James Gaite}