Home > database >  For j=1 to upperbound (im_main. Item [I] item) to make mistakes
For j=1 to upperbound (im_main. Item [I] item) to make mistakes

Time:09-29

For I=1 to upperbound (im_main. Item)
For j=1 to upperbound (im_main. Item [I] item)
If im_main. Item [I] item [j]. Journal of visible=true then
Ls_menuitem=im_main. Item [I] item [j]. Journal of text
When I was with pb9.0 edit script function, in this wrong, bother the warrior to solve

CodePudding user response:

What is wrong

CodePudding user response:

For j=1 to upperbound (im_main. Item [I] item)
The prompt "subscript expression is not an array"

CodePudding user response:

Upperbound is limit to obtain the data, so the parameter must be an array,

The following code is others, you look at someone else's usage,

I don't want to help everybody appreciate
The main window functions defined
Datastore lds_user//define the data storage
The integer I, j
String ls_menuitem, ls_ss

Im_main menuid=
Lds_user=create datastore//build data storage
Lds_user. Dataobject="d_qx_yh"
Lds_user. Settransobject (sqlca)
Lds_user. Retrieve ()
Lds_user. Setfilter (" user id='" + gs_user + "' "
Lds_user. Filter ()//filter out as_user user permissions

For I=1 to upperbound (im_main. Item)
For j=1 to upperbound (im_main. Item. Item)
If im_main. Item. Item [j]. Journal of visible=true then
Ls_menuitem=im_main. Item. Item [j]. Journal of text
If lds_user. Find (" name='" + ls_menuitem + "' ", 1, lds_user. Rowcount ()) & gt; 0 then
//if the user has the permission, the menu is available
Im_main. Item. Item [j] enabled=true
The else
//if the user does not have the permission, the menu is available
Im_main. Item. Item [j] enabled=false
End the if
End the if
Next
Next
Destroy lds_user//damage data store
Return 1

CodePudding user response:

Im_main. Item. Item [j] usage is wrong, the item [I]?
  • Related