Home All Groups Group Topic Archive Search About

Test an Array to see if its been "ReDim"

Author
9 Feb 2006 7:57 PM
tm
I have created an array as follows:

Public pPrintList() as String

How can I test it to see if it has
been initialized with an element (ReDim pPrintList(12) )
with out causing "NullReferenceException" error
if no elements exist

Author
9 Feb 2006 8:17 PM
Mattias Sjögren
>How can I test it to see if it has
>been initialized with an element (ReDim pPrintList(12) )

If Not pPrintList Is Nothing Then ...


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.