做成这样是输出格式用的吧
模拟了一下
USE k0110_6 ALIAS db IN 0
CALCULATE MAX(fz) TO n
CREATE CURSOR tt (c11 C(10),c1 C(10),c2 C(10),c3 C(10),c4 C(10),c5 C(10),c6 C(10),c7 C(10),c8 C(10))
FOR i=1 TO n*4
APPEND BLANK
ENDFOR
FOR i=1 TO n
REPLACE c11 WITH TRANSFORM(i) RECORD i*4-3
ENDFOR
SELECT db
SCAN FOR fz>0
REPLACE ("c"+TRANSFORM(db.dc)) WITH db.name RECORD db.fz*4-3 IN "tt"
REPLACE ("c"+TRANSFORM(db.dc)) WITH TRANSFORM(db.hm) RECORD db.fz*4-2 IN "tt"
REPLACE ("c"+TRANSFORM(db.dc)) WITH db.dwjc RECORD db.fz*4-1 IN "tt"
ENDSCAN
SELECT * FROM tt
模拟了一下
USE k0110_6 ALIAS db IN 0
CALCULATE MAX(fz) TO n
CREATE CURSOR tt (c11 C(10),c1 C(10),c2 C(10),c3 C(10),c4 C(10),c5 C(10),c6 C(10),c7 C(10),c8 C(10))
FOR i=1 TO n*4
APPEND BLANK
ENDFOR
FOR i=1 TO n
REPLACE c11 WITH TRANSFORM(i) RECORD i*4-3
ENDFOR
SELECT db
SCAN FOR fz>0
REPLACE ("c"+TRANSFORM(db.dc)) WITH db.name RECORD db.fz*4-3 IN "tt"
REPLACE ("c"+TRANSFORM(db.dc)) WITH TRANSFORM(db.hm) RECORD db.fz*4-2 IN "tt"
REPLACE ("c"+TRANSFORM(db.dc)) WITH db.dwjc RECORD db.fz*4-1 IN "tt"
ENDSCAN
SELECT * FROM tt