Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locate for command slow
Message
From
24/04/2005 14:14:11
 
 
To
24/04/2005 13:22:40
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
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:
01007905
Message ID:
01007915
Views:
10
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform