List Statements
Note
While this section is up-to-date and complete, it has to be reformated to be easier on the eyes. All UPPERCASE statement names and code should be changed to lowercase.
PUSH _ TO _
The PUSH - TO
statement is used to add elements to a LIST. When you push an element to a LIST it is appended at the end of the list.
Syntax:
1 2 |
|
Example:
1 2 3 4 5 |
|
In the above example, foo
now contains the value "First index"
at index 0
and the value "Second index"
at index 1
.
CLEAR
The CLEAR
statement empties a LIST, thus deleting all its contents. The LIST itself is not deleted though, and can still be used and filled with new elements after a CLEAR
statement has been executed.
Syntax:
1 |
|
COPY _ TO _
The COPY - TO
statement copies all the elements of a LIST with their respective indices to another LIST of the same type. The original LIST is untouched, but the destination LIST is completely overwritten by the contents of the copied LIST and any elements that existed in it prior to the copy are deleted. In other words, the destination LIST is CLEAR
ed before the copy.
Syntax:
1 2 |
|
Example:
1 2 3 4 5 6 7 8 9 |
|
GET LENGTH OF _ IN _
The GET LENGTH OF - IN
statement stores the amount of elements stored in a LIST (or, analogously, the length of the LIST) into a numeric variable.
Syntax:
1 |
|
Example:
1 2 3 4 5 6 7 8 9 |
|
DELETE LAST ELEMENT OF _
The DELETE LAST ELEMENT OF
deletes the last element pushed to a LIST. If the LIST was empty, this statement does nothing.
Syntax:
1 |
|
REMOVE ELEMENT AT _ FROM _
The REMOVE ELEMENT AT - FROM
statement deletes the element at the specified index from a LIST. If the index is out of bounds, this statement does nothing.
Syntax:
1 |
|
Example:
1 2 3 4 5 6 7 8 |
|