What's the opposite of Hex$?

BlitzMax Forums/BlitzMax Beginners Area/What's the opposite of Hex$?

Gabriel(Posted 2006) [#1]
Is there an opposite to Hex$()? And the docs say that the Hex$() command, among others, is only in for basic compatibility, and that new commands supercede it. So which commands am I supposed to be using instead?


Perturbatio(Posted 2006) [#2]
Rem
bbdoc: HexToInt converts a hex value to integer
about: the value passed must be a string containing a valid Hex value ($ sign is optional)
EndRem
Function HexToInt:Int( HexStr:String )
	If HexStr.Find("$") <> 0 Then HexStr = "$" + HexStr$
	Return Int(HexStr)
End Function



Gabriel(Posted 2006) [#3]
Thanks, that works great.