If you use the number of dimensions of an array as a criterion, you can differentiate between single- and multidimensional arrays.
An array is called
The number of dimensions of an array must be specified during compilation. You can specify the size of the dimension directly or by any numerical expression.
Dim myArrayS As New String Dim myArrayF As New Float
Really multidimensional arrays:
Dim myArray As String[10, 5] ' → ERROR! New is missing Dim a2DArrayB As New String[10, C_MAX * 5] Dim a3DArray as New Integer[8, 8, 8] Dim myArray4 As New String[10, 5] *
An alternative to the last line is the following 2 lines:
Dim myArray4 As New String myArray4 = New String[10, 5] **
In both cases (1*) and (2*), the two dimensions are determined statically and cannot be changed at runtime!
Derived one-dimensional arrays:
Dim aLabels As New Label Dim aArrayComponents As New Components Dim aClassArray As New CDS ' Array whose elements are CDS objects of the class CDS
Derived multidimensional array:
Dim aLabels As New Label
Example 1 - Using a One-Dimensional Derived Array
The used array' aLabels' is on the one hand one-dimensional and on the other hand a derived array, because' Label' is a class.
 Public Sub btnShowLabels_Click()  Dim aLabels As New Label  Dim hControl As Control  Dim iCount As Integer   If aLabels <> ZERO And aLabels.Count = 0 Then  Message.Info("The array 'aLabels' exists - but is empty.")  Endif   For Each hControl In ME.Children  If Object.Type(hControl) = "Label" Then aLabels.Add(hControl)  Next ' hControl   For iCount = 0 To aLabels.Max  aLabels[iCount].Tag = Str(iCount)  Print "Label-Name = "; aLabels[iCount].Name;  Print " | Label-Text = "; aLabels[iCount].Text;  Print " | Label-Tag = "; aLabels[iCount].Tag  Next ' iCount   End ' btnShowLabels_Click()
Output in the IDE console:
Label-Name = lblCArray | Label-Text = LabelArrays | Label-Tag = 0 Label-Name = lblACaption | Label-Text = Demonstration Class ARRAY | Label-Tag = 1 Label-Name = lblMultiArray | Label-Text = Label1 | Label-Tag = 2 Label-Name = lblBArray | Label-Text = Class Array | Label-Tag = 3
In connection with investigations on the dimensions of multidimensional arrays, the virtual class array. bounds performs well, as the following example shows:
 Dim k As Integer  Dim a2DArray As New String[10, 5]   ' Static display of dimensions  Print "Dimension = "; a2DArray.Dim ' Number of dimensions  Print "Dimension 1 (Number of lines) = "; a2DArray.Bounds  Print "Dimension 2 (Number of columns) = "; a2DArray.Bounds   Print "Dimension = "; a2DArray.Dim  Print "DIM-Count = "; a2DArray.Bounds.Count ' Number of elements in the Bounds array   ' Dynamic display of the limits of the individual dimensions  For k = 0 To a2DArray.Bounds.Count - 1  Print "Dimension "; k + 1; " = "; a2DArray.Bounds[k]  Next
Output in the IDE console:
Dimension = 2 Dimension 1 (Number of Lines) = 10 Dimension 2 (Number of columns) = 5 Dimension = 2 DIM-Count = 2 Dimension 1 = 10 Dimension 2 = 5
Excursion - Supplementary remarks on multidimensional arrays:
As far as point (3) is concerned, it is probably the most subtle of the three. Derived multidimensional arrays allow the creation of systems in which a dimension does not have to be equally extended in all dimensions - of which matrices are a special case - because that is exactly what has to apply.