下列程序有点问题,提示“下标超界”,姓名、语文、数学、外语、综合不能读到表文件中。请高手指教,万分感谢!!!
CLOSE DATABASES
cCurrentProcedure = SYS(16,1)
nPathStart = AT(":",cCurrentProcedure)- 1
nLenOfPath = RAT("\", cCurrentProcedure) - (nPathStart)
mypath=SUBSTR(cCurrentProcedure, nPathStart, nLenofPath)
SET Default TO (mypath)
cstr=FILETOSTR("0122012200.txt")
CREATE CURSOR gkcj (考生号 c(14),姓名 c(10),报名区县 c(10),报名点 c(20),总分 n(3),语文 n(3),数学 n(3),外语 n(3),综合 n(3))
FOR i=1 TO ALINES(axx,cstr,CHR(13)+CHR(10))
IF EMPTY(axx[i])
LOOP
ENDIF
LOCAL cj[1,9]
DO CASE
CASE LEFT(axx[i],2)=="14"
cj[1,1]=LEFT(axx[i],14)
i=i+1
cj[1,2]=SUBSTR(axx[i],2)
CASE LEFT(axx[i],10)=="报名区县: "
cj[1,3]=SUBSTR(axx[i],11)
CASE LEFT(axx[i],10)=="报 名 点: "
cj[1,4]=SUBSTR(axx[i],11)
CASE LEFT(axx[i],4)=="总分"
cj[1,5]=VAL(SUBSTR(axx[i],6))
i=i+1
cj[1,6]=VAL(SUBSTR(axx[i],6))
i=i+1
cj[1,7]=VAL(SUBSTR(axx[i],6))
i=i+1
cj[1,8]=VAL(SUBSTR(axx[i],6))
i=i+1
cj[1,9]=VAL(SUBSTR(axx[i],6))
INSERT INTO gkcj FROM ARRAY cj
ENDCASE
ENDFOR
BROWSE
[此贴子已经被作者于2020-4-20 15:54编辑过]