回复 8楼 yd1954
今天早上上网看了下,发现结果不正确,在6楼代码的基础上又进行了修改
坚守VFP最后的阵地
NOTE by.dbf 改名 bX1.dbf 原因:自己想 lcStr = "z7,z8,z10,z11,z15,z23,z27,z28,z30,z31,z32,z33,z34,z35,z37,z38,z39,z40,z44,z45,z46,z50,z51,z52,z53,z54,z55,z59,z60,z61" ALINES(laStr, lcStr, ",") SELECT 0000 xh, &lcStr FROM bX1 WHERE .F. INTO TABLE BX2 && 生成的新表 SELECT &lcStr FROM bx WHERE RECNO() = RECCOUNT() INTO ARRAY aRecc SELECT &lcStr FROM bX1 INTO CURSOR cx SCAN SCATTER FIELDS &lcStr TO aRecn INSERT INTO bx2 (xh) VALUES (RECNO("cx")) LOCAL aa[1, ALEN(laStr)] FOR lnj = 1 TO ALEN(laStr) IF aRecc[lnj] = aRecn[lnj] EXIT ELSE aa[1, lnj] = aRecn[lnj] ENDIF ENDFOR IF lnj > ALEN(laStr) REPLACE FROM ARRAY aa FIELDS &lcStr IN bx2 ENDIF ENDSCAN SELECT bx2 BROWSE