Description
Creates a new Array object using the length specified by dimension.
Timing Precision Mode
This page describes functionality in millisecond timing precision mode.
Constructor Signature
Arguments
dimension
|
|
Description:
|
Dimension of the array
|
Valid Range:
|
dimension ≥ 0
|
Syntax
Array myArray1(myVariable1);
|
This example demonstrates one method for Array construction.
Array myArray[3];
myArray = {1, 2, 3};
Report myArray, myArray.Dimension;
|
Output:
myArray =
Element
|
Output
|
0
|
1.000000000
|
1
|
2.000000000
|
2
|
3.000000000
|
myArray.Dimension = 3.00000000
|
This example demonstrates a method for Array construction by setting each element of the Array individually.
Array myArray[5];
myArray[0] = 1;
myArray[1] = 2;
myArray[4] = 3;
// Although the dimension has been set to 5, this method allows one
// to set specific elements, or leave some elements empty.
Report myArray, myArray.Dimension;
|
Output:
myArray =
Element
|
Output
|
0
|
1.000000000
|
1
|
2.000000000
|
2
|
0.000000000
|
3
|
0.000000000
|
4
|
3.000000000
|
myArray.Dimension = 5.000000000
|
This example demonstrates constructing a Array by assigning it to an existing Array.
Array myArray1[3];
myArray1 = {1, 2, 3};
Array myArray2[3];
myArray2 = myArray1;
Report myArray1, myArray2;
|
Output:
myArray1 =
Element
|
Output
|
0
|
1.000000000
|
1
|
2.000000000
|
2
|
3.000000000
|
myArray2 =
Element
|
Output
|
0
|
1.000000000
|
1
|
2.000000000
|
2
|
3.000000000
|
|
See also
Array Object
Matrix, Array, and Variable Math Guide
|