以下是引用sdta在2021-7-26 16:42:18的发言:
create cursor b1 (m1 c(3),m2 c(3))
insert into b1 values ("ab","bb")
insert into b1 values ("a","b")
insert into b1 values ("bb","a")
insert into b1 values ("","bb")
insert into b1 values ("bc","")
insert into b1 values ("c","ab")
LOCAL aa[FCOUNT()]
aa = ""
SCAN
FOR lnj = 1 TO FCOUNT()
b1 = ALLTRIM(EVALUATE(FIELD(lnj)))
IF LEN(b1) > 0
FOR lnk = 1 TO LEN(b1)
b2 = SUBSTR(b1, lnk, 1)
IF NOT b2$aa[lnj]
aa[lnj] = aa[lnj] + b2
ENDIF
ENDFOR
ENDIF
ENDFOR
ENDSCAN
LIST MEMORY LIKE aa
create cursor b1 (m1 c(3),m2 c(3))
insert into b1 values ("ab","bb")
insert into b1 values ("a","b")
insert into b1 values ("bb","a")
insert into b1 values ("","bb")
insert into b1 values ("bc","")
insert into b1 values ("c","ab")
LOCAL aa[FCOUNT()]
aa = ""
SCAN
FOR lnj = 1 TO FCOUNT()
b1 = ALLTRIM(EVALUATE(FIELD(lnj)))
IF LEN(b1) > 0
FOR lnk = 1 TO LEN(b1)
b2 = SUBSTR(b1, lnk, 1)
IF NOT b2$aa[lnj]
aa[lnj] = aa[lnj] + b2
ENDIF
ENDFOR
ENDIF
ENDFOR
ENDSCAN
LIST MEMORY LIKE aa
谢谢!
好像版主是统计的所有列,不是单列m1列或m2列?
[此贴子已经被作者于2021-7-26 17:17编辑过]