Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create cursor, where no fields is dynamic
Message
De
19/08/2000 02:01:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/08/2000 12:16:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00406720
Message ID:
00406981
Vues:
41
>Is it possible to create a cursor with a variable number of fields, i.e. cursor has 3 constant fields,
>a,b,c, and fields f1 to fn where "n" is determinted when program is run?


Although generally what I prefer is Trey's 2nd option here is 3rd and 4th ways (there are others too) that sometimes needed :
-Create a structure array
-Create cursor from array
Example :
lnNeededCols = 20
dimension myArray[lnNeededCols+3,4]
myArray[1,1] = 'FieldA'
myArray[1,2] = 'C'
myArray[1,3] = 10
myArray[1,4] = 0
myArray[2,1] = 'FieldB'
myArray[2,2] = 'D'
myArray[2,3] = 8
myArray[2,4] = 0
myArray[3,1] = 'FieldC'
myArray[3,2] = 'L'
myArray[3,3] = 1
myArray[3,4] = 0
for ix = 4 to lnNeededCols+3
 myArray[ix,1] = 'Field'+padl(ix,2,'0')
 myArray[ix,2] = 'I'
 myArray[ix,3] = 4
 myArray[ix,4] = 0
endfor
create cursor myCursor from array myArray
-Get SQL generated cursor's structure into array and create from array
select .... from ... into cursor myCursor
afields(aStruc)
create my2ndCursor from array aStruc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform