我已经解决
DO WHILE !EOF("级表") AND (i <= n行)
* 如果有适用的空座号就找号入座,否则新增一行座位。
IF (n行k+i) <= RECCOUNT("kcb1")
GO (n行k+i) IN "kcb1"
ELSE
APPEND BLANK IN "kcb1"
REPLACE 考场 WITH n场i IN "kcb1"
ENDIF
* 对号入座,标记考生数据
IF MOD(n行k+i,9)=0 AND
n列k=1
REPLACE ("列"+TRANSFORM(n列k)) WITH "" IN "kcb1"
ELSE
IF MOD(n行k+i,9)=0 AND
n列k=2
REPLACE ("列"+TRANSFORM(n列k)) WITH "" IN "kcb1"
else
REPLACE ("列"+TRANSFORM(n列k)) WITH 级表.姓名+"("+RIGHT(级表.学号,5)+")" IN "kcb1"
endif
endif
i = i + 1
SKIP IN "级表"
ENDDO