With all due respect, we're talking about some pretty basic stuff here.
Your display of representative values of the 'VType' and 'Flags' columns is in decimal. Convert the values to hex and it'll be easier to understand why an expression like (Flags & 0x400 = 0x400) is TRUE for a Flags value of 1024 (dec).
It's almost impossible for me to avoid appearing condescending when talking at that level, and discussing such things as binary and hexadecimal representations of numbers, bit-wise operations on those numbers, etc. will make me appear just that.
Please don't take this the wrong way, but you need to get a good basic introductory book on computers and how they work...
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com