Alan,
Ofcourse they are not technically identical, though as demonstrated they
may appear to be practically identical)
the way you type depends on performance vs flexibility.
performance loss can be VERY marginal.
dim x() creates a SAFEARRAY memory structure
dim x creates a VARIANT (which can SUBSEQUENTLY be pointed to a
safearray)
in the call of SafeArrayCreate the VARTYPE of the array must be set,
although it's boundaries can be assigned later with a redim.
Sub foo()
Dim x(), y
ReDim x(3)
y = x
Application.VBE.Windows("Locals").Visible = True
'x's type is Variant(0 to 3)
'y's type is Variant/Variant(0 to 3)
Stop
ReDim y(3) As Long
Stop
End Sub
HTH
--
keepITcool
|
www.XLsupport.com | keepITcool chello nl | amsterdam
Alan Beban wrote in message
:
So however nimble the "underlying structure of the storage" analysis may
be, from the errors thrown above it seems abundantly clear that the two
constructs are not technically identical and that MyArray1() and
MyArray2() are true Variant() arrays and not Variant variables
containing arrays (if they were the latter, then, as demonstrated above,
there would be no such errors).
Alan Beban