Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LOCATING backwards
Message
From
25/10/2003 02:41:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/10/2003 13:16:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00842157
Message ID:
00842564
Views:
34
>Hi Cetin,
>
>solution with index is natural and obvious,
>but if i 300 type of expressions i need build a index every time.
>
>
>I put this like a solution without index for found the last value,
>implement like LOCATE and CONTINUE it is a simple improvement.
>
>Try to Resolve this Problem with index.
>
>
>I want the last occurrence of LIKE(m.var,memo1), on a 1Millions records table.
>
>
>
>CLEAR
>CREATE CURSOR t2 (f2 M )
>RAND(3)
>FOR K=1 TO 50000
>INSERT INTO t2 VALUES (STR(1000000000*RAND()))
>NEXT
>
>var="*4?7*"
>* like LOCATE
>m.LastFound=RECCOUNT()+1
>SET FILTER TO LIKE(m.var,f2) AND RECNO()<m.LastFound
>GO BOTTOM
>m.LastFound=RECNO()
>?  RECNO(),F2
>m.LastFound=RECNO()
>* like CONTINUE
>GO BOTTOM
>m.LastFound=RECNO()
>?  RECNO(),F2
>* like CONTINUE
>GO BOTTOM
>m.LastFound=RECNO()
>?  RECNO(),F2
>
>m.LastFound=RECCOUNT()+1
>var="*3?7*"
>GO BOTTOM
>m.LastFound=RECNO()
>?  RECNO(),F2
>
>SET FILTER TO
>RELEASE LastFound
>
>BROWSE
>
>
>It is simple put this on a class and to widen the operation.
>
>Fabio

Try ? Didn't I already show you that :)
Build index everytime ? Who said that ?
I can't believe you didn't understand index solution in the first place.
* Create and insert code
Index On .t. tag myLocator

Set Order To tag myLocator descending
* Or
* Index On .t. tag myLocator descending
* ..
* Set Order To tag myLocator

var="*4?7*"
Locate for Like(m.var,f2)
?  RECNO(),F2
Continue
?  RECNO(),F2
Continue
?  RECNO(),F2
var="*3?7*"
Locate for Like(m.var,f2)
?  RECNO(),F2
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
Next
Reply
Map
View

Click here to load this message in the networking platform