回复 26楼 sdta
如果能将科目等级组合提取后并排序存放,就可以用它直接和要求比较小于等于为真,大于为否。可是苦于只会简单用alltrim提取,不会排序。所以就绕路用的排除法(具体如下,),提前将各种等级提取出来,为此并且增加了许多辅助字段。虽能解决但觉得有点绕,尤其统招生2B2C2D(BBCCDD)的排除怕有落漏,最好的方法还是你的提取排序后比较大小,我们的想法总感觉不够数学和逻辑,想学习你的等级排序,可是象你11行就解决的,处于知识所限,平时没用也没看懂(FUNCTION \LOCAL \ASORT\ ALEN意思作用没看懂,见笑了,请指教,能否帮编辑实现先将提取的等级组合排序后存放,然后我直接比较大小用repl替换即可)
&&&排除法指标生
repl all zbs with ''
&&提取A指标生(物理、化学1B1C以上;思想品德、历史、地理、生物1B3C以上;体育与健康D以上)
repl
zbs with '31' for zy2=='31' and 科目合计=7 and (OCCURS('D',理化)=0 and OCCURS('E',理化)=0 and OCCURS('C',理化)<=1) and (OCCURS('D',政史地生)=0 and OCCURS('E',政史地生)=0 and OCCURS('C',政史地生)<=3) and OCCURS('E',tydj)=0
&&提取B指标生,5C2D以上
repl
zbs with '32' for E=0 and D<=2
and zy2=='32' and 科目合计=7
&&提取C指标生,5C2D以上
repl
zbs with '33' for E=0 and D<=2 and zy2=='33' and 科目合计=7
&&提D指标生,物理、化学、生物、地理3C1D以上,政史体2C1D以上
repl zbs with '34' for OCCURS('E',理化生地)=0 and OCCURS('D',理化生地)<=1 and OCCURS('D',政史体)<=1 and OCCURS('E',政史体)=0 and zy2=='34' and 科目合计=7
&&排除法统招生把不符合条件的考生作出标记40
repl all tzs with ''
*repl
tzs with '40' for zy3=='31' and ((OCCURS('E',六科)<>0 or OCCURS('D',六科)>2) or (OCCURS('C',六科)=4 and OCCURS('D',六科)=2)
or (OCCURS('C',六科)=3 and OCCURS('D',六科)=2) or (OCCURS('C',六科)=4 and OCCURS('D',六科)=1) or (OCCURS('C',六科)=5 and OCCURS('D',六科)=1) or
(OCCURS('C',六科)>=5 and OCCURS('D',六科)=0))
repl
tzs with '40' for zy3=='31' and ((OCCURS('E',六科)<>0 or OCCURS('D',六科)>2) or (OCCURS('C',六科)=3 and OCCURS('D',六科)=2) or (OCCURS('C',六科)=4 and OCCURS('D',六科)=2) or (OCCURS('C',六科)=4 and OCCURS('D',六科)=1) or
(OCCURS('C',六科)>=5 and OCCURS('D',六科)<=1))
&&剩余的就是符合等级要求的用31标记
repl tzs with '31' for zy3=='31' and tzs<>'40'
repl tzs with '32' for e<=1 and zy3=='32'
repl tzs with '33' for e<=1 and zy3=='33'
repl tzs with '34' for e<=1 and zy3=='34'