Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetWordNum() bug with chr(0)
Message
De
05/04/2002 10:38:23
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00639016
Message ID:
00641447
Vues:
23
And this suggests strongly that the generally held assumption that FoxTools stuff was moved over to "native" with only cosmetic revisions is incorrect.


>Looks like a bug to me too.
>
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform