Carapace

Array Class

An Array can hold items of any class. It is indexed by an Integer and the initial index is zero.

Array Creation

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 ().

Array Properties

property name property type description
length Integer the number of items the array can hold

Array Methods

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


set

Set an element within the array. Note: the initial index is zero not one.

Arguments:

indexInteger
valueObject

Return type: the empty List ()


get

Get an element from the array. Note: the initial index is zero not one.

Arguments:

indexInteger

Return type: Object


extend

Extend the array so that it can hold more items. The size is grown so that the supplied index is valid.

Arguments:

newIndexInteger

Return type: the empty List ()


list

Get a list representation of the array.

Arguments: none

Return type: the empty List ()


Contents Index Current topic: objects Related links: built-in objects