Is there an unsigned 16-bit data type(word) in VB6? If no, is there a way to fake it?
Printable View
Is there an unsigned 16-bit data type(word) in VB6? If no, is there a way to fake it?
Both Boolean and Integer are two bytes (16 bits)
Is this for an API call or something?Quote:
Originally Posted by Max_aka_NOBODY
You could try using this. I haven't coded in VB6 for a while so I may be wrong.
VB Code:
Public Type UInt16 Hi as Byte '8bits Lo as Byte '8bits End Type
To extract the held value just use
VB Code:
dim x as UInt16 x = '//some data// [B]MyNumber = (x.Hi*256) or x.Lo[/B]
No, I need to read a binary value from a file that is a word. Although I'm not planning any math operations on it, a simple integer would work, butI prefer to keep the values in correct formats, and I might just have to display it once or twice. As for the approach, thanx a lot for it, it's so simple. How could I not think of that myself? :blush: