Page 8-10
Manipulating elements of a list
The PRG (programming) menu includes a LIST sub-menu with a number of
functions to manipulate elements of a list. With system flag 117 set to
CHOOSE boxes:
Item 1. ELEMENTS.. contains the following functions that can be used for the
manipulation of elements in lists:
List size
Function SIZE, from the PRG/LIST/ELEMENTS sub-menu, can be used to obtain
the size (also known as length) of the list, e.g.,
Extracting and inserting elements in a list
To extract elements of a list we use function GET, available in the PRG/LIST/
ELEMENTS sub-menu. The arguments of function GET are the list and the
number of the element you want to extract. To insert an element into a list use
function PUT (also available in the PRG/LST/ELEMENTS sub-menu). The
arguments of function PUT are the list, the position that one wants to replace,
and the value that will be replaced. Examples of applications of functions GET
and PUT are shown in the following screen: