Posts: 548
Threads: 67
Joined: Jun 2004
Is there any commands that converts a hexidecimal value into just regular decimal value? By that I just mean numbers. If there isn't a command to do this, does anyone have any functions or routines to get the job done? Thanks!
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Posts: 3,522
Threads: 189
Joined: Dec 2003
It took me almost two months, I asked my computer teacher, and I finally managed to write a function that did it. Only to a few days later, discover the easy way.
Code:
t$=HEX$(31482)
t=VAL("&H"+t$)
PRINT t
Just put "&H" in front and do a VAL() on it...
That was one of those, smack-head-against-monitor moments.
Hope this helps.
Posts: 548
Threads: 67
Joined: Jun 2004
Woah!? That's it!? I thought it would take lines and lines of codes! Well thanks alot Z!re, this will help a lot...
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Posts: 1,439
Threads: 15
Joined: Apr 2003
But you aren't l33t unless you write a fully-optimized ASM function for converting hex strings to integers that executes in 5 clocks and fries eggs and bacon while composing an orchestra.
VAL() sucks, though. It's pretty slow and I think (not sure in QB) that it returns a DOUBLE, whereas in this case, you would probably want an INTEGER or a LONG.
Posts: 3,522
Threads: 189
Joined: Dec 2003
It doesent say anything in the helpfile about which format VAL returns... perhaps the MS developers got sick, and actually did something smart, and have it autochange the type depending on the VALed string? Or depending on the variable where it's going to be stored.. dunno.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Quote:Or depending on the variable where it's going to be stored.