📄 aaaaaaa20040206.bak
字号:
set talk off
clea all
clos data
set safe off
on error do clea
set defa to E:\成绩跟综
dime d(16)
dime f(10),r(10)
dime jg(10),yl(10)
store 0 to r,x01,x02,x11,x12,x21,x22,x31,x32,x41,x42,x51,x52,x61,x62,x71,x72,x81,x82,x91,x92
sele 1
gcT = GETFILE('dbf','文件名(N):', '打开',1)
DO CASE
CASE 'Untitled' $ gcT
CREATE (gcT)
CASE EMPTY(gcT)
modi comm (gcT)
RETURN
OTHERWISE
USE (gcT)
ENDCASE
sele 2
input"请输入年份:" to pp
input"请输入考试的次数:" to ppp
acce"请输入字段个数:" to a
acce"请输入文件名:" to c
crea table &c(zxdm n(4),参考数 n(4),zf n(5,2),jg0 n(4,2),yl0 n(4,2),lb n(2))
a=val(a)
a=int(a)
k=1
for k=1 to a&&添加cj1-cj9的字段开始
s='cj'+str(k,1)
w='jg'+str(k,1)
y='yl'+str(k,1)
d='d'+str(k,1)
alte tabl &c add &s n(5,2)
alte tabl &c add &w n(4,2)
alte tabl &c add &y n(4,2)
alte tabl &c add &d n(4)
endfor&&添加cj1-cj9的字段结束
sele 1
calc max(lb) to l
calc min(lb) to m
nn=m
do whil nn<=l&&对类别进行循环
n=5901
do while n<=5908&&对学校进行循环
sele 1
loca all for zxdm=n.and.lb=nn
coun all to aa for zxdm=n.and.zf>0.and.lb=nn&&按类别、学校计数和查询,并添加记录
coun all to bb for zxdm=n.and.lb=nn.and.zf>=(3/5)*750
coun all to cc for zxdm=n.and.lb=nn.and.zf>=(17/20)*750
aver zf for zxdm=n.and.lb=nn to mm
if aa>0
bb=(bb/aa)*100
cc=(cc/aa)*100
sele 2
appe blan
repl zxdm with n 参考数 with aa zf with mm jg0 with bb yl0 with cc lb with nn
sele 1&&如果aa>0,则在添加记录后,还要计算相应的成绩
k=1
do whil k<=a
s='cj'+str(k,1)
w='jg'+str(k,1)
y='yl'+str(k,1)
d='d'+str(k,1)
sele 1
loca all for &s>=1.and.zxdm=n
coun all to dd for zxdm=n.and.lb=nn.and.&s>0
count all to a1 for &s>=((3/5)*150).and.zxdm=n.and.lb=nn
count all to a2 for &s>=((17/20)*150).and.zxdm=n.and.lb=nn
if dd>0
jg=(a1/dd)*100
yl=(a2/dd)*100
aver &s for zxdm=n.and.&s>0.and.lb=nn to f
sele 2
repl &d with dd &s with f &w with jg &y with yl
else
endif
k=k+1
enddo
else
endif
n=n+1
enddo
&&以下是类别为nn的全市合计
sele 1
coun all to aa for zf>0.and.lb=nn
coun all to bb for zf>=(3/5)*750.and.lb=nn
coun all to cc for zf>=(17/20)*750.and.lb=nn
aver zf to mm for zf>0.and.lb=nn
if aa>0
bb=(bb/aa)*100
cc=(cc/aa)*100
sele 2
appe blan&&如果此类别存在,则添加一个记录并进行以下统计
repl zxdm with 5959 参考数 with aa zf with mm jg0 with bb yl0 with cc lb with nn
sele 1
k=1
do whil k<=a
sele 1
s='cj'+str(k,1)
w='jg'+str(k,1)
y='yl'+str(k,1)
d='d'+str(k,1)
loca all for &s>=1.and.lb=nn
coun all to dd for &s>=1.and.lb=nn
count all to a1 for &s>=((3/5)*150).and.lb=nn
count all to a2 for &s>=((17/20)*150).and.lb=nn
if dd>0
jg=(a1/dd)*100
yl=(a2/dd)*100
aver &s for &s>0 to f
else
jg=0
yl=0
f=0
endif
sele 2
repl &d with dd &s with f &w with jg &y with yl
else
endif
k=k+1
enddo
nn=nn+1
enddo
sele 1
coun all to aa for zf>0
coun all to bb for zf>=(3/5)*750
coun all to cc for zf>=(17/20)*750
aver zf to mm for zf>0
bb=(bb/aa)*100
cc=(cc/aa)*100
sele 2
appe blan
repl zxdm with 5959 参考数 with aa zf with mm jg0 with bb yl0 with cc
sele 1
k=1
do whil k<=a
sele 1
s='cj'+str(k,1)
w='jg'+str(k,1)
y='yl'+str(k,1)
d='d'+str(k,1)
loca all for &s>=1
coun all to dd for &s>=1
count all to a1 for &s>=((3/5)*150)
count all to a2 for &s>=((17/20)*150)
jg=(a1/dd)*100
yl=(a2/dd)*100
aver &s for &s>0 to f
sele 2
repl &d with dd &s with f &w with jg &y with yl
k=k+1
enddo
select 2
cccc='盐城市'+str(pp,4)+'年第'+str(ppp,1)+'次调研考试各科成绩一览表'
copy to &cccc xl5
brow
retu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -