函数运行问题

zqycn518 2011-03-30 02:41:59
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

请问为什么这个函数运行两次就会出错
...全文
70 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zqycn518 2011-04-05
  • 打赏
  • 举报
回复
已经搞定了
greatxingxing 2011-04-04
  • 打赏
  • 举报
回复
楼主把报错的信息贴出来
zqycn518 2011-04-01
  • 打赏
  • 举报
回复
没人会?
tony2009 2011-03-30
  • 打赏
  • 举报
回复
return value boolean...
yyoinge 2011-03-30
  • 打赏
  • 举报
回复
这函数能保存得了吗???

if (not FileExists (Filename)) then
return -2
end if
又有
return Keylist

能编译通过吗?
liubocy 2011-03-30
  • 打赏
  • 举报
回复
出的什么错

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧