重新发贴,请帮忙解决问题
程序代码:CLEAR
CSTR=[12435789426473940012]
AA=IIF(BETWEEN(LEFTC(CSTR,1),[0],[4]),[小],[大])
CSTRB=[]
CREATE CURSOR T (A C(2),B N(2))
N=1
FOR I=1 TO LEN(CSTR)
CSTRA=IIF(BETWEEN(SUBSTRC(CSTR,I,1),[0],[4]),[小],[大])
IF CSTRA!=AA
N=N+1
ENDIF
INSERT INTO T VALUES (CSTRA,N)
AA=CSTRA
CSTRB=CSTRB+CSTRA
ENDFOR
SELECT MAX(A.BB) B FROM (SELECT b,COUNT(*) AS BB FROM T GROUP BY 1) A INTO CURSOR TEMP
CNAME=[]
FOR I=1 TO N
BB=[CC]+TRANSFORM(I)+[ C(2)]
CNAME=CNAME+BB+IIF(I<N,[,],[])
ENDFOR
CREATE CURSOR S (&CNAME)
FOR I=1 TO TEMP.B
APPEND BLANK
ENDFOR
SELECT A,B,COUNT(*) JS FROM T GROUP BY 2,1 INTO CURSOR TMP
SELECT TMP
SCAN
SELECT S
SCAN
REPLACE (FIELD(TMP.B)) WITH TMP.A FOR RECNO()<=TMP.JS
ENDSCAN
ENDSCAN
SELECT S
CSTR=[]
SCAN
FOR I=1 TO FCOUNT()
CSTR=CSTR+EVALUATE(FIELD(I))+IIF(I<FCOUNT(),+[ ],CHR(13)+CHR(10))
ENDFOR
ENDSCAN
?CSTR
****************************************
问题如下:如上 如何将表中某一字段的所有的内容 附给 CSTR
表内容如下:
20130309 9 1 9 5 5
20130309 1 9 6 0 0
20130309 0 2 3 7 8
20130309 8 4 1 1 9
20130309 8 7 8 8 0
如想将 字段1=20130309 的第六列附值给CSTR,使CSTR=[50890]
应如何做,请高人指点。