>>I have to change my code, before SCAN, so that the SCAN would go through all records. Therefore, I will need to SET ORDER TO before the SCAN.
>>What is a better practice, saving TAG() to the memory variable and then restoring it (by SET ORDER TO TAG(cSavedTag)).
>>Or, saving the ORDER() to the memory variable and then restoring it (by SET ORDER TO (cSavedOrder)
>>?
>
>Depending on the situation you could do a query on the cursor and use the query for the scan instead. If the cursor is buffered and changes are pending use WITH (BUFFERING = .T.)
>
>SELECT * FROM OriginalCursor WITH (BUFFERING = .T.) ORDER BY MyField INTO CURSOR cuTest NOFILTER READWRITE
>
>To save resources select only those fields you really need in the scan. If you need to do changes in the original cursor, you can locate those during the scan
>
>SELECT cuTest
>SCAN
> SELECT OriginalCursor
> LOCATE FOR IndexField = cutest.IndexField && Better a seek if you have an index.
> SELECT cuTest
>ENDSCAN
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham