Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
Chris Roper Senior Member Joined: 19/05/2015 Location: South AfricaPosts: 280
Posted: 05:32am 15 Nov 2015
Copy link to clipboard
Print this post
Val converts a string into its equivalent numeric value.
Letters of the Alphabet are not Numeric so return 0.
Change your test string to Text$="1234"
and run it again you will see what I mean.
Cheers
Chris
http://caroper.blogspot.com/
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1629
Posted: 05:34am 15 Nov 2015
Copy link to clipboard
Print this post
Just try
Print val("5")
or
a$="123"
Print val(a$)
Michael
causality ≠ correlation ≠ coincidence
sc05027 Newbie Joined: 01/01/2015 Location: Hong KongPosts: 10
Posted: 05:38am 15 Nov 2015
Copy link to clipboard
Print this post
or use ASC(arg) to returns the ASCII code for the first letter in the argument
SC
helltek Newbie Joined: 04/02/2015 Location: United StatesPosts: 29
Posted: 05:39am 15 Nov 2015
Copy link to clipboard
Print this post
Thanks for quick reply.
Is there a way to get the ascii value of a text character?
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1629
Posted: 05:39am 15 Nov 2015
Copy link to clipboard
Print this post
Maybe you are looking for ASC?
The Ascii value of a character?
causality ≠ correlation ≠ coincidence
helltek Newbie Joined: 04/02/2015 Location: United StatesPosts: 29
Posted: 05:46am 15 Nov 2015
Copy link to clipboard
Print this post
Thanks. Yes, that's what I need. The ascii value of text character. The "VAL" statement confused me thinking it would give me the ascii value.
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1629
Posted: 05:51am 15 Nov 2015
Copy link to clipboard
Print this post
that happens sometimes ... causality ≠ correlation ≠ coincidence
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9643
Posted: 03:01pm 15 Nov 2015
Copy link to clipboard
Print this post
I used VAL all the time by mistake when I needed ASC, if that makes you feel any better. It would seem to be a common mistake when learning. Smoke makes things work. When the smoke gets out, it stops!