|
-
Mar 20th, 2000, 08:36 PM
#1
Thread Starter
Addicted Member
Hi,
I need to convert a binary string to a hex string.
The code i've got works great but if i want to convert
1111111111111111 i get an overflow.
Thanx Asterix
***********THE CODE I'VE GOT************
Public Function Bin2Dec(Bin) As Integer
Y = Len(Bin) - 1
For X = 1 To Len(Bin)
Bin2Dec = Bin2Dec + ((2 ^ Y)) * (Mid$(Bin, X, 1))
Y = Y - 1
Next X
End Function
Private Sub Command1_Click()
Text2.Text = Hex(Bin2Dec(Text1.Text))
End Sub
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
|