Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetWordNum() bug with chr(0)
Message
From
29/03/2002 13:30:21
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
GetWordNum() bug with chr(0)
Miscellaneous
Thread ID:
00639016
Message ID:
00639016
Views:
75
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.
Next
Reply
Map
View

Click here to load this message in the networking platform