Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LOCATING backwards
Message
From
24/10/2003 13:16:42
 
 
To
24/10/2003 12:05:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00842157
Message ID:
00842302
Views:
29
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform