Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Par2: Hex to decimal conversion 1999-01-31 -- Lee White Not sure if this is what you're looking for...
Hex2Dec FUNCTION(? hString)
lVal LONG,AUTO
sPos BYTE,AUTO
Correction BYTE,AUTO
hCstring CSTRING(11),AUTO
CODE
hCstring = CLIP(hString)
lVal = 0
Correction = CHOOSE(UPPER(SUB(hCstring,-1,1)) = 'H',1,0)
LOOP sPos = 1 TO LEN(hCstring)-Correction
lVal = lVal*16+(INSTRING(hCstring[sPos],'0123456789ABCDEF',1,1))-1
END
RETURN(lVal)
Probably better ways but this should get you started.
Today is November 21, 2024, 6:49 am This article has been viewed 35205 times.
|
|