Hi Cetin,
I tought about scatter name variant, but was ( perhaps naively :-) ) afraid of ending up with some dangling object references in the memory...
As I said, I always had/used similar solution (object carrier) but only for 'flat' cursors, and response was of course instant. So I resolved/presented whole thing, by adding another array for memo fields.
Reason for doing all this was discussion going on here, where Walter mentioned that passing cursors arround is not as easy as it is in NET.
So I just added memo support to existing scenario, to demonstrate how easy it can actually be.
BTW I measured your solution up to the end of 'packing point' and realy got
improvement when cursor have memo.
Will play little bit more with it, to see if there are any downsides
with this variation and then amend solution accordingly.
Thks for bringing it out :)
>Hi Srdjan,
>About your FAQ entry. I didn't check it extensively but still sounded you're doing it longer than what it might be, hope this contributes for some improvement (up to 65000 records):
>
>
>select * from customer into cursor crsCustomer
>oCustomer = Cursor2Obj('crsCustomer')
>? oCustomer.aRecords[5].Company
>
>Procedure Cursor2Obj(m.tcAlias)
>select (m.tcAlias)
>oCarrier = createobject('custom')
>oCarrier.Addproperty('nRecords',reccount())
>if oCarrier.nRecords > 0
> oCarrier.Addproperty('aRecords['+trans(reccount())+']')
> scan
> scatter name oCarrier.aRecords[recno()] memo
> endscan
>endif
>return oCarrier
>
I didn't include structure inclusion, error checking, restoring alias etc but I think this is more feasible (with multiple tables my real world production timings are under a second - never timed really, because the response was instant).
>Cetin