>Hi,
> I would like to execute a cursor in DESC order. Any ideas?
> I have a query that select records from stock table. I need to process it again by DESC order. However, VFP keep execute it by ASC order even I have ORDER BY DESC for previous query result. Any ideas?
>
>Thnak you
Because of Rushmore Optimization, Visual FoxPro might re-arrange records in commands that accept a scope. In other words, Visual FoxPro assumes that it doesn't matter in which order you process the records. Sometimes, this assumption is wrong.
Workarounds:
Try to add NOFILTER to your query. This will create a separate table, instead of Visual FoxPro internally applying the equivalent of SET FILTER.
Say you are using a command like REPLACE ALL ..., try replacing it with
SCAN
REPLACE ... (single record)
ENDSCAN
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)