An Array can hold items of any class. It is indexed by an
Integer and the initial index is zero.
The create function is used to create an Array
to hold six elements
(create Array 6)
Following creation, each element of the array has a value of the
empty List ().
| property name | property type | description |
|---|---|---|
length |
Integer | the number of items the array can hold |
| method name | description |
|---|---|
set |
set an element within the array |
get |
get an element from the array |
extend |
extend the array so that it can hold more items |
list |
get a list representation of the array |
setSet an element within the array. Note: the initial index is zero not one.
Arguments:
| index | Integer |
| value | Object |
Return type: the empty List ()
getGet an element from the array. Note: the initial index is zero not one.
Arguments:
| index | Integer |
Return type: Object
extendExtend the array so that it can hold more items. The size is grown so that the supplied index is valid.
Arguments:
| newIndex | Integer |
Return type: the empty List ()
listGet a list representation of the array.
Arguments: none
Return type: the empty List ()
| Contents | Index | Current topic: objects | Related links: built-in objects |