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