CLOSE DATABASES ALL
Start_Time=SECONDS()
cField="题名 C(10),应考人数 N(6),实考人数 N(6)"
FOR i=0 To 9
cField=cField+",F"+STR(i,1)+" N(6)"
ENDFOR
CREATE CURSOR Data_Stat (&cField)
LOCAL ArrayCnt[1,FCOUNT()]
ArrayCnt=0
USE Sx IN 0
SELECT Sx
FOR i=1 TO FCOUNT()
ArrayCnt[1,1]=FIELD(i)
ArrayCnt[1,3]=RECCOUNT()
SCAN
ArrayCnt[1,VAL(EVALUATE(FIELD(i)))+1+3]=ArrayCnt[1,VAL(EVALUATE(FIELD(i)))+1+3]+1
ENDSCAN
INSERT INTO Data_Stat FROM ARRAY ArrayCnt
ArrayCnt=0
ENDFOR
MESSAGEBOX(TRANSFORM(SECONDS()-Start_Time,"9.999"))
SELECT Data_Stat
FOR i=2 TO FCOUNT()
BLANK FIELDS (FIELD(I)) FOR EVALUATE(FIELD(I))=0
ENDFOR
GO TOP
BROWSE