Extract Menu In PowerBuilder
Example Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | //==================================================================== // Function: w_main.wf_extract() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments: // value menu am_menu // value integer ai_from // value integer ai_level // value string as_parent //-------------------------------------------------------------------- // Returns: boolean //-------------------------------------------------------------------- // Usage: w_main.wf_extract() //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_text, ls_code Integer li_loop, li_count Long ll_row li_count = UpperBound(am_menu.Item[]) For li_loop = ai_from To li_count ls_code = as_parent + String(li_loop,"00") ls_text = am_menu.Item[li_loop].Text ll_row = dw_menu.InsertRow(0) dw_menu.SetItem(ll_row,"menu_id", ls_code) dw_menu.SetItem(ll_row,"label_menu", ls_text) dw_menu.SetItem(ll_row,"level_id", ai_level) dw_menu.SetItem(ll_row,"parent_id", as_parent) wf_extract(am_menu.Item[li_loop],1, ai_level + 1, ls_code) Next Return True |
Find Projects On Github click here
Good Luck!