stephglo
06-30-2011, 06:41 PM
Hello,
I am trying to decipher some rather interesting code written by someone else:
If (MyState AND (1 OR 32768)) = 0) then....
Where MyState is declared as a Long. The other two numbers are actually declared as constants of type Long as well, I just simplified for the sake of this post.
Can anyone tell me how AND and OR behave with type Long? I've previously seen AND used as a multiplication operator and OR as an addition operator but at least using some results in the Immediate window that doesn't appear to be what is going on here.
For example, the Immediate window gives (3 AND 34) = 2 which blows every theory I've come up with out of the water.
Ideas? I'm having a terrible time researching this since I can't find anyone addressing the use of typically Boolean operators with other types.
Thanks for any help, I truly appreciate it!
I am trying to decipher some rather interesting code written by someone else:
If (MyState AND (1 OR 32768)) = 0) then....
Where MyState is declared as a Long. The other two numbers are actually declared as constants of type Long as well, I just simplified for the sake of this post.
Can anyone tell me how AND and OR behave with type Long? I've previously seen AND used as a multiplication operator and OR as an addition operator but at least using some results in the Immediate window that doesn't appear to be what is going on here.
For example, the Immediate window gives (3 AND 34) = 2 which blows every theory I've come up with out of the water.
Ideas? I'm having a terrible time researching this since I can't find anyone addressing the use of typically Boolean operators with other types.
Thanks for any help, I truly appreciate it!