CREATE CURSOR cj (xh c(6),a1 c(1),a2 c(1),a3 c(1),a4 c(1),a5 c(1),a6 c(10))
INSERT INTO cj VALUES ("0001","A","A","C","D","B","")
INSERT INTO cj VALUES ("0002","A","B","A","B","D","")
SCAN
cStr=ALLTRIM(a1-a2-a3-a4-a5)
cStr1=""
FOR i=1 TO 4 && 此处的4代表成绩等级ABCD
n=OCCURS(CHR(64+i),cStr)
cStr1=cStr1+IIF(n=0,"",TRANSFORM(n)+CHR(64+i))
ENDFOR
REPLACE a6 WITH cStr1
ENDSCAN
BROWSE
[此贴子已经被作者于2018-8-3 19:19编辑过]