程序代码:
SET COLLATE TO "MACHINE" CREATE CURSOR tjhzb (zdm c(10), xmxh c(2), xmnr c(120), yb0 n(4), jg0 n(4), yb1 n(4), jg1 n(4), yb2 n(4), jg2 n(4), yb3 n(4), jg3 n(4)) CREATE TABLE tjb (zdm c(10), xmxh c(2), xmnr c(120), yb0 n(4), jg0 n(4), yb1 n(4), jg1 n(4), yb2 n(4), jg2 n(4), yb3 n(4), jg3 n(4)) SELECT DISTINCT zdm FROM dmztjm INTO CURSOR temp1 SCAN FOR BETWEEN(RECNO(), 2, 10) c1 = zdm INSERT INTO tjb (zdm, xmxh, xmnr) SELECT zdm, xmxh, xmnr FROM dmztjm WHERE ALLTRIM(zdm) == c1 SELECT tjb INDEX on zdm + xmxh TAG dmxh SELECT bm, c1 zdm, a1, &c1 FROM ztjm INTO CURSOR temp2 SET RELATION TO zdm + &c1 INTO tjb SCAN IF EMPTY(a1) c2 = "Yb0" ELSE c2 = "Yb" + temp2.a1 ENDIF REPLACE (c2) WITH EVALUATE(c2) + 1, yb3 WITH yb0 + yb1 + yb2 IN tjb ENDSCAN SELECT tjb SET ORDER TO INSERT INTO tjb (xmnr, yb0, yb1, yb2, yb3) SELECT "合计", SUM(yb0), SUM(yb1), SUM(yb2), SUM(yb0) + SUM(yb1) + SUM(yb2) FROM tjb INSERT INTO tjhzb SELECT * FROM tjb WHERE NOT EMPTY(yb3) ZAP IN tjb ENDSCAN SELECT tjhzb browse USE IN tjb ERASE tjb.dbf
坚守VFP最后的阵地