HexToInt?

BlitzMax Forums/BlitzMax Programming/HexToInt?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

and a teeny bit more optimized:
Function HexToInt( HexStr$ )
	Local n=0, tmp$=HexStr.Trim().ToUpper()
	For Local i eachin tmp$
		If i>47 And i<58 Then n=(n Shl 4)+i-48 ElseIf i>64 And i<71 Then n=(n Shl 4)+i-55 Else Return n
	Next
	Return n
End Function