Retrieve Items From the Collection

Visual LANSA

Retrieve Items From the Collection

When the selected employees are dragged to the other form, the DragOver event of the list on this form is used to test that the payload to be dropped is a list collection of alphas:

 

Evtroutine Handling(#Drop_List.DragOver) Acceptdrop(#AcceptDrop) Payload(#PayLoad)
If_Ref Com(#PayLoad) Is(*Instance_of #Prim_LCol<#Prim_alph>)
Set Com(#AcceptDrop) Value(True)
Else
Set Com(#AcceptDrop) Value(False)
Endif
Endroutine

 

Another list collection is defined in the DragDrop event of the list and then the payload is cast to the collection:

Define_Com Class(#Prim_LCOL<#Prim_ALPH>) Name(#PayLoadList) Reference(*Dynamic)

* Cast the payload as a list colelction of alphas ....
Set_Ref Com(#PayLoadList) To(*Dynamic #PayLoad)
 

The employees are retrieved from the collection to the list in a FOR/ENDFOR loop:

For Each(#EmployeeNumber) In(#PayLoadList)
Change Field(#EMPNO) To('#EMPLOYEENUMBER.VALUE')
Add_Entry To_List(#DROP_LIST)
Endfor

 

Ý List Collection Example 1