-
Please see the following code:
Type typTmp
vntFldAry as Variant
End Type
Function One()
Dim typTmpTmp As typTmp
Dim varAry()
Dim x
ReDim varAry(1)
varAry(0) = "Field0"
varAry(1) = "Field1"
typTmpTmp.vntFldAry = varAry
x = Two(typTmpTmp)
End Function
Function Two(varAry As Variant)
Debug.Print UBound(varAry.vntFldAry,1)
End Function
The problem is when the Ubound function executes it gives me the following error:
"Compile Error: Expected Variable".
I would like to be able to see the lower and upper bounds of the internal array to the type without having to pass the size with it.
Does any one have an idea of how to do this?
Thank you in advance for you help and continued support. :cool:
------------------
David L. Baudais
Systems Analyst
-
The easiest way to fix this is to declare varAry as typTmp. You could also pass x = Two(typTmpTmp.vntFldAry) instead.
-
Thank you for your kind reply unfortunately this would defeat the purpose of passing arrays to functions and then I would have to pass each element separtatly instead of the whole type.
:)
------------------
David L. Baudais
Systems Analyst