List::merge Method [AX 2012]
Combines two lists to create a new list.
client server public static List merge(List list1, List list2)
Run On
CalledParameters
- list1
- Type: List Class
The first list.
- list2
- Type: List Class
The list that will be added to the end of the first to create the new list.
The following example creates two lists of integer values, merges them to create a new list, and then prints out the values in the new combined list.
{
List list1 = new List(Types::Integer);
List list2 = new List(Types::Integer);
List combinedList = new List(Types::Integer);
int i;
for(i=1; i<6; i++)
{
List1.addEnd(i);
}
for(i=6; i<11; i++)
{
List2.addEnd(i);
}
combinedList = List::merge(list1, list2);
print combinedList.toString();
pause;
}
Show: