函数运行问题
integer li_rc=1
string Keylist[],clearkey[]
boolean existsname
integer li_file,ll_length
string ls_linetext
long li_first,li_last,i
long ll_first,ll_last,ll_mkey,ll_key
string mkeyname1,keyname
//mkeyname="pbcatedt"
Keylist[]=clearkey[]
ll_mkey=0
ll_first =0
ll_last =0
existsname= false
if (not FileExists (Filename)) then
return -2
end if
ll_length = FileLength (Filename)
li_file = FileOpen (Filename)
//if li_file = -1 then
//return -1
//end if
i=0
do while li_rc >= 0
// 读取一行数据
li_rc = FileRead (li_file, ls_linetext)
ll_first = Pos (ls_linetext, "[")
ll_last = Pos (ls_linetext, "]")-2
li_last = Pos (ls_linetext, "=")-2
if existsname and ll_last>0 and ll_first>0 then
return Keylist
end if
if existsname and li_last >0 then
i=i+1
keyname=mid(ls_linetext,1,li_last)
Keylist[i]=keyname
end if
if ll_first >0 and ll_last >0 then
mkeyname1=mid(ls_linetext,ll_first+1,ll_last)
// w_getstructure.lb_1.additem("ls_linetext="+ls_linetext)
// w_getstructure.lb_1.additem("mkeyname="+mkeyname)
// w_getstructure.lb_1.additem("mkeyname1="+mkeyname1)
if mkeyname=mkeyname1 then
existsname=true
else
existsname=false
end if
END IF
loop
fileclose(li_file)
return Keylist
请问为什么这个函数运行两次就会出错