Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate for command slow
Message
De
24/04/2005 14:14:11
 
 
À
24/04/2005 13:22:40
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
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:
01007905
Message ID:
01007915
Vues:
9
Methinks?

>First, a LOCATE command based on ALLTRIM() will not be optimized, since you will not have an index on ALLTRIM() (at least, I hope you don't - indices must be of fixed size).
>
>Second, in general, the SEEK command or the SEEK() function will be much faster than any alternative which simply relies on VFP optimization. Methinks you already what you need with the index called "code" - use it.
>
>One more thing: don't use "select 6" - using the alias will be much more readable, and easier for maintenance.
>
>
>>in vfp9 locate for command slow down, with these codes
>>
>>
>>sele 6
>>set filter to
>>set order to code
>>*SET FILTER TO admtd=1.and.lcode=thisform.lcodec.value.and.sec=thisform.secc.value
>>SET FILTER TO lcode=thisform.container4.lcodec.value.and.sec=thisform.container4.secc.value;
>>.and.admtd=thisform.container4.inout.value
>>
>>
>>locate for allt(code)=allt(thisform.code.value)
>>if !bof()
>>	skip -1
>>	dis=1
>>	this.parent.init
>>endif
>>thisform.container3.visible=.t.
>>photo_file=allt(thisform.code.value)+".jpg"
>>thisform.container3.image1.picture="stpics\"+(photo_file)
>>ThisForm.ox.CalculateAge(ThisForm.dbirth.Value,ThisForm.text5.Value)
>>ThisForm.year.value = ThisForm.ox.nYears
>>ThisForm.month.value = ThisForm.ox.nMonths
>>ThisForm.day.value = ThisForm.ox.nDays
>>
Greg Reichert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform