Like I said there are more than one way to skin a cat, I think people are looking too deep into this, The code I put up there is based on a selection, I would doubt that anybody will need more that a few selections, however, I do agree that this would not be the solution for more than a few selections. From the post it appears that the bit selection is for running certain routines one at a time based on some way of selecting those routines, how many are you likely to use ?.
I suppose if you have 32 bits then just loop through if you find more than one bit true then alarm.
I suppose if you have 32 bits then just loop through if you find more than one bit true then alarm.