程序代码:
CLOSE DATABASES
USE jsrkb1
ZAP
INDEX on nj + bj TAG nj
CREATE CURSOR tt (nj c(6), bj c(7), km c(6), jsxm c(10), bz n(2))
cStr = FILETOSTR("课表20180920.TXT")
nRows = ALINES(aa, cStr, 4 + 1, CHR(13) + CHR(10))
cc = "一二三四五六"
FOR i = 1 TO nRows
nLen = ALINES(bb, aa[i], 4 + 1, "、", ":", ",")
xm = bb[2]
FOR ii = 3 TO nlen
cnj = LEFT(bb[ii], 2) + "年级"
cbj = SUBSTR(bb[ii], 3, 5) + "班"
nbz = VAL(STR((AT(LEFT(bb[ii], 2), cc) + 1) / 2, 1) + STREXTRACT(cbj, "(", ")"))
ckm = SUBSTR(bb[ii], 8)
INSERT INTO tt VALUES (cnj, cbj, ckm, xm, nbz)
ENDFOR
ENDFOR
SELECT tt
REPLACE km WITH "班会" FOR ALLTRIM(km) == "班主任"
SELECT * FROM tt ORDER BY bz INTO CURSOR tt1
SELECT tt1
SET RELATION TO nj + bj INTO jsrkb1
SCAN
IF NOT FOUND("jsrkb1")
INSERT INTO jsrkb1 (nj, bj) VALUES (tt1.nj, tt1.bj)
ENDIF
REPLACE (tt1.km) WITH tt1.jsxm IN jsrkb1
ENDSCAN
SET RELATION TO
SELECT jsrkb1
SET ORDER TO
BROWSE
图片附件: 游客没有浏览图片的权限,请
登录 或
注册