回复 7楼 kongyifei
认真仔细阅读、研究一下sdta的程序,测试一下,得到的结果与你希望的结果是否一致?
以下是引用sdta在2019-11-21 22:40:41的发言:
如果楼主嫌麻烦,可以请别人帮忙处理数据,那是要有代价的。
如果楼主嫌麻烦,可以请别人帮忙处理数据,那是要有代价的。
唉,给这个代码有什么意义?心疼你三秒
CREATE CURSOR tt (xh c(3),kskmdm c(3), xm c(10)) INSERT INTO tt VALUES ("","304","张1") INSERT INTO tt VALUES ("","303","张2") INSERT INTO tt VALUES ("","303","张3") INSERT INTO tt VALUES ("","304","张4") INSERT INTO tt VALUES ("","303","张5") INSERT INTO tt VALUES ("","303","张6") INSERT INTO tt VALUES ("","305","张7") INSERT INTO tt VALUES ("","306","张8") BROWSE INDEX on kskmdm TAG px nXh = 1&&&若此处为1;下面if用绝对等于两个==,如果if语句一个等号=,此处可以为0 cDm = "" SCAN IF kskmdm == cDm nXh = nXh + 1 ELSE nXh = 1 ENDIF cDm = Kskmdm REPLACE xh WITH PADL(nXh, 3, "0") ENDSCAN BROWSE
CREATE CURSOR tt (xh c(3),kskmdm c(3), xm c(10)) INSERT INTO tt VALUES ("","304","张1") INSERT INTO tt VALUES ("","303","张2") INSERT INTO tt VALUES ("","303","张3") INSERT INTO tt VALUES ("","304","张4") INSERT INTO tt VALUES ("","303","张5") INSERT INTO tt VALUES ("","303","张6") INSERT INTO tt VALUES ("","305","张7") INSERT INTO tt VALUES ("","306","张8") BROWSE INDEX on kskmdm TAG px nXh = 1&&&若此处为1;下面IF kskmdm == cDm用绝对等于(两个==),如果if语句一个等号=,此处可以为0 cDm = "" SCAN IF kskmdm == cDm nXh = nXh + 1 ELSE nXh = 1 ENDIF cDm = Kskmdm REPLACE xh WITH PADL(nXh, 3, "0") ENDSCAN BROWSE