Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Locate For from Bottom To Top
Message
From
04/06/2014 08:15:00
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01601100
Message ID:
01601253
Views:
51
>>>>>Hi,
>>>>>
>>>>>LOCATE FOR Command Scans for records from Top to Bottom by defauld
>>>>>
>>>>>Is it possible to Locate records in reverse Direction. If yes, kindly Guide how to do this. If not, what's the alternative, if I have ample number of records.
>>>>>
>>>>>Regards
>>>>>Harsh
>>>>
>>>>It might be very slow this way.
>>>>INDEX ON 'A' TAG XATAG
>>>>SET ORDER TO XATAG DESCENDING
>>>>LOCATE FOR ...
>>>>
>>>>
>>>>What sequence do you really need? The sequence should be based on fields in the table, not record #. With such fields, you can SET ORDER TO sequence ASC/DESC, SEEK(), SCAN WHILE. Allowing you to process not only the entire set, but also subsets very fast.
>>>
>>>Personally I wonder why anyone still uses LOCATE at all. Pretty prehistoric.
>>
>>Except that since it's Rushmore-optimizable, very handy when you need to search based on multiple criteria.
>>
>
>I know it's Rushmore optimizable. My point was more that it is record based, not set based, which went out about 20 years ago.

You know I love SQL, but one of the strengths of VFP is that it offers both set-based and record-based processing. Each has its uses.

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform