Can anyone tell me why PRINT VAL("0x30") prints "0", rather than the expected "48"? And where I could have found that in the Users Guide?
I'm sad because I feel stoopid.
OPENCONSOLE
DEF n AS INT
n = VAL("0x30")
PRINT n :' display "0" Why not "48"?
n = VAL("48")
PRINT n :' display "48"
DO: UNTIL INKEY$ <> ""
CLOSECONSOLE
END
VAL only works with decimal numbers, not hex, not octal, not binary either ;)
You can use the C library function sscanf for converting hex numbers.
Quote
And where I could have found that in the Users Guide?
And you expect I am supposed to imagine every possible combination a user could enter? Never said I was perfect, and since I wrote the users guide without help there are bound to be some oversights. It has been pointed out to me that things that to me are common sense, might not be so for others ;D
Paul.
I just assumed I was doing it rong. Thanks for the info.
Quote from: Paul Turley on March 05, 2008, 05:36:31 PM
things that to me are common sense, might not be so for others
Talking about me again, heh? ;)
Larry