Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disappearing alias?
Message
De
25/01/2005 09:03:22
 
 
À
24/01/2005 20:21:16
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00977939
Message ID:
00980368
Vues:
38
Dragan -- thanks for the great idea ... from my perspective at least, this seems to come from out of left field, and is just what I'm looking for. More important, though, is that it serves as a nice introduction to solutions outside the realm I'm accustomed to.

Thanks!

>>If I invoke a PRG to create a cursor for me, and if that PRG needs to create some other cursors along the way, there seems to be no consistent way to handle this.
>
>You can have your own cursor creator class, which will also close the cursor when its variable goes out of scope. In pseudo-code:
>
>
>local oCursor
>oCursor=create("mycursor")
>oCursor.cStatement="select * from mytable into cursor zz"
>{lots of code here}
>return
>
>*------------
>define class myCursor as custom
>
>cAlias=""
>cStatement=""
>
>procedure fill
>execscript(this.cStatement)
>this.cAlias=alias()
>endproc
>
>procedure destroy
>use in select(this.cAlias)
>endproc
>enddefine
>
>Since oCursor is local, it will be destroyed when your procedure exits. You can add a lot of other stuff to the class, of course - have it index the cursor etc etc.
Jim Nelson
Newbury Park, CA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform