等级替换的代码错在哪里
帮我看看代码错在哪里:表 djfz.dbf
字段:k1,k2,k3,k4,k5(存放各科等级:A、B、C、D、E五等),dj(把k1-k5的等级合并),djfz(对dj字段的等级进行分析,如 ABCDE ,替换成 1A1B1C1D)
close all
use djhz alias djhz
repl all dj with k1+k2+k3+k4+k5
zs=recc()
cdu=len(allt(dj))
aa=0
bb=0
cc=0
dd=0
ee=0
for i=1 to zs
go i
for j=1 to cdu
do case
case substr(allt(dj),j,1)='A'
aa=aa+1
case substr(allt(dj),j,1)='B'
bb=bb+1
case substr(allt(dj),j,1)='C'
cc=cc+1
case substr(allt(dj),j,1)='D'
dd=dd+1
case substr(allt(dj),j,1)='E'
ee=ee+1
endcase
endfor
repl djhz with allt(str(aa))+'A'+allt(str(bb))+'B'+allt(str(cc))+'C'+allt(str(dd))+'D'+allt(str(ee))+'E'
endfor