Struct.Array [v2.1-alpha.23+]

class Struct.Array extends Struct

Struct.Array is the base class for all structured arrays, which are fixed-size arrays with elements of a fixed type.

"Obj" is used below as a placeholder for any instance of the Struct.Array class.

In addition to the methods and properties inherited from Struct, struct arrays have the following predefined methods and properties.

Table of Contents

Properties

Length

Gets the length of the array.

Length := Obj.Length

__Item

Gets or sets the value of an array element.

Value := Obj[Index]
Value := Obj.__Item[Index]
Obj[Index] := Value
Obj.__Item[Index] := Value

Index is an integer representing a valid array index; that is, an integer with absolute value between 1 and Length (inclusive). A negative index can be used to address elements in reverse, so that -1 is the last element, -2 is the second last element, and so on. Attempting to use an index which is out of bounds (such as zero, or if its absolute value is greater than the Length of the array) is considered an error and will cause an IndexError to be thrown.

The property name __Item is typically omitted, as shown above, but is used when overriding the property.