This example shows how to use a list collection to drag and drop items from one form to another.
List collections provide an ordered collection of components. List collection components are positional in reference to a given index or to the beginning or end of the list. Indexing is always relative to 1.
In this example employee number and salary information for selected employees is stored in a list collection at the start of a drag and drop operation and at the end of the operation this information is retrieved from the collection to the other form.

Define the Collection
The list collection is defined dynamically in the StartDrag event of the list of employees.  In this way the scope of the list collection is limited to the drag operation. The #Employee_Number variable is created to store employee numbers of selected employees. Because the collection is dynamic, it has to be explicitly created with a SET_REF command:
Define_Com Class(#Prim_LCOL<#Prim_ALPH>) Name(#PayLoadList) Reference(*Dynamic)
Define_Com Class(#Prim_ALPH) Name(#EmployeeNumber) Reference(*Dynamic)
Set_Ref Com(#PayLoadList) To(*Create_as #Prim_LCOL<#Prim_ALPH>)
Add Items to the Collection
Selected employees are added to the collection in a SELECTLIST loop. The #Employee_Number variable is assigned the employee number of selected employees and then used to identify the item added in the INSERT method to the collection. The list collection is then assigned as the payload or the drag and drop operation:
 
Selectlist Named(#DRAG_LIST)
Continue If('#Drag_List.Currentitem.Selected *ne True')
Set_Ref Com(#EmployeeNumber) To(*Create_as #Prim_ALPH)
Set Com(#EmployeeNumber) Value(#EmpNo)
Invoke Method(#PayLoadList.Insert) Item(#EmployeeNumber)
Endselect
Set_Ref Com(#PayLoad) To(#PayLoadList)
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)