Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with index in VFP9.0
Message
De
09/03/2005 14:16:37
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00973359
Message ID:
00994117
Vues:
30
><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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform