This would convert any hexadecimal number to binary without any error
This would convert any hexadecimal number to binary without any error
Rate This would convert any hexadecimal number to binary without any error
(1(1 Vote))
Dim Bin, Res As String
Dim a As Integer
For a = Val(Len(Trim(Text1.Text))) To 1 Step -1
Select Case Mid(Numero, a, 1)
Case "0": Bin = "0000"
Case "1": Bin = "0001"
Case "2": Bin = "0010"
Case "3": Bin = "0011"
Case "4": Bin = "0100"
Case "5": Bin = "0101"
Case "6": Bin = "0110"
Case "7": Bin = "0111"
Case "8": Bin = "1000"
Case "9": Bin = "1001"
Case "A": Bin = "1010"
Case "B": Bin = "1011"
Case "C": Bin = "1100"
Case "D": Bin = "1101"
Case "E": Bin = "1110"
Case "F": Bin = "1111"
Case Else
m = MsgBox("Su numero no es Hexadecimal", vbCritical, "Error")
End Select
Res = Bin + Res
Next a
For a = 1 To Len(Res)
If Mid(Res, a, 1) = "1" Then Exit For
Next a
Res = Mid(Res, a, Len(Res) - a + 1)
HexToBin = Res
End Function
This would convert any hexadecimal number to binary without any error Comments
No comments yet — be the first to post one!
Post a Comment