Add Items to the Collection

Visual LANSA

Add Items to the Collection

A menu item is added to the MENU_ITEMS collection when an employee in the list is selected:

 

Evtroutine Handling(#LTVW_1.ItemGotSelection) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
* Create submenu item if it doesn't already exist
If_Ref Com(#Sub_menu) Is(*null)
Set_Ref Com(#Sub_menu) To(*create_as #prim_smnu)
Set Com(#Sub_menu) Parent(#menu_title)
Endif
 
* Create menu item based on the employee details
Set_Ref Com(#menu_items<#empno>) To(*create_as #prim_mitm)
 
* Define menu item's text
Use Builtin(BCONCAT) With_Args(#EMPNO #GIVENAME #SURNAME) To_Get(#STD_TEXTL)
* Set menu item's properties
Set Com(#menu_items<#empno>) Caption(#std_textl) Parent(#Sub_menu)
Endroutine

 

Ý Example 4: Collection of Menu Items