View Single Post
  #3  
Old 05-26-2006, 03:12 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Rick
if (flags & (flag1 | flag2))
uhhhhhhh... not really what I meant.
you could have
100000000000000000000000000000001
or
000000000000000010000000000000000

I mean, of course I would know the range of this flag. it certainly wouldn't take all 32 places.

What would be the best way to detect if there is more than one value stored in it though?

for (i=0; i<flagsize; i++) {
if (flag & 2^i)
this.flagcounter++;
if (this.flagcounter == 2)
return true;
}
return false;
Reply With Quote