* VFP9 代码
CREATE CURSOR 测试 (tt C(80), lsh C(6), xh N(6,0))
cStr = FILETOSTR("text.txt")
nLsh = 0
nXh = 0
FOR i = 1 TO ALINES(aa, cStr, 4)
DO CASE
CASE LEFT(aa[i], 2) == "01"
nLsh = nLsh + 1
INSERT INTO 测试 (tt, lsh) VALUES (aa[i], PADL(nLsh, 6, "0"))
CASE LEFT(aa[i], 2) == "03"
nXh = nXh + 1
INSERT INTO 测试 VALUES (aa[i], PADL(nLsh, 6, "0"), nXh)
CASE LEFT(aa[i], 2) == "09"
nXh = 0
INSERT INTO 测试 (tt, lsh) VALUES (aa[i], PADL(nLsh, 6, "0"))
ENDCASE
ENDFOR
BROWSE