Adds an item to the end of a list.
ListAppend (lList, aElem)| Variable | Description |
|---|---|
| lList | A variable containing the list to append to. inout LIST. |
| aElem | The item to append to lList. Its type must be compatible with the list item’s type. ANYTYPE. |
ListAppend appends an item to an existing list. The list is modified by the call to ListAppend.
LIST OF STRING lsFruit = {} // create an empty list
ListAppend (lsFruit, "apples")
ListAppend (lsFruit, "oranges")
ListPrint (lsFruit)
// Prints:
// apples
// oranges