Page 1 of 1

GetBit, SetBit and ToggleBit

Posted: Wed Jun 18, 2014 11:14 am
by staringfrog
I've read a bunch of solutions at the forum [here], and yet, I wish there was a built-in bitwise library (or just this additional set of functions, SetBit, ToggleBit, and GetBit), to operate on variables bitwisely in a clearcut fashion, without extra shifting or assembly, just something utterly simple like Success = SetBit (variable,1,0), Success = ToggleBit (variable,1,0) and Result = GetBit (variable,1) (where '1' is a bit position, and '0' is its value).