Using these bit-flags are handy for setting a set of true/false values in one integer, instead of using a variable for every true/false value you have. Basically there are 32-bits in a number and each bit can either be set to 0 (false) or 1 (true).
I always use the shift left operation to set up a bunch of flags - it's easier to follow, something like this:
Const kF_Glow = 1 Shl 0
Const kF_Rings = 1 Shl 1
Const kF_LensRef = 1 Shl 2
You set flags like this:
Flags = kF_Glow Or kF_Rings Or kF_LensRef
Or like this:
Flags = Flags Or kF_Rings
(you can also use + instead of 'or' if you like, but 'or' is safer because if the flag is already set it won't cause a problem. If you use + and the flag is already set it will break because it is adding to the number, so you'll get a different value)
You remove flags like this:
Flags = Flags And ~kF_Glow
You can test if a flag is set like this:
If (Flags And kF_Glow) Then do something...
You can test if a flag isn't set like this:
If ( (Flags And kF_Glow) = 0 ) Then do even more stuff...
You can even test if a bunch of flags are set like this:
CheckFlags = kF_Glow Or kF_Rings
if ((Flags And CheckFlags) = CheckFlags) ) Then do stuff...
hope that helps,