95se5m
Member
How do you assign a default value to an array when defining the array variable?
Eg. Dim arySomething as String() = ""
Obviously this does not work.
However in VB.NET 2005 beta 1 which I am using to make sure my apps will be complient with VB.NET 2005 when it is released, it states the following...
Warning 1 Variable 'arySomething' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Development\SomeApp\Main\Modules\mController.vb 64 16
Any Thoughts? Or am I being a goof. I never thought to assign an array a default value till now so I never learned the way to do it.
Eg. Dim arySomething as String() = ""
Obviously this does not work.
However in VB.NET 2005 beta 1 which I am using to make sure my apps will be complient with VB.NET 2005 when it is released, it states the following...
Warning 1 Variable 'arySomething' is used before it has been assigned a value. A null reference exception could result at runtime. C:\Development\SomeApp\Main\Modules\mController.vb 64 16
Any Thoughts? Or am I being a goof. I never thought to assign an array a default value till now so I never learned the way to do it.