Description
Creates a new Array object using the default Array length (0).
Timing Precision Mode
This page describes functionality in nanosecond timing precision mode.
Constructor Signature
Syntax
This example demonstrates how to construct a Array.
Array myArray;
myArray = {1, 2, 3};
// If no dimension is specified, the use of {} sets the number of
// elements to what the user has specified, in this case, to 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 another method for Array construction. This method may be more useful for changing individual elements in a Array where as Example 1 shows a method more suitable for creating an entire Array on one line.
Array myArray[10];
myArray[0] = 1;
myArray[1] = 2;
myArray[2] = 3;
// Note that in Millisecond mode, if no dimension is specified and
// the Array is constructed in this manner, it is automatically set
// to contain 10 elements. In Nanosecond mode, the dimension is not
// assigned a default value.
Report myArray, myArray.Dimension;
|
Output:
myArray =
Element
|
Output
|
0
|
1.000000000
|
1
|
2.000000000
|
2
|
3.000000000
|
3
|
0.000000000
|
4
|
0.000000000
|
5
|
0.000000000
|
6
|
0.000000000
|
7
|
0.000000000
|
8
|
0.000000000
|
9
|
0.000000000
|
myArray.Dimension = 10.00000000
|
This example demonstrates constructing a Array by assigning it to an existing Array.
Array myArray1;
myArray1 = {1, 2, 3};
Array myArray2;
myArray2 = myArray1;
// Note that in Millisecond mode, if no dimension is specified,
// the Array is automatically set to 10 elements.
Report myArray2, myArray1;
|
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
|
3
|
0.000000000
|
4
|
0.000000000
|
5
|
0.000000000
|
6
|
0.000000000
|
7
|
0.000000000
|
8
|
0.000000000
|
9
|
0.000000000
|
|
See also
Array Object
Matrix, Array, and Variable Math Guide
|