Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP7 slow
Message
From
15/11/2001 12:12:29
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00582078
Message ID:
00582194
Views:
29
All source codes you can see the cFilter:

release all except m.pub_event_date, m.pub_region, m.pub_airport, m.pub_carrier

if !OpenBaseDb() .or. !FileOpen("QTAIRPOR order AIRPORT shared in 0") .or.;
!FileOpen("QTREGION order region shared in 0") .or. !FileOpen("QTCARRIE order CARRIER shared in 0") .or.;
!FileOpen("QTAREA order AREA shar in 0") .or. !FileOpen("QTLOCAT order LOC_CODE shared in 0") .or.;
!FileOpen("CUSTWAIT shared in 0") .or. !FileOpen("BAGDELIV shared in 0") .or. !FileOpen("AAPPEAR shared in 0") .or.;
!FileOpen("LOUNGE shared in 0") .or. !FileOpen("ARRFLIGH shared in 0") .or. !FileOpen("KIOSK shared in 0");
.or. !FileOpen("QTKIOSK order LOC_CODE shared in 0") .or. !FileOpen("DROPOFF shared in 0")
return
endif

public m.from, m.to, m.rep_type, m.rep_region, m.rep_carrier, m.rep_airport, m.prev_month,;
m.prev_year, m.name_report, m.fin_rep, m.type_cust, m.type_baggage, m.type_aircraft,;
m.type_lounge, m.type_flight, m.choose_fail, m.kind_rep, m.name_report,;
m.name_region, m.name_airport, m.name_carrier,m.type_kiosk,m.type_drop

private m.dbf_name

m.type_cust = '1'
m.type_baggage = '2'
m.type_aircraft= '3'
m.type_lounge = '4'
m.type_flight = '5'
m.Type_Kiosk = '6'
m.Type_Drop = '7'

select 0
cTmpPerf="TMP\"+sys(3)
create table &cTmpPerf (airport c(3), carrier c(2), type_rec c(1), ;
cfield1 c(25), cfield2 c(5), cfield3 c(5), cfield4 c(5), ;
cfield5 c(5), cfield6 c(5), cfield7 c(5), cfield8 c(5), ;
cfield9 c(5), cfield10 c(5), cfield11 c(5), cfield12 c(5), ;
cfield13 c(5), cfield14 c(5), cfield15 c(5))


use &cTmpPerf alias TmpPerf excl
index on airport+carrier+type_rec tag aircar
index on type_rec tag type_rec
index on cfield1 tag cfield1


cFilter=''

if RptScope("STATION PERFORMANCE SUMMARY",.t.)
define window wPerfScope at 0,0 size 9,90 font "MS Sans Serif", 8 float noclose nominimize double;
title " STATION PERFORMANCE SUMMARY - SCOPE"
move window wPerfScope center
activate window wPerfScope
@ 0,0 say "FORM1.BMP" bitmap stretch

=bevel(0.5,0.5,6.5,89)
@ 1, 2 say "Overall Report Shift scope" style "BT" color rgb(0,0,128,,,,)
@ 3, 2 say "Aircraft Appearance Responsibility" style "BT" color rgb(0,0,128,,,,)
@ 5, 2 say "Baggage Fail responsible Station" style "BT" color rgb(0,0,128,,,,)
@ 1,44 get nPerfScope picture "@*RHN \<1 A.M.;\<2 P.M.;\<3 Both" size 1.3,8.5,1.5 default 3 style "BT"
@ 3,44 get nAppResp picture "@*RHN \<4 Apt;\<5 Maint;\<6 Both" size 1.3,9.7,0.7 default 3 style "BT"
@ 5,44 get nBagResp picture "@*RHN \<7 Local;\<8 Other;\<9 Both" size 1.3,9.7,0.7 default 3 style "BT"
@ 7,30 get nChoice picture "@*HNT \ read

release window wPerfScope
if nChoice =1
** Construct a table containing the field titles for the report
if at("EVENT_DATE >=",cFilter)>0
cFilter=subs(cFilter,at(".and.",cFilter)+5)
endif

m.prev_month = m.to-day(m.to)+1
m.prev_year = gomonth(m.prev_month, -month(m.prev_month)+1)

cPerfscope=+iif(nPerfScope=1,' AM SHIFT',iif(nPerfScope=2,' PM SHIFT',''))
cFilter=cFilter+'and event_date>='+iif(m.prev_year <= m.from,'m.prev_year','m.From')+iif(nPerfScope=1,' and SHIFT=="AM"',iif(nPerfScope=2,' and SHIFT=="PM"',''))


** THIS PART TO CREATE INDEX TOOK ONLY 2 SECONDS

wait "Filtering CUSTOMER WAIT TIMES data..." window nowait
select CUSTWAIT
cCuwIdx="TMP\"+sys(3)
index on region+AIRPORT+LOC_CODE+CARRIER+SHIFT to &cCuwIDX for &cFilter
set index to &cCuwIDX



wait "Processing CUSTOMER WAIT TIMES data..." window nowait
do CuwCalc

cCuwtmp="TMP\"+sys(3)+".dbf"
copy to &cCuwtmp
zap



select tmpperf

append from &cCuwtmp

set order to aircar

set relation to type_rec into titlecov
set relation to airport into qtairpor additive
set relation to carrier into qtcarrie additive

wait clear

do ViewPrint with "perform"

endif
endif

close databases
delete file &cTmpPerf..dbf
delete file &cTmpPerf..cdx

release all except m.pub_event_date, m.pub_region, m.pub_airport, m.pub_carrier





procedure CuWcalc
*************************************************************************
*** This program fill the database with airport+carrier+location code ***
*** for the performance summary ***
*************************************************************************
PRIVATE m.airport, m.carrier

select tmpperf
SET ORDER TO aircar

select CUSTWAIT
go top
DO WHILE !EOF()
select tmpperf
if !seek(allt(CUSTWAIT.AIRPORT)+allt(CUSTWAIT.CARRIER)+m.type_cust)
select QTLOCAT
go top
do while !eof()
select TMPPERF
append blank
replace CFIELD1 with qtlocat.LOC_CODE, TYPE_REC with M.TYPE_CUST,;
AIRPORT with allt(CUSTWAIT.AIRPORT), CARRIER with allt(CUSTWAIT.CARRIER)
select QTLOCAT
SKIP
enddo
go top
select TMPPERF
ENDIF
select CUSTWAIT
skip
enddo

THIS PART RUN WITH FPW 2.6 TOOK 1 MINUTE BUT VFP7 TOOK 8 MINUTES

*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

THIS PART WITH YOUR SUGGESTED CODES BUT STILL TAKES 8 MINUTES THE SAME WITH
VFP7.

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


Thanks million for your time and consideration Sergey.
Previous
Reply
Map
View

Click here to load this message in the networking platform