Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set array dimensions to (x,2)?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00317604
Message ID:
00317787
Vues:
14
>>>Hi George,
>>>
>>>The table is short. About 200 records and won't grow very fast. I tested using COPY TO ARRAY and seems pretty quick, but I am open to SQL to fill the array. Would SQL automatically declare and size the array for me so I don't have to wory about the dimensions of the array or declaration?
>>
>>Steve,
>>
>>Yes it will. However, I always dimension the array (to one element) before issuing the SQL statement. This eliminates the erroneous compiler references that can be causing by later referencing the array.
>
>COPY TO ARRAY will also create and dimension the array correctly if the array does not exist at when COPY TO ARRAY is executed. The number of rows in the array will be dictated by the FOR clause and the number of columns will be dictated either by the number of fields in the table or the number of fields specified in the FIELDS clause of the COPY TO ARRAY command.

Thanks for the heads up, Dore. As I mentioned, I don't use COPY TO ARRAY, however. I think back in FPD 2.0, I found that the SQL approach was faster and stuck with that.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform