明白点了,是不是这样子
DIMENSION arr[10,16]
USE 原表 IN 0
USE 替换表 IN 0
SELECT * FROM 原表 WHERE .F. INTO CURSOR 替换后表 READWRITE
FOR i=1 TO RECCOUNT("替换表")-15
DIMENSION ar[16,1]
SELECT 替换表
COPY TO ARRAY ar FIELDS 变量 FOR BETWEEN(RECNO(),i,i+15)
DIMENSION ar[16]
FOR j=1 TO 16
DIMENSION ai[10,1]
SELECT 原表
COPY TO ARRAY ai FIELDS ("列"+TRANSFORM(j))
DIMENSION ai[10]
FOR k=1 TO 10
arr[k,j] = ar[ai[k]]
ENDFOR
ENDFOR
SELECT 替换后表
APPEND FROM ARRAY arr
ENDFOR
SELECT * FROM 替换后表
DIMENSION arr[10,16]
USE 原表 IN 0
USE 替换表 IN 0
SELECT * FROM 原表 WHERE .F. INTO CURSOR 替换后表 READWRITE
FOR i=1 TO RECCOUNT("替换表")-15
DIMENSION ar[16,1]
SELECT 替换表
COPY TO ARRAY ar FIELDS 变量 FOR BETWEEN(RECNO(),i,i+15)
DIMENSION ar[16]
FOR j=1 TO 16
DIMENSION ai[10,1]
SELECT 原表
COPY TO ARRAY ai FIELDS ("列"+TRANSFORM(j))
DIMENSION ai[10]
FOR k=1 TO 10
arr[k,j] = ar[ai[k]]
ENDFOR
ENDFOR
SELECT 替换后表
APPEND FROM ARRAY arr
ENDFOR
SELECT * FROM 替换后表