Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with index in VFP9.0
Message
From
09/03/2005 14:16:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00973359
Message ID:
00994117
Views:
31
><snip>
>> VFP9 will evaluate the first record to calculate the index key length, and if the index expression includes data from a memo field, VFP9 may calculate the wrong length.
>
>Tore,
>
>AFAIK, VFP evaluates the current record in the table to calculate the index key length.

Sergey,

exactly, VFP evaluate the current record 2 times before to start the indexing phase:
clear
CREATE CURSOR testIndexPhase1 (f1 C)
testindex()

INSERT INTO testIndexPhase1 values('1')
testindex()

INSERT INTO testIndexPhase1 values('2')
testindex()

INSERT INTO testIndexPhase1 values('3')
testindex()
GO 2
testindex()

GO BOTTOM
SKIP
testindex()

PROCEDURE testindex
PUBLIC iPhase
iPhase=0
?
? "current record",RECNO(),"reccount ",RECCOUNT()
INDEX ON KeyRecno() TAG t1 && FOR .F.
DELETE TAG ALL

PROCEDURE KeyRecno(rn)
	? IIF(m.iPhase<2,"Key test recno ","Build index recno "), RECNO(),"OUT OF TABLE " AT 40,EOF()
	iPhase=m.iPhase+1
ENDPROC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform