User`s guide

Utility Library Classes
Parameters.
Argument Type Description
varDims Variant
Optional array of
dimensions
varFieldNames Variant
Optional array of field
names
Return Value. None.
Remarks. When created, an
MWStruct object has a dimensionality of 1-by-1
and no field s. The
Initialize method dimensions the array and adds a set of
named fields to each element . Each time you call
Initialize on the same
object, it is redimensioned. If you do not supply the
varDims argument, the
existing number and size of the array’s dimensions unchanged. If you do not
supply the
varFieldNames argument, the existing list of fields is not changed.
Calling
Initialize with no arguments leaves the array unchanged.
Example. The following Visual Basic code illustrates use of the
Initialize
method to dimension struct arrays:
Sub foo ()
Dim x As MWStruct
Dim y As MWStruct
On Error Goto Handle_Error
'Create 1X1 struct arrays with no fields for x, and y
Set x = new MWStruct
Set y = new MWStruct
'Initialize x to be 2X2 with fields "red", "green", and "blue"
Call x.Initialize(Array(2,2), Array("red", "green", "blue"))
'Initialize y to be 1X5 with fields "name" and "age"
Call y.Initialize(5, Array("name", "age"))
'Re-dimension x to be 3X3 with the same field names
Call x.Initialize(Array(3,3))
'Add a new field to y
C-17