Er, but you don't have to do this. Both the Oct and Hex methods return a string representation of the source decimal number. VB continues to work in decimal. To get the decimal of an octal or hex string representation you just need to do:
strongm, I think "&H" must be provided. Otherwise VB does not know whether the source number is decimal, hexadecimal or octal. Consider the following example.
___
Dim HexNum As String, DecNum As Long
DecNum = 60
HexNum = Hex$(DecNum)
MsgBox HexNum 'Says 3C
DecNum = Val(HexNum)
MsgBox DecNum 'Says 3 ignoring C (wrong)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.