Accessing Bits

BlitzMax Forums/BlitzMax Programming/Accessing Bits

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I would like to learn how to break a byte down to it's bit level. So i can access that one bit to settings. Similar to the Constant techinques found in openGL and Max2D collision system.

00000001 = 1
00000010 = 2
00000100 = 4

I can add these values together

00000111 = 7

Those numbers never need to "carry" so i can use 8 boolean switches for settings.

I remember looking up the math for it before. Kinda forget it though. I want to go to bed so..can you help me. Thanks for you time :D.