on Nov 1st, 2016, 01:33am, michael wrote:
|I REALLY need a proper tool to interpret my future works |
You might be interested in the 'next word' routine that I use in LB Booster:
Alphabet$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
testString$ = "Happy Halloween my fellow programmers!!!"
word$ = FNword(testString$)
UNTIL word$ = ""
DEF FNword(RETURN A$)
space$ = FNtoken(A$, " ")
DEF FNtoken(RETURN A$, list$)
WHILE INSTR(list$, LEFT$(A$,1))
T$ += LEFT$(A$,1)
A$ = MID$(A$,2)
The FNtoken routine returns as much of the supplied string as matches the supplied list of acceptable characters. It is called twice, once to discard leading spaces and then to return the next 'word'. This is quite flexible, for example if you wanted to skip leading tabs as well as spaces ('whitespace') you could do:
whitespace$ = FNtoken(A$, " "+CHR$(9))
and if you want to return a 'variable name' (any letter followed by any combination of letters and numbers) you could do:
variable$ = FNtoken(A$, Alphabet$) + FNtoken(A$, Alphabet$+"0123456789")