>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 >>
* 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(),F2Cetin