>>Another thing Words() and WordNum() never liked was the use of memo fields; they had to be converted into strings, even like this: Words(""+the_memo). As for the 256 chars limit, I've always used MLine() to chop long strings. Anyway, counting words in a long strings will probably slow things down, so I preferred chopping 'em regardless of limitation. Good thing about MLine() is that it remembers the end of last line found in the _mline system variable, so for the next line a simple MLine(the_memo, 1, _mline) looks for the next line from _mline offset, which is quick as a fox :).
>
>Mline() - yep, that's fast. I'll test it out on my parser for speed. It works on ordinary strings too, doesn't it?
Doesn't work on dates and logicals :). My code parsers usually look like this:
create cursor mm (m m) && yes, lazy bum gives such a cryptic name
append blank
appe memo m from (lcSourceFile)
_mline=0
do while _mline
lcOneLine=mline(m,1,_mline)
do Whatever with lcOneLine
enddo
You may start with something of several kilobytes in length and compare with this for speed. The fastest way to scan a long string I've found so far. You may also watch _mline in the debugger - it always remembers the point it last reached.