Action
Inserts a new item into a list at any position.
Syntax
ListInsert (lList, iIndex, aItem)
Variable
|
Description
|
lList
|
A variable containing the list to modify. inout
LIST.
|
iIndex
|
The position at which to insert the item.
INTEGER.
|
aItem
|
The item to insert. Its type must be compatible with the other items in the list.
ANYTYPE.
|
Example
[-] LIST ls = {...}
[ ] "g"
[ ] "s"
[ ] ListInsert (ls, 2, "m") // inserts at 2nd position
[ ] Print (ls) // prints: {g, m, s}
[ ] ListInsert (1s, 1, "c")
[ ] Print (ls) // prints: {c, g, m, s}