3
Сентябрь
2008
Как перевести число из шестнадцатиричной в десятичную систему
Данный код написан на VB.NET переделать под Vb 6.0 несоставит труда=)
Private Function HexToDec(ByVal strHex As String) As Long Dim result As Long Dim i As Integer Dim IntFromHex As Integer For i = 0 To strHex.Length - 1 Select Case strHex(i) Case "A" IntFromHex = 10 Case "B" IntFromHex = 11 Case "C" IntFromHex = 12 Case "D" IntFromHex = 13 Case "E" IntFromHex = 14 Case "F" IntFromHex = 15 Case Else If IsNumeric(strHex(i)) Then IntFromHex = CInt(strHex(i).ToString) End If End Select result += IntFromHex * 16 ^ (strHex.Length - i - 1) Next Return result End Function