List Collection - ReplaceAt Method

Replace the instance at the specified position with a different object

Member of List Collection (PRIM_LCOL)

Parameters

Name Type Data Type Description
Result *Result (Optional) PRIM_OBJT Reference to the object that was replaced
Item *Input PRIM_OBJT Item to be replaced
Index *Input Integer Position of item to be replaced

Details

ReplaceAt replaces the item at the specified index.
 
Attempting to replace an item that does not exist will result in a run time error.

Example

Replacing the 4th item in the collection.
#ReplacedItem <= #Collection.ReplaceAt(#Object 4)

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020