Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WordNum() in FoxTools 6.00 still returns 255 chars
Message
De
15/10/1999 02:02:02
 
 
À
14/10/1999 17:34:15
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00276381
Message ID:
00276717
Vues:
30
>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) && eg. qty01234= "12" | part="00123"
	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 :-)
Regards
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform