Having big probs writing a vb program that converts a binary number to Decimal and Hexidecimal. if you can help let me know.
Also could you tell me how to set the properties.
Thanks.
Sarah Jamerson
Printable View
Having big probs writing a vb program that converts a binary number to Decimal and Hexidecimal. if you can help let me know.
Also could you tell me how to set the properties.
Thanks.
Sarah Jamerson
Hello AnimalCub,
Try this source
Private Sub Form_Load()
Dim Q As String
Dim N As Integer
Dim Antwoord As Double
Q = "1010" 'the binary value
Antwoord = 0
For N = 0 To Len(Q) - 1
Antwoord = Antwoord + Val(Mid(Q, Len(Q) - N, 1)) * (2 ^ N)
Next
MsgBox Antwoord 'answer decimal
MsgBox Hex(Antwoord)'answer hexadecimal
End Sub
Be nice to the animals!
Michelle.