程序代码:
USE 第一学期期中积分
COPY TO jfb
Clear
Close Databases all
*!* 数组变量设置
Local akm[7],bkm[7],x[16]
* 科目
akm[1]="Yw" && 语文
akm[2]="Sx" && 数学
akm[3]="Yy" && 英语
akm[4]="Wl"
akm[5]="Hx"
akm[6]="Sw"
akm[7]="Zf"
bkm[1]="Yw" && 语文
bkm[2]="Sx" && 数学
bkm[3]="Yy" && 英语
bkm[4]="Wl"
bkm[5]="Hx"
bkm[6]="Sw"
bkm[7]="Zf"
* 保存计数结果的变量
X=0
Use jfb In 0
SELECT MAX(VAL(bj)) FROM jfb INTO ARRAY amax
Select jfb
DELETE FOR RECNO()>amax
PACK
SCAN for !Empty(bj)
Select jfb
For i=1 to Alen(akm,1)
ckm=akm[i]+"kmjf"
dkm=bkm[i]+"jfmc"
Replace &ckm with 20 FOR &dkm=1 in jfb
Replace &ckm with 19 FOR &dkm=2 in jfb
Replace &ckm with 18 FOR &dkm=3 in jfb
Replace &ckm with 17 FOR &dkm=4 in jfb
Replace &ckm with 16 FOR &dkm=5 in jfb
Replace &ckm with 15 FOR &dkm=6 in jfb
Replace &ckm with 14 FOR &dkm=7 in jfb
Replace &ckm with 13 FOR &dkm=8 in jfb
Replace &ckm with 12 FOR &dkm=9 in jfb
Replace &ckm with 11 FOR &dkm=10 in jfb
Replace &ckm with 10 FOR &dkm=11 in jfb
Replace &ckm with 9 FOR &dkm=12 in jfb
Replace &ckm with 8 FOR &dkm=13 in jfb
Replace &ckm with 7 FOR &dkm=14 in jfb
Replace &ckm with 6 FOR &dkm=15 in jfb
Replace &ckm with 5 FOR &dkm=16 in jfb
Replace &ckm with 4 FOR &dkm=17 in jfb
Replace &ckm with 3 FOR &dkm=18 in jfb
Replace &ckm with 2 FOR &dkm=19 in jfb
Replace &ckm with 1 FOR &dkm=20 in jfb
EndFor
X=0
ENDSCAN
CLOSE DATABASES ALL
CREATE CURSOR zjfb (序号 c(12),姓名 c(8),班级数 n(5,0),班级名 c(30),总分 n(5,0),平均 n(7,2))
USE jfb IN 0
SELECT jfb
LOCAL azd[FCOUNT()-1]
FOR i=2 TO FCOUNT()
azd[i-1]=FIELD(i)
ENDFOR
DIMENSION azd[ALEN(azd,1)/2,2]
FOR i=1 TO ALEN(azd,1)
INDEX on &azd[i,2] TO xm
xm=""
nxh=1
SCAN
IF &azd[i,2]==xm
REPLACE 班级数 WITH 班级数+1,班级名 WITH 班级名-","-jfb.bj,总分 WITH 总分+EVALUATE("jfb."+azd[i,1]),平均 WITH 总分/班级数 IN zjfb
ELSE
INSERT INTO zjfb VALUES (azd[i,2]+TRANSFORM(nxh),EVALUATE("jfb."+azd[i,2]),1,jfb.bj,EVALUATE("jfb."+azd[i,1]),EVALUATE("jfb."+azd[i,1]))
nxh=nxh+1
ENDIF
xm=&azd[i,2]
ENDSCAN
ENDFOR
SELECT zjfb
BROWSE
按照这个处理数据,提示数据类型不正确。