-
I have got a big problem now.
In declaration section I have:
Type Foto
Picture() As IPicutreDisp 'or something like that
Descrip() as String
End Type
Some rows of a sub are:
ReDim Foto.Picture(Val(read))
ReDim Foto.Descrip(Val(read))
where the first line (picture) cause a error 'Invalid ReDim'. Where is the error? I need to leave a picture stored in a dynamic array.
------------------
Thanks,
John, 14 years old
-
Hi John,
What is the value of read when you get this error?
If you want to keep the info. already stored in your array when you Redim it, you must use Redim Preserve rather than Redim alone.
All the best.
Chris
-
Thank you for your answer.
The value of read is usually 1 to 3 or 5, no big numbers.
Preserve keyword cause the same error.
What should I do now?
-
Hi John,
the problem seems to be the type! Try this:
Code:
Type Foto
Picture() As IPicutreDisp 'or something like that
Descrip() as String
End Type
sub test
dim testvar as Foto
ReDim testvar.Picture(Val(read))
ReDim testvar.Descrip(Val(read))
end sub
Roger