回复 40楼 fdxxhjc
"列"+TRANSFORM(i) 是字符串字符串是什么类型:
?VARTYPE("列"+TRANSFORM(i))
SELECT RECNO() bh, * FROM a INTO TABLE 交换结果记录表 SELECT RECNO() bh, * FROM b INTO CURSOR tb SELECT 交换结果记录表 INDEX on bh TAG ta_bh RAND(-1) SELECT tb INDEX ON RAND() TAG tb_r SET RELATION TO bh INTO "交换结果记录表" ran = INT((RECCOUNT("tb")-1)*RAND()+1) ? " 取 "+TRANSFORM(ran)+" 条记录" SCAN NEXT ran ? bh SCATTER MEMVAR SELECT 交换结果记录表 GATHER MEMVAR ENDSCAN SELECT 交换结果记录表 BROWSE CLOSE TABLES ALL