|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1299 |
WORD$ Function - possible problem |
25/11/2005 @ 00:41 by Richard
|
Through INPUT, I want to get two values. I am using the WORD$ function to get them.
A$ = WORD$(K$,1) B$ = WORD$(K$,2)
It doesn't seen to work as I expected. Based on the description "words are separated by spaces, tabulations or punctuation marks (comma, period, semi-colon, colon, question mark, exclamation mark)"
When I enter 1 5 -- 5 is not returned 1,5 -- same 1, 5 -- same 1 , 5 -- same 1, 50 -- works fine 10, 5 -- 5 is not returned
It appears that there has to be a punctuation mark, a space and the second word needs to be 2 or more characters long.
Thanks,
Richard |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 25/11/2005 @ 05:01 by Richard
visitor |
I found a workaround. If I add a space to the end of the string, then all of the above problems go away.
1 5 1,5 1, 5 etc - all work fine.
It looks like the issue is 1 character words where it is the last character of the string.
Richard
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 25/11/2005 @ 09:14 by aldweb
visitor |
Thank you Richard for this very clear and precise reporting. This will help me a lot in figuring out what is happening and working on a fix. Thank you again, I would love if everybody would provide so great feedbacks!
Cheers, aldweb
@+ aldweb |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|