Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetWordNum() bug with chr(0)
Message
De
29/03/2002 13:30:21
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
GetWordNum() bug with chr(0)
Divers
Thread ID:
00639016
Message ID:
00639016
Vues:
76
GetWordNum() and GetWordCount() don't seem to accept chr(0) as a word separator, while corresponding old functions in FoxTools still do:
x=STUFF(REPLICATE("x",33),13,0,CHR(0))
?x
?GETWORDNUM(x,1, CHR(0))
* both return the same, all 34 characters
?GETWORDCOUNT(x,CHR(0))
* returns 1
* With FoxTools:
?WORDnum(x,1, CHR(0))
* returns 12 chars
?WORDnum(x,2, CHR(0))
?GETWORDNUM(x,2, CHR(0))
* both return empty strings
?WORDs(x, CHR(0))
* also returns 1

* now we give it two null chars
x=STUFF(STUFF(REPLICATE("x",33),13,0,CHR(0)), 22,1,CHR(0))
?WORDs(x, CHR(0))
?GETWORDCOUNT(x,CHR(0))
* both return 1
?WORDnum(x,2, CHR(0))
?GETWORDNUM(x,2, CHR(0))
* both return empty strings
So, FoxTools is just a little better here - it will return the first word correctly. Since FoxTools in VFP7 is actually a recompiled leftover from VFP6, I expect the results under 6 to be the same.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform