Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disappearing alias?
Message
From
25/01/2005 09:03:22
 
 
To
24/01/2005 20:21:16
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
00977939
Message ID:
00980368
Views:
43
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
Previous
Reply
Map
View

Click here to load this message in the networking platform