# Using binaries as multiple flags

**URL:** <https://forum.kirupa.com/t/using-binaries-as-multiple-flags/292717>\
**Category:** flash\
**Created:** [July 17, 2009, 9:59pm UTC](https://forum.kirupa.com/t/using-binaries-as-multiple-flags/292717 "2009-07-17T21:59:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nook](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nook](https://forum.kirupa.com/u/nook)\
**Post date:** [July 17, 2009, 9:59pm UTC](https://forum.kirupa.com/t/using-binaries-as-multiple-flags/292717/1 "2009-07-17T21:59:52Z")

</div>

I’m thinking about using binaries as a sort of multiple flag but I can’t quite get my head around it and haven’t so far managed to google anything useful.

What I’m talking about is something like this:

Say you want to track the on/off state of four switches, each state would be represented by a binary like this:  
0001  
0010  
0100  
1000

Then all combinations of these states is represented by another binary, eg:  
1001  
0110  
1110  
etc…

I guess what I’m a bit puzzled about is how to check the results. I can think of ways to get there but I’d like to know common methods, or simply the best way to do it.

Any tip is appreciated.
