and PutBit()
here's a test
voila, you can now put up to 8 booleans into one byte.
(there's actually another way to do this, like the way bitflags are done for file attributes, don't feel like getting into it.)
Function PutBit(value, position, bit = True) Return value Or (bit Shl (position - 1)) End Function
here's a test
a = 128 Print Right$(Bin$(a),8) Print GetBit(a,7) a = PutBit(a,4) Print a Print Right$(Bin$(a),8) WaitKey End
voila, you can now put up to 8 booleans into one byte.
(there's actually another way to do this, like the way bitflags are done for file attributes, don't feel like getting into it.)