downtown1 at gmail dot com | Jul-05-04 22:22:28 |
Use this to check flags quickly.. "a" is (1<<0) (in binary 0001) "b" is (1<<1) (in binary 0010) "c" is (1<<2) (in binary 0100) etc. With this you could make a loop, i.e. flags = read_flags(szString) for (new i = 0; i < 26; i++) { if ( flags&(1<<i) ) //the flag is set, do something or not } But then again it's quicker only in the machine code sense, because usually you'd want different things depending on different flags. |