Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reverse comma-delimited string
Message
From
04/09/2019 13:44:45
 
 
To
04/09/2019 11:43:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01670542
Message ID:
01670573
Views:
79
>>>Just want to add that in my testing, ALINES() are much, much faster than the GETWORD*() functions. For a short string, it probably won't make much difference, but done repeatedly or for long strings, it'll be visible. (Mike, I know you know this; adding it for Rick.)
>>
>>I didn't exhaustively check this code. It may have bugs. I also altered Walter's algorithm slightly to provide a comma-space between each item. And on each item, I only process if a comma is found somewhere in the string.
>
>Here's one that shows iteration for various length strings in 100-element increments, and in 10-element increments up to 50. ALINES() becomes considerably faster the larger the element list. The crossover seems to happen around 40 elements.

Right, that matches my experience. ALINES() is linear. GETWORDxxx() is not.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform