G
Guest
Need help with a variable...
This variable is used to keep track of permissions and can contain
1,2,4,8,16,32,64,128
Or it can contain a sum of one more of the above values. For example, if
the variable has a value of 255, then it has all ove the above values added
together. I need help in figuring out the permissions, when for example the
variable contains 2 or more values added together. If I can break the larger
number down to it's lowest possible values then I can determine the
permissions. I'm sure there must be some mathmatical way to do this, but it
is eluding me so far. Any suggestions?
This variable is used to keep track of permissions and can contain
1,2,4,8,16,32,64,128
Or it can contain a sum of one more of the above values. For example, if
the variable has a value of 255, then it has all ove the above values added
together. I need help in figuring out the permissions, when for example the
variable contains 2 or more values added together. If I can break the larger
number down to it's lowest possible values then I can determine the
permissions. I'm sure there must be some mathmatical way to do this, but it
is eluding me so far. Any suggestions?