Set( ) method (Collections)
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Sets, or replaces, the element at the given position in the list with the
specified element. Returns the element previously at the position in the list
(before replacement). An error is raised if the index position is beyond the bounds
of the list (index < 1 or index > size
of list). The Unknown value (?) is returned if the
element at the given position has an invalid object reference.
Return type: T
Access: PUBLIC
Applies to: Progress.Collections.List<T> class
Syntax
|
- index
- The one-based position in the list of the element to set.
- element
- The element to be stored at the specified position in the
List<T>.
Example
For a code example showing Set(), see Progress.Collections.List<T> class.
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.
- When an object-oriented ABL object is removed from a collection, the reference count of the object is decremented so that garbage collection can occur when the application no longer references the object.