D
Dave Ramage
Here is a bit of code that hopefully demos what I'm after:
Dim strDemo() as String
Sub SUBA()
If MsgBox("Initialise?", vbYesNo) = vbYes then
ReDim strDemo(1)
strDemo(0) = "a"
strDemo(1) = "b"
End if
End Sub
Sub SUBB
If [has strDemo been initialised?] then
'do something
Else
'do something else
End If
End Sub
Question:
How can I check whether the dynamic array strDemo has been
ReDim'ed within SUBA? IsArray and Ubound seem to cause an
error if used with a non-initialised array. I guess I
could use error trapping as the answer but this seems a
bit clumsy!
Thanks for any help people can give...
Cheers,
Dave
Dim strDemo() as String
Sub SUBA()
If MsgBox("Initialise?", vbYesNo) = vbYes then
ReDim strDemo(1)
strDemo(0) = "a"
strDemo(1) = "b"
End if
End Sub
Sub SUBB
If [has strDemo been initialised?] then
'do something
Else
'do something else
End If
End Sub
Question:
How can I check whether the dynamic array strDemo has been
ReDim'ed within SUBA? IsArray and Ubound seem to cause an
error if used with a non-initialised array. I guess I
could use error trapping as the answer but this seems a
bit clumsy!
Thanks for any help people can give...
Cheers,
Dave