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.

Newcomers DBPro Corner / Problem with val()?

Author
Message
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 4th Sep 2003 08:19
What exactly is the val command suspoed to do?

I think that is should return 97 here



Is it just me being stupid or does the val command not work?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Sep 2003 10:58
perhaps is broken what version are you using?

http://www.lunarpixel.com
It's already tomorrow in Australia
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Sep 2003 11:46
That is not what val() does.

val is the opposite of str$().

where str$() converts an integer into a string, val() converts a string into an integer, however that string must be a numerical value eg:

a$="123"
a=val(a$)
print a


This will print 123. No suprise there, but it is the integer 123 that is being printed

You, I think, are confusing val() with asc().

test$="a"
print asc(test$)


This will print 97 to the screen which I believe is what you are trying to do.

Nine lives to choose from and I get stuck with this one!
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 4th Sep 2003 14:04
Whoops that's what staying up late does to you. I just got the commands mixed up

Login to post a reply

Server time is: 2024-09-20 21:32:32
Your offset time is: 2024-09-20 21:32:32