没理解“js字段需要填充01表中5项abcd的均分”,是5个数相加再除以5吗?如果是的话,自己改一下吧。
没仔细验证,楼主自己验证吧。
USE s:\01
USE s:\bj in 0
ZAP in bj
STORE 0 to s1,s2,s3,s4,s5,s6,s7,s8
FOR i=1 to RECCOUNT()
STORE 0 to n1,n2,n3,n4,n5,n6,n7,n8
GO i
FOR j=1 to 5
n1=n1+ctd(SUBSTR(abcd,0+j,1))
n2=n2+ctd(SUBSTR(abcd,5+j,1))
n3=n3+ctd(SUBSTR(abcd,10+j,1))
n4=n4+ctd(SUBSTR(abcd,15+j,1))
n5=n5+ctd(SUBSTR(abcd,20+j,1))
n6=n6+ctd(SUBSTR(abcd,25+j,1))
n7=n7+ctd(SUBSTR(abcd,30+j,1))
n8=n8+ctd(SUBSTR(abcd,35+j,1))
NEXT
APPEND BLANK in bj
REPLACE j1 with n1,j2 with n2,j3 with n3,;
j4 with n4,j5 with n5,j6 with n6,;
j7 with n7,j8 with n8 in bj
s1=s1+n1
s2=s2+n2
s3=s3+n3
s4=s4+n4
s5=s5+n5
s6=s6+n6
s7=s7+n7
s8=s8+n8
NEXT
s1=STR(s1/RECCOUNT(),5,2)
s2=STR(s2/RECCOUNT(),5,2)
s3=STR(s3/RECCOUNT(),5,2)
s4=STR(s4/RECCOUNT(),5,2)
s5=STR(s5/RECCOUNT(),5,2)
s6=STR(s6/RECCOUNT(),5,2)
s7=STR(s7/RECCOUNT(),5,2)
s8=STR(s8/RECCOUNT(),5,2)
?s1
?s2
?s3
?s4
?s5
?s6
?s7
?s8
FUNCTION ctd
PARAMETERS x
x=ASC(UPPER(x))
RETURN 85-x-IIF(x=65,0,1)-IIF(x>66,5,0)-IIF(x=68,3,0)