Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Better Faster HEX to INTEGER function less bulky too! also has AlphaNumberic converter too.

Author
Message
ironhoof
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 16th Dec 2002 09:56
-Reminder made in DB not DBPRO so it may take a tweak or two to work in DBP

Hex Value Function "No strings directly used for speed"

function HexVal(hexnum$)
hexnum$=upper$(hexnum$):LENG=LEN(hexnum$):COUNT=1:V2=0
IF LENG=1 THEN GOTO SINGLE:
MORE:
NYBBLE$=mid$(hexnum$,COUNT):NYB=ASC(NYBBLE$):V=0
if val(NYBBLE$)>0 then V=Val(NYBBLE$)
if NYB>64 and NYB0 then V=Val(NYBBLE$)
if NYB>64 and NYB0 then V=Val(NYBBLE$)
if NYB>64 and NYB0 then V=Val(NYBBLE$)
if NYB>64 and NYB
-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
ironhoof
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 16th Dec 2002 09:59
IT DIDNT WORK LETS TRY AGIAN!

-Reminder made in DB not DBPRO so it may take a tweak or two to work in DBP

Hex Value Function "No strings directly used for speed"



A 1-9 and A-Z version of HEXIDECIMAL fit larger numbers into less space "Unfortunately I cannot convert them back into the Alphanumber Value from lack of knowledge of how converting to hex works. but from to number I can


-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 16th Dec 2002 15:49
Well, with such a LARGE topic name list this I was curious as to how fast this actually is.....

So I profiled the routine above against a more traditional couple of variations..





l8r,
Kevin Picone
[url]www.uwdesign.50megs.com[/url]
ironhoof
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 16th Dec 2002 21:02
Ah, no need to get cocky, I mearly stated it as faster than my old one. and indeed it is. Which is all I claimed. Also be it I didn't know people already had a function to do it which is why I wasted my time to make a HEX-VAL function in the first retrospect. Therefore I wasn't comparing it to anyone elses for I didn't know anyone else even had one.
Thats that in a nutshell.

-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.

Login to post a reply

Server time is: 2024-04-25 05:10:47
Your offset time is: 2024-04-25 05:10:47