I know converting to hex is Hex() whats converting from hex and oct?
Printable View
I know converting to hex is Hex() whats converting from hex and oct?
conavetna what to whaoct? you not is makan sens
Mars,Quote:
Originally posted by Mars-Martian
I know converting to hex is Hex() whats converting from hex and oct?
There isn't a built in Function to do Hex to Dec OR Oct to Dec.
However, there have been numerous posts on a Hex/Oct to Decimal converters
posted at the Forum. Do a search using keyword "Converter".
Little late on that post there Fox. :D
:D
I actually was researching my answer; I had a quick flick
tru my VB6 Programmers Reference book for alternates! :)
thank you all for the hex converting
*bows*
now does anyone know converting from oct to dec?
Just modify (as required) the HexToInt post to:
VB Code:
OctToInt = Val("&[b]o[/b]" & OctDat)
I'll stick it in a Function.......
Based on DiGiTalErRoR code, like:
VB Code:
Option Explicit Private Sub Form_Load() MsgBox HexOctToInt("FF", "&h") ' Pass a Hex value to Convert MsgBox HexOctToInt("10", "&o") ' Pass an Octal value to Convert End Sub Function HexOctToInt(ByVal HexOctDat As String, ConType As String) As Integer HexOctToInt = Val(ConType & HexOctDat) End Function