>>I've done this:
>>
>>string=chrtran(string, tab, cr)
>>n=alines(array, string)
>>for i=1 to n
>> grind(array[i])
>>endfor
>>
>>Furthermore, it seems to be about four times faster this way. Not sure if this is the only thing that influenced the speed, but sure can't complain about the outcome, right?
>
>Hi Dragan, ol' Foxtools buddy :-)
>Ive been using this code in my web backend to parse the stuff coming in. It's a key limit to speed, especially since the "words" can be really big, eg 100K and can contain any characters 0-254, except chr(255) which is the delimiter and and "=" which separates names from values.
>Can you see a faster way??
>(I've cut out the non-essential bits)
>
>* Foxtools Wordnum() and NextWord() cannot resolve words bigger than 255 characters...
>#DEFINE k_DATASEP CHR(255)
>cData= og.cData + k_DATASEP
>nPos= at(k_DATASEP, m.cData)
>do while m.nPos > 0
> cStr= left(m.cData, m.nPos - 1)
> cData= substr(m.cData, m.nPos + 1)
> nPos= at("=", m.cStr)
> cName= LEFT(m.cStr, m.nPos-1)
> cValue= SUBSTR(m.cStr, m.nPos+1)
> STORE m.cValue TO (m.cName)
> nPos= at(k_DATASEP, m.cData)
>enddo
>
>
>I'm going away again for a few days, and it really works quite well already - so don't waste time on it if you're busy :-)
Foxtools Mates,
I think that I'll post a small request for the next version of VFP that'll be in this area. You guys might want add things.
George
Ubi caritas et amor, deus ibi est