Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP7 slow
Message
 
 
À
15/11/2001 10:28:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00582078
Message ID:
00582108
Vues:
22
Try following optimized code
Set StrictDate To  0
Select tmpperf
Scan
	Select CUSTWAIT
	Store 0 To stand1, sample1, stdm, smpm,stdy,smpy
	Scan For airport=tmpperf.airport And carrier=tmpperf.carrier And loc_code = Alltrim(tmpperf.cfield1)
		stand1=stand1+Iif(m_stand='P'And event_date =m.from,1,0)
		sample1=sample1+Iif(m_stand#'-' And event_date =m.from,1,0)
		stdm=stdm+Iif(m_stand='P' And event_date = m.prev_month,1,0)
		smpm=smpm+Iif(m_stand#'-' And event_date = m.prev_month,1,0)
		stdy=stdy+Iif(m_stand='P' And event_date = m.prev_year,1,0)
		smpy=smpy+Iif(m_stand#'-' And event_date = m.prev_year,1,0)
	Endscan
	Select tmpperf
	Replace cfield2 With Allt(Str(sample1)),cfield3 With pct(stand1,sample1),;
		cfield4 With pct(stdm,smpm),cfield5 With pct(stdy,smpy),;
		cfield1 With Iif(Seek(Allt(tmpperf.cfield1),"QTLOCAT"),QTLOCAT.Name,"??????")
Endscan
>Hello,
>
>I used to run the following lines of codes in FPW 2.6 , it took less than 1 minute to complete the process but with VFP7 it's more than 8 minutes for the same data range , please help me to identify the causes of slow process.
>
>Thanks in advance,
>PP
>
>set strictdate to 0
>select tmpperf
>go top
>do while !eof()
> select CUSTWAIT
> go top
> store 0 to stand1, sample1, stdm, smpm,stdy,smpy
> do while !eof()
> if airport=tmpperf.airport and carrier=tmpperf.carrier and loc_code = alltrim(tmpperf.cfield1)
> stand1=stand1+iif(m_stand='P'and event_date >=m.from,1,0)
> sample1=sample1+iif(m_stand#'-' and event_date >=m.from,1,0)
> stdm=stdm+iif(m_stand='P' and event_date >= m.prev_month,1,0)
> smpm=smpm+iif(m_stand#'-' and event_date >= m.prev_month,1,0)
> stdy=stdy+iif(m_stand='P' and event_date >= m.prev_year,1,0)
> smpy=smpy+iif(m_stand#'-' and event_date >= m.prev_year,1,0)
> endif
> skip
> enddo
> select tmpperf
> replace cfield2 with allt(str(sample1)),cfield3 with pct(stand1,sample1),;
> cfield4 with pct(stdm,smpm),cfield5 with pct(stdy,smpy),;
> cfield1 with iif(seek(allt(tmpperf.cfield1),"QTLOCAT"),QTLOCAT.NAME,"??????")
> skip
>enddo
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform