467,880 Members | 1,087 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,880 developers. It's quick & easy.

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

pls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
Nov 16 '06 #1
  • viewed: 1288
Share:
2 Replies
1GB
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
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.

Similar topics

1 post views Thread by ferran | last post: by
13 posts views Thread by Hako | last post: by
6 posts views Thread by sweeet_addiction16 | last post: by
8 posts views Thread by te509 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.