⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createtotal.bak

📁 一个精彩的奥运会成绩统计系统
💻 BAK
字号:
*本程序用来重新创建或刷新表medal.dbf和total.dbf的队名
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 队名 from playteam dist
use team in b
sele b
count to num
go top in b&&此处不可改为添加在上面,见程序总结。
do while num>0
	num=num-1
	sele a
	append blank
	replace 队名 with b.队名
	sele d
	append blank
	replace 队名 with b.队名
	skip  in b
enddo
drop view team
close tables



*本程序用来由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 号码 from playteam where  队名=d.队名
	use v1 in e
	create view find as sele * from record where 号码= 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 总数 with 金牌+银牌+铜牌
skip
if eof()
exit
endif
enddo
close tables
*设置主控索引。
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
*以下产生表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 号码 with b.号码
	replace 队名 with b.队名
	sele c
	count to num for 冠军=b.号码
	sele a
	replace 冠军数 with num
	sele c
	count to num for 亚军=b.号码
	sele a
	replace 亚军数 with num
	sele c
	count to num for 季军=b.号码
	sele a
	repla 季军数 with num
	sele c
	count to num for 第四名=b.号码
	sele a
	replace 第四名数 with num
	sele c
	count to num for 第五名=b.号码
	sele a
	replace 第五名数 with num
	sele c
	count to num for 第六名=b.号码
	sele a
	replace 第六名数 with num
	sele c
	count to num for 第七名=b.号码
	sele a
	replace 第七名数 with num
	sele c
	count to num for 第八名=b.号码
	sele a
	replace 第八名数 with num
	sele b
	skip
	if eof()
		exit
	endif
enddo
sele d
go top
do while .t.
	sele a
	locate for 号码=d.号码
	repla 破纪录数 with 破纪录数+1
	sele d
	skip
	if eof()
		exit
	endif
enddo
close tables

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -