|
-
Jan 28th, 2005, 02:24 AM
#1
Thread Starter
Addicted Member
Unsigned 16-bit? - Resolved
Is there an unsigned 16-bit data type(word) in VB6? If no, is there a way to fake it?
Last edited by Max_aka_NOBODY; Jan 28th, 2005 at 06:13 AM.
-
Jan 28th, 2005, 02:30 AM
#2
Re: Unsigned 16-bit?
Both Boolean and Integer are two bytes (16 bits)
-
Jan 28th, 2005, 04:09 AM
#3
Re: Unsigned 16-bit?
 Originally Posted by Max_aka_NOBODY
Is there an unsigned 16-bit data type(word) in VB6? If no, is there a way to fake it?
Is this for an API call or something?
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]
Last edited by wossname; Jan 28th, 2005 at 04:12 AM.
I don't live here any more.
-
Jan 28th, 2005, 06:05 AM
#4
Thread Starter
Addicted Member
Re: Unsigned 16-bit?
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|