D
Dirk Goldgar
vanderghast said:A Variant can hold a string and an array of string. The problem is...like
once Jim Ferguson said, is that "who tells you VB is logical?" (and he was
an active defender of VB)
The first part is standard poutine, but the second part is a case of as
"logical as VB can be" (not to denigrate VB, in general, though)
Dim v() As Variant
ReDim v(0 To 1) As Variant
v(0) = "1 2 3 4" ' String
v(1) = Split(v(0), " ") ' array of strings
Dim q As Variant
Dim w() As Variant
Dim z() As String
q = Array("one", "two", "three")
w = q
' z = q ' line c2
q = Split(v(0), " ")
' w = q ' line c1
z = q
About the second part.
As it is, w( ) as Variant accept an array of string returned by Array, but
not by Split.
I believe that the Array() function returns a Variant containing an array of
Variant, not of String, even if all the arguments to the function are
strings. That explains the behavior you have documented.