Hi,
i need to convert a hexdezimal string, for example "6C" to a Dezimal Value. Any Ideas how to do this with PureBasic? (Inline ASM tipps are welcome, as long as they are copy&paste&runable

thx in advance
skypa
Hi Skypa,Hi,
i need to convert a hexdezimal string, for example "6C" to a Dezimal Value. Any Ideas how to do this with PureBasic? (Inline ASM tipps are welcome, as long as they are copy&paste&runable)
thx in advance
skypa
Code: Select all
Procedure.l hex2dec(h$)
; h$ can be 0-FFFFFFF.
h$=UCase(h$)
For r=1 To Len(h$)
d60
d+Asc(a$)-55
Else
d+Asc(a$)-48
EndIf
Next
ProcedureReturn d
EndProcedure