♦ Aztec supports any number of array levels, and each level can contain multiple dimensions. Multiple array levels are specified using “” syntax, and multiple dimensions within a single array level are shown using “[,,]”.
♦ Note that the Aztec Compiler and VM currently support just one array level AND the array size must be specified during definition (array brackets placed after the identifier as described below).
♦ It DOES currently support multiple dimensions within that one array level ( [10,10,10] ).
♦ Since the array size can only be defined during definition, the "new<>" keyword does not yet support dynamic array creation.
♦ Full array support as documented on this page will be added soon.
♦ The size of the first array level can optionally be specified to the compiler, and the VM will automatically set it up when the array object gets created. If the size is not provided, then the user must dynamically create the first level of the array at run-time.
♦ If size is specified during definition, brackets MUST be placed after the identifier name. If size is not specified at compile-time, brackets MUST be placed after the data type (within the “data<>” keyword).
♦ All array elements are accessed using ONE based index values.
♦ Syntax Examples
♦ Elements of SingleIntArray1 can be used immediately, the VM automatically creates the first array level with 100 ‘int’elements (and initializes them all to a value of 0).
♦ SingleIntArray2 must first allocate the array before it can access the individual elements (SingleIntArray2 = new<int>).
♦ Elements of the FIRST level of DoubleIntArray1 can be used immediately, the VM automatically creates the first array level with 200 ‘int’elements (10x20, and initializes them all to value of null, since each element is an int array).
♦ The second level of DoubleIntArray1 still must be dynamically allocated. Each element is an int array (each of which can have a different size), so each one of the elements must be separately allocated (DoubleIntArray1[1,1] = new<int>, etc.).
♦ Both levels of DoubleIntArray2 must be allocated. The first level can be created like (DoubleIntArray2 = new<int[100,200]>). Note the use of braces within the ‘new<>’ keyword and that the both dimensions within the first brace need to be allocated. Each element at second level will be allocated separately (DoubleIntArray1[1,1] = new<int>, etc.).
♦ An array element can be used as the base of an instance method.
♦ data<int> IntArray ; IntArray = 100 ; IntArray.Add(200)
♦ data<Thread> ThreadArray ;ThreadArray = GetThread() ; ThreadArray.Sleep(500)
♦ An array can be passed as an argument to a method. The data type definition of the argument must exactly match the number of array levels and number of dimensions within those levels to the array that is being passed in. The size of the array in the argument must be left empty, since the array being passed in determines that.
♦ An Aztec Array is also an object in and of itself, separate from the objects that it holds. There are some methods provided to operate on the array. For multiple array levels, these can be used at each level.