Insert( ) method (Collections)
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Inserts a single element, or a collection of elements, at the specified position in the
List<T>. To insert at the end of the list, specify the
current size of the list plus one.
The element and all subsequent elements in the list are moved down to accommodate the added element(s). (This movement includes any unknown value entries).
Return type: VOID
Access: PUBLIC
Applies to: Progress.Collections.List<T> class
Syntax
|
- index
- The one-based index at which the element, or collection of elements, should be inserted. An error is raised if index is less than 1 or index is greater than the size of the list plus one.
- element
- The object to insert into the
List<T>. - otherCollection
- The collection that contains the elements to be inserted
into the
List<T>.
Notes
- Any iterators on the list become invalid once
Add(),AddAll(),Clear(),Insert(),Remove(),RemoveAt(), orSet()are called, and you must get a new iterator to iterate over the list. - When an object-oriented ABL object is added to a collection, the reference count of the object is incremented so that it is not garbage collected while it remains in the collection.
- For both
List<T>andSortedSet<T>,Insert()raises an error if otherCollection represents the same collection instance.