binary compare using VB ??

Dear All,

I am (probably like many of you) passing an Integer back from some of my

functions which contains various information using the binary digits... eg.

63 = 1+2+4+8+16+32 which is 111111 in binary...

or 37 = 1+4+32 which is 101001

What I want to do is use binary logic to determine if bit 3 is set.. like :

If MyVariable AND 16 then

' do something

End If

So if bit 5 was true, the statement above would be true...

I hope you all understand what I mean, and I hope someone can help !

It is obviously possible to write a function that would work it out, but if

there is a function that using the binary logic it should be far quicker..

Thanks in advance !

Chris