Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating cursors with fieldnames in an array
Message
 
À
25/09/2000 23:33:04
Jordan Pastourel
Worksafe Management Systems
Toowong, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00420748
Message ID:
00420818
Vues:
14
>Hi All,
>i am trying to create a new cursor with fieldnames located in a dynamic array. the code i use is as follows:
>
>create cursor gracur(&alabels[1] N(10))
>if alen(alabels) > 1
> for i=2 to alen(alabels)
> newcolm = str(alabels[i])
> alter table gracur add column &newcolm N(10)
> endfor
>endif
>select gracur
>append from array agraph
>
>every time i run this it gives me a syntax error on the first line. if this is not the way to do it, how can i go about setting up this cursor??
>please help!!!!
>
Jordan,

Why not simply use CREATE CURSOR Whatever FROM ARRAY myarray? The only thing you'll have to do is make sure that the first column of the array is the field name, the second the field type, third field length and fourth number of decimals if applicable. That will allow you to set whatever field names are required and avoid macro expansion.
George

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

Click here to load this message in the networking platform