|
Post by rikky on May 25, 2020 18:57:28 GMT 1
Hello. I like the radio stuff. But this aside. Following cute little program does something that I believe should not. a$ = " abc def ghi " PRINT a$
IF ISTOKEN(a$,"abc") THEN PRINT "yes"
ELSE PRINT "no" END IF
PRINT a$ = MID$(a$,2) PRINT a$
IF ISTOKEN(a$,"abc") THEN PRINT "yes"
ELSE PRINT "no" END IF
Rik.
|
|
|
Post by Pjot on May 25, 2020 20:01:25 GMT 1
Thanks rikky,
In the beginning of the delimited strings, years ago, it would be OK, because the string " abc def ghi " has an empty token just before the first delimiter at the start of the string.
So to make it work now, you could enable OPTION COLLAPSE and then the result would be OK.
However, there's no reason to stop scanning the string at the first empty token. I have changed it so ISTOKEN now will stop either at a position where the token is found, or at the end of the string.
Latest is in fossil, your program now prints 'yes' for both situations.
Thanks again for the report!
Peter
|
|