Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LOCATING backwards
Message
From
24/10/2003 12:22:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/10/2003 12:13:27
Fabian Belo
Independent Developer
Argentina
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00842157
Message ID:
00842237
Views:
19
Fabian,
I think it depends on the interpretation of the question :)
Maybe wrong but I interpreted it as 'is there a way'
Can you use go top to go to the end of dbf ?
NO would be true or false :)
PS: Index is not the only solution but what seemed to be the simpliest to me.
Cetin

>Hi Cetin & Fabio;
>
>I think the proper answer to the original question is NO.
>The LOCATE command cannot do it. I agree 100% with Cetin's suggestion, however, as Sergey pointed before, some workaround can be done as showed in Fabio's example which doesn't works.
>LOCATE command doesn't need any indexes, but in this case I think is the only solution.
>
>Cheers,
>
>>>Sorry Cetin ( fast write )
>>>
>>>this is correct:
>>>
>>>CREATE CURSOR t2 (f2 I )
>>>RAND(3)
>>>FOR K=1 TO 500
>>>INSERT INTO t2 VALUES (100*RAND())
>>>NEXT
>>>SET FILTER TO f2=1
>>>GO BOTTOM  && this is sufficient
>>>SET FILTER TO
>>>BROWSE
>>>
>>>
>>>Fabio
>>
>>No it's not. What you get is only the last record. A locate command supports continue and found. This doesn't.
>>Well suggesting skip -1 would be overkilling. You might not know if intention is doing a scan while...endscan or alike.
>>An index is the way to go IMHO. If no index exists creating an index with a dummy key does well (IMHO every table should have such an index) :
>>
>>index on .t. tag myLocator
>>
>>set order to tag myLocator descending
>>
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform