Hi Cetin,
I was playing little bit with your code and found something strange happening ...
Very first run of your code takes 9 seconds to execute ?!
Next consecutive run 0.410 sec.
At first (when replied earlier today) I tought sql statement run on non indexed table (customers) was causing that delay but then I commented sql statement out of the picture, and let your function run on native table. The same happened ; 9-10 seconds. Second run 0.4 sec.
Then I tried also within my object (with tmp cursor again) . Again the same!
9 second first run and again consecutive run 0.41 seconds.
Will play little bit more tonight to see if this can be somehow avoided.
>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