GetBit, SetBit and ToggleBit
-
- User
- Posts: 58
- Joined: Wed Feb 27, 2013 9:36 am
GetBit, SetBit and ToggleBit
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).
Coding's men's knitwork.