共598行,还少两行
坚守VFP最后的阵地
cstr=FILETOSTR("党史100题.txt") CREATE TABLE ds100 (tm c(254),itemA c(50),itemB c(50),itemC c(50),itemD c(50),daan c(10)) nn=ALINES(arrc,cstr,1+4) FOR i=1 TO nn STEP 6 INSERT into ds100 values(arrc(i),arrc(i+1),arrc(i+2),arrc(i+3),arrc(i+4),arrc(i+5)) ENDFOR BROWSE
CREATE CURSOR ds (题号 C(4), 题目 M, 答案 C(1), 题型 C(10)) cStr = FILETOSTR("党史100题.txt") cStr1 = "" FOR i = 1 TO ALINES(aa, cStr, 4 + 1, CHR(13) + CHR(10)) DO CASE CASE VAL(LEFT(aa[i], 1)) > 0 cth = LEFT(aa[i], AT(".", aa[i]) - 1) cStr1 = cStr1 + aa[i] CASE LEFT(aa[i], 1) $ "ABCD" cStr1 = cStr1 + CHR(13) + CHR(10) + aa[i] ENDCASE IF LEFT(aa[i], 2) == "答" cda = RIGHT(aa[i], 1) INSERT INTO ds VALUES (cth, cStr1, cda, "单选题") cStr1 = "" ENDIF ENDFOR SELECT ds BROWSE