Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in GetWordNum
Message
From
13/08/2017 13:04:56
Walter Meester
HoogkarspelNetherlands
 
 
To
13/08/2017 12:49:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01653264
Message ID:
01653265
Views:
98
>Hi All,
>
>After nearly an hour of screaming, I discovered the source to a recent issue.
>There is a bug in GetWordNum(). If the string being searched begins with the delimiter, and you are requesting the first word, the function will return the Second word in the list.
>
>
>? GetWordNum( "1,2,3", 1, ",")                     && returns "1"
>? GetWordNum( ",2,3", 1, ",")                       && returns "2"
>? GetWordNum( ",,3", 1, ",")                         && returns "3"
>
AFAIK, this is by design. If will return the nTh word. It will disregard empty words. For this reason I use STREXTRACT() in cases where empty words are possible

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform