请教各位高手一个菜单遍历函数递归调用的问题,急!!!!!!!

wangqin7927 2005-08-13 04:15:34
以下是我写的代码,编译过了没有语法错误,但一运行时好像发生了逻辑错误,程序自动关闭。

string ls_role
string ls_char
string arr_char[]
long ll_i,ll_pos1,ll_pos2,ll_len
//根据角色取出字符串
select roles into:ls_role from operator where loginid=:gs_loginid;
select level into:ls_char from roles where name=:ls_role;
ll_i = 1
ll_len = len(ls_char)
ll_pos1 = 1
ll_pos2 = pos(ls_char,",",1)

do while ll_pos2 > 0
arr_char[ll_i] = mid(ls_char,ll_pos1, ll_pos2 - ll_pos1)
ll_i = ll_i + 1
ll_pos1 = ll_pos2 + 1
ll_pos2 = pos(ls_char,",",ll_pos1)
loop

arr_char[ll_i] = mid(ls_char,ll_pos1,ll_len - ll_pos1 + 1)

//根据取出的字符串付权

int curlevel
int sublevel
int i
int j
boolean access
curlevel=upperbound(m_file.item)

for i=1 to curlevel
sublevel=upperbound(m_file.item[i].item)
if sublevel>0 then
access=true
else
for j=1 to ll_i
if arr_char[j]=m_file.item[i].tag then
m_file.item[i].visible=true
m_file.item[i].toolbaritemvisible=true
end if
next
j++
end if
if access then
f_operatomenuright(m_file.item[i])
end if
next
i++
...全文
155 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
li_d_s 2005-08-18
  • 打赏
  • 举报
回复
这个只能跟踪了,代码分析太累了
flyerlxg 2005-08-13
  • 打赏
  • 举报
回复
单步调试一下看在什么地方跳出。

743

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 脚本语言
社区管理员
  • 脚本语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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