pls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
how to convert base 8 number into decimal number ? help me pls ... thks
Collapse
X
-
Hi this will do it for you;Originally posted by c2hpls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
Code:Public Function ConvertOctalToDecimal(BinVal As String) As Long Dim lngVal As Long Dim lngTemp As Long Dim i As Integer Dim Length As Integer Length = Len(BinVal) For i = 0 To Length - 1 lngTemp = CInt(Mid(BinVal, Length - i, 1)) lngVal = lngVal + (lngTemp * (8 ^ i)) Next i ConvertOctalToDecimal = lngVal End Function
Comment