Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Arrays
Message
De
13/06/2002 19:12:00
 
 
À
13/06/2002 16:44:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Arrays
Divers
Thread ID:
00668248
Message ID:
00668299
Vues:
17
Sergey is correct, as always. :)

But for character data, we should mention that there is another option in VFP7. You can use the ALINES function, with a parsechar, to fill your array:
ALINES(_array, "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",.f., ",")
Using ALINES is slightly slower, at runtime, than assigning each element of the array on a separate line of code, but it's not enough to worry about unless you're doing it thousands of times in a loop.

You could also use this method for numeric data types, but you'd have to put them in as character data first, and then loop through with VAL function to convert them to numeric. That wouldn't be the most efficient method at runtime, but it's quick and easy to program. :)

-Tom


(This post is provided "AS-IS" with no warranties, and confers no rights.)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform