Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reverse comma-delimited string
Message
De
04/09/2019 13:44:45
 
 
À
04/09/2019 11:43:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01670542
Message ID:
01670573
Vues:
78
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform