CArray Class
The CArray class manages a 1-dimensional array of values. The class implements a traditional vector as a 1-dimensional array of (index, value) pairs. The values may be numbers, strings, or tables. The purpose of the CArray is to allow a set of values to be referenced using numeric indices like [1] or [10000].
A CArray may be sparse, meaning that there may be "holes" at indices where no value is defined. For example, you might define only one CArray member at index 10000. Being sparse, this CArray would store only that one value in memory, rather than 9999 empty indices before it. See also the CMatrix class and the CSet class.
Construction |
Object = new_array() Object = CArray:new() |
Destruction |
Object:delete() |
This function is normally used to create a new CArray object as an alternative to the class-based new method.
Creates a new instance of a CArray object. |
Creates a new instance of the CArray class. There are 3 constructor formats. |
|
Deletes the instance of the CArray object. |
|
Copies this CArray to a new CArray object. |
Returns the number of members actually initialized. |
|
Returns the dot product with another CArray. |
|
Empties the contents of the CArray but does not delete it. |
|
Returns true if a member exists at the index. |
|
Returns the member value at an array index. |
|
Initializes all members to a value. |
|
Returns the maximum member index. |
|
Removes the member at an index. |
|
Sets the member value at an index. |
Script Classes, CMatrix , CSet
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.