Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Please some Index sample that works in CA
Message
From
07/08/2003 17:02:42
 
 
To
07/08/2003 15:56:36
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00817957
Message ID:
00817997
Views:
12
>Could someone please show me a sample how to index a CursorAdapter
>in the AfterCursorFill or in the AfterCursorRefresh methods.
>
>I'm trying and havent any ideia how to do it.
>
>Thanks in advance
>
>Peter

Hi Peter,

You don't have to recreate index in AfterCursorRefresh if it is created by AfterCursorFill.
Here is the example:
CLOSE DATABASES all
clear
CREATE CURSOR foo (f1 I)
INSERT INTO foo values(2)
INSERT INTO foo values(3)
INSERT INTO foo values(1)
?[ALIAS()],ALIAS()
?[ORDER()],ORDER()
LIST

oCA=CREATEOBJECT("MyCA")

? "oCA.CursorFill()"

oCA.CursorFill()
?[ALIAS()],ALIAS()
?[ORDER()],ORDER()
LIST

INSERT INTO foo values(-2)
INSERT INTO foo values(-3)
INSERT INTO foo values(-1)

? "oCA.CursorRefresh()"	
oCA.CursorRefresh()
SELECT (oCA.Alias)	
?[ALIAS()],ALIAS()
?[ORDER()],ORDER()
LIST


DEFINE CLASS MyCA AS CursorADapter
DataSourceType="Native"
CursorSchema="f1 I"
BufferModeOverride=5
SelectCmd="select * from foo"

PROCEDURE AfterCursorFill
LPARAMETERS lUseCursorSchema, lnoDataOnLoad, cSelectCmd, lResult
	IF !lResult
		RETURN
	ENDIF
	
	SELECT (this.Alias)		
	oldMode=CURSORGETPROP("Buffering")
	CURSORSETPROP("Buffering",3)
	INDEX ON f1 TAG f1
	CURSORSETPROP("Buffering",oldMode)
ENDPROC 

ENDDEFINE
Thanks,
Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform