User`s guide
D Utility Library
D-20
Index1(1) = 1
Index1(2) = 1
Index2(1) = 3
Index2(2) = 2
x(Index1, Index2, 2, "red") = 0.5
The last statement resolves to:
x(1, 1, 3, 2, 2, "red") = 0.5
• The field name must be the last index in the list. The following statement
produces an error:
y = x("blue", 1, 2)
• Field names are case sensitive.
Property NumberOfFields As Long
The read-only NumberOfFields property returns the number of fields in the
structure array.
Property NumberOfDims As Long
The read-only NumberOfDims property returns the number of dimensions in the
struct array.
Property Dims As Variant
The read-only Dims property returns an array of length NumberOfDims that
contains the size of each dimension of the struct array.
Property FieldNames As Variant
The read-only FieldNames property returns an array of length NumberOfFields
that contains the field names of the elements of the structure array.
Example. The next Visual Basic code sample illustrates how to access a
two-dimensional structure array’s fields when the field names and dimension
sizes are not known in advance.
Sub foo ()
Dim x As MWStruct
Dim Dims as Variant
Dim FieldNames As Variant