请教各位高手一个菜单遍历函数递归调用的问题,急!!!!!!!
以下是我写的代码,编译过了没有语法错误,但一运行时好像发生了逻辑错误,程序自动关闭。
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++