在29楼的基础上做了改进
程序代码:
CLOSE DATABASES ALL USE hz1 IN 0 nRecc=RECCOUNT() CALCULATE Max(bj) TO nMax CREATE CURSOR tt (bj c(2),lb c(20),rs n(4)) cField="班级 c(2)" FOR i=1 TO INT(0.85/0.05) STEP 2 SELECT Hz1 CALCULATE MIN(Smzf) TO nMin FOR Smzfjm<=nRecc*0.05*i cField=cField+","+"F"+TRANSFORM(INT(nMin))+"分以上"+" n(4)" INSERT INTO tt ; SELECT PADL(bj,2,"0"),"F"+TRANSFORM(INT(nMin))+"以上" ,; SUM(IIF(smzfjm<=INT(nRecc*0.05*i),1,0)) ; FROM hz1 GROUP BY bj ENDFOR CREATE CURSOR ttt (&cField) SELECT rs FROM tt ORDER BY bj INTO ARRAY Array_Rs DIMENSION Array_Rs[ALEN(Array_Rs,1)+nMax,1] FOR i=1 TO nMax Num_ber=(i-1)*10+1 =AINS(Array_Rs,Num_ber) Array_Rs[Num_ber,1]=PADL(i,2,"0") ENDFOR DIMENSION Array_Rs[nMax,FCOUNT("ttt")] INSERT INTO ttt FROM ARRAY Array_Rs SELECT ttt BROWSE
[此贴子已经被作者于2018-9-7 18:48编辑过]
坚守VFP最后的阵地