回复 27楼 chychychy
这是一个老教务告诉我的方法,如何用VFP来实现?确实没有想到好的办法,所以才放到Excel中去粘贴的。VFP可否可以使用数组来填充录取信息?有空时试一下。
BLANK FIELDS xkzh ALL BROWSE **提取并排序 SCAN SCATTER FIELDS wldj,hxdj,zzdj,lsdj,dldj,swdj TO px6 = ASORT(px6) REPLACE xkzh WITH ALLTRIM(px6[1] - px6[2] - px6[3] - px6[4] - px6[5] - px6[6] ) ENDSCAN **对位比较,因为最低组合是BBCCDD;排序后利用A<B<C<D逻辑逐个对位比较 REPLACE ALL lqxxdm WITH '31' FOR SUBSTR(xkzh,1,1)<='B' AND SUBSTR(xkzh,2,1)<='B' AND SUBSTR(xkzh,3,1)<='C' AND SUBSTR(xkzh,4,1)<='C'AND SUBSTR(xkzh,5,1)<='D'AND SUBSTR(xkzh,6,1)<='D'
[此贴子已经被作者于2024-12-10 11:00编辑过]
[此贴子已经被作者于2024-12-11 08:18编辑过]
**判断是否满足BBCD,2B1C1D条件 ***建立4科等级排列 CREATE CURSOR tt (x1 c(1)) FOR i = 65 TO 69 INSERT INTO tt VALUES (CHR(i)) ENDFOR SELECT aa.x1 + bb.x1 + cc.x1 + dd.x1 ZH FROM tt aa ; INNER JOIN tt bb ON bb.x1 >= aa.x1 ; INNER JOIN tt cc ON cc.x1 >= bb.x1 ; INNER JOIN tt dd ON dd.x1 >= cc.x1 ; ORDER BY 1 INTO CURSOR tmp1 READWRITE *BROWSE &&查看测试用 SELECT *,RECNO() xh ,00 SFHG FROM tmp1 INTO DBF zh4 &&SFHG为是否合格 BROWSE ***所以包含E的均为不合格,将SFHG字段标记为2 REPLACE SFHG WITH 2 FOR "E" $ ZH &&去掉35条 ***手动判断去掉11条不合格的,将SFHG字段标记为3 **---------------------------- *ACDD,ADDD, *BBDD,BCCD,BCDD,BDDD *CCCC,CCCD,CCDD,CDDD, *DDDD ** 70-35-11=24条 所有符合条件的组合 REPLACE sfhg WITH 3 FOR zh='ACDD' OR zh='ADDD' OR zh='BBDD'OR zh='BCCD' OR zh='BCDD' OR zh='BDDD' OR zh='CCCC' OR zh='CCCD' OR zh='CCDD' OR zh='CDDD' OR zh='DDDD' **--------------------------- SELECT * FROM zh4 WHERE sfhg=0 &&所有符合条件的组合,是否合格sfhg字段为0,有24条 SELECT * FROM zh4 WHERE OCCURS("E", zh) = 0 AND OCCURS("D", zh) <= 3 AND zh <= "BBCD" &&&这个判断会显示有25条 **多了ACDD\ADDD **少了BCCC