By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,644 Members | 2,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,644 IT Pros & Developers. It's quick & easy.

how to convert base 8 number into decimal number ? help me pls ... thks

P: 8
pls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
Nov 16 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 1,646
pls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
Hi this will do it for you;
Expand|Select|Wrap|Line Numbers
  1. Public Function ConvertOctalToDecimal(BinVal As String) As Long
  2. Dim lngVal As Long
  3. Dim lngTemp As Long
  4. Dim i As Integer
  5. Dim Length As Integer
  6.  
  7. Length = Len(BinVal)
  8. For i = 0 To Length - 1
  9.     lngTemp = CInt(Mid(BinVal, Length - i, 1))
  10.     lngVal = lngVal + (lngTemp * (8 ^ i))
  11. Next i
  12. ConvertOctalToDecimal = lngVal
  13. End Function
  14.  
Nov 16 '06 #2

P: 8
c2h
hello...willakawill, thankyou for your answer. It really work.... !! thanks u a lot !!!
Nov 16 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.