List is a type of data structure and collections, it can contain unlimited items, in x++, list can be created of several Types(specified in the Types base enum), the type must be specified on the declaration and it cannot be changed after the initialization.
There are some classes exists to enumerated and iterate the list object. ListIterator object has methods that can insert and deleted items from list, ListEnumeration cannot modify the list content.
List myList = new List(Types::Integer);
List myListString = new List(Types::String);
// add the element at the end of the list
// add the element at the start of the list
// If you want to insert the data at some specific index, then you need to make use of the listIterator class
// Iterator performs a midpoint
// insert at current position.
literator = new ListIterator(myListString);
// can provide some condition, i.e. if check etc
if (literator.value() == “First”)
listIterator.insert (“Between first and second”);