?? createtotal.prg
字號(hào):
*本程序下面用來(lái)重新創(chuàng)建或刷新表medal.dbf和寫入total.dbf中的隊(duì)名
close tables
use medal in a
use total in b
sele a
delete all
pack
sele b
delete all
pack
close tabl
use medal in a
use playteam in c
use total in d
create view team as select 隊(duì)名 from playteam dist
use team in b
sele b
count to num
go top in b&&此處不可改為添加在上面,見(jiàn)程序總結(jié)。
do while num>0
num=num-1
sele a
append blank
replace 隊(duì)名 with b.隊(duì)名
sele d
append blank
replace 隊(duì)名 with b.隊(duì)名
skip in b
enddo
drop view team
close tables
*本程序下面用來(lái)由final.dbf,record.dbf,和playteam.dbf表建立表total.dbfd
close tables
use final in a
use playteam in b
use record in c
use total in d
use medal in h
sele d
go top
sele h
go top
do while .t.
create view v1 as select 號(hào)碼 from playteam where 隊(duì)名=d.隊(duì)名
use v1 in e
create view find as sele * from record where 號(hào)碼= any(select * from v1)
use find in g
sele g
count to num
drop view find
create view find as sele * from final where 冠軍= any(select * from v1)
use find in g
sele g
count to num1
sele h
replace 金牌 with num1
drop view find
create view find as sele * from final where 亞軍=any (select * from v1)
use find in g
sele g
count to num2
sele h
replace 銀牌 with num2
drop view find
create view find as sele * from final where 季軍=any (sele * from v1)
use find in g
sele g
count to num3
sele h
replace 銅牌 with num3
drop view find
create view find as sele * from final where 第四名=any (sele * from v1)
use find in g
sele g
count to num4
drop view find
create view find as sele * from final where 第五名=any (sele * from v1)
use find in g
sele g
count to num5
drop view find
create view find as sele * from final where 第六名=any (sele * from v1)
use find in g
sele g
count to num6
drop view find
create view find as sele * from final where 第七名=any (sele * from v1)
use find in g
sele g
count to num7
drop view find
create view find as sele * from final where 第八名=any (sele * from v1)
use find in g
sele g
count to num8
drop view find
sele d
replace 總分 with num*13+num1*10+num2*6+num3*4+num4*2+num5+num6+num7+num8
drop view v1
skip in d
if eof()
exit
endif
skip in h
enddo
close tabl
use medal in a
sele a
go top
do while .t.
replace 總數(shù) with 金牌+銀牌+銅牌
skip
if eof()
exit
endif
enddo
close tables
*設(shè)置主控索引。
use medal in a
use total in b
sele a
set order to 金牌
go top
num=1
do while .t.
replace 名次 with num
skip
if eof()
exit
endif
num=num+1
enddo
sele b
set order to 總分
go top
num=1
do while .t.
replace 名次 with num
skip
if eof()
exit
endif
num=num+1
enddo
close tables
*本程序以下產(chǎn)生表player.dbf
use player in a
use playteam in b
use final in c
use record in d
sele a
delete all
pack
sele b
go top
do while .t.
sele a
append blank
replace 號(hào)碼 with b.號(hào)碼
replace 隊(duì)名 with b.隊(duì)名
sele c
count to num for 冠軍=b.號(hào)碼
sele a
replace 冠軍數(shù) with num
sele c
count to num for 亞軍=b.號(hào)碼
sele a
replace 亞軍數(shù) with num
sele c
count to num for 季軍=b.號(hào)碼
sele a
repla 季軍數(shù) with num
sele c
count to num for 第四名=b.號(hào)碼
sele a
replace 第四名數(shù) with num
sele c
count to num for 第五名=b.號(hào)碼
sele a
replace 第五名數(shù) with num
sele c
count to num for 第六名=b.號(hào)碼
sele a
replace 第六名數(shù) with num
sele c
count to num for 第七名=b.號(hào)碼
sele a
replace 第七名數(shù) with num
sele c
count to num for 第八名=b.號(hào)碼
sele a
replace 第八名數(shù) with num
sele b
skip
if eof()
exit
endif
enddo
sele d
go top
do while .t.
sele a
locate for 號(hào)碼=d.號(hào)碼
repla 破紀(jì)錄數(shù) with 破紀(jì)錄數(shù)+1
sele d
skip
if eof()
exit
endif
enddo
close tables
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -