If you are using VFP9, why won't a SELECT statement work? 

Something like:

SELECT TOP 1 * FROM table WHERE condition ORDER BY key DESC INTO CURSOR tmp

Just make sure you create index(es) on the condition field(s) so Rushmore
will kick in and it should give you a reverse order cursor with all the
matching values in a flash. 

Is there a reason you want to use LOCATE instead?

Paul H. Tarver


-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Gene
Wirchenko
Sent: Wednesday, July 03, 2019 11:47 AM
To: [email protected]
Subject: LOCATE Backwards?

Hello:

      I have a situation in my app where I am having to pick up what 
will presumably be the last row in a table.  Mind you, the general 
situation is that it might not be if in a multiuser situation.

      With the current situation, I can use an index to find that row 
really fast.

      BUT ...

      What if an index is not appropriate?  Is there any way to do a 
LOCATE backwards (or something equivalent)?  (The table has 186,574 
rows currently so searching backwards would definitely be worth 
it.)  I do not think there is such a critter, but maybe, you know better?

Sincerely,

Gene Wirchenko


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to