problems with String Array

mrand01
01-27-2004, 02:44 PM
Dim NumSlides As Integer = 0
Dim SlideArray() As String
SlideArray(NumSlides) = MyData 'Error breaks on this line
MessageBox.Show(SlideArray(NumSlides))


This code executes and I get this error on the 3rd line of that code:

"Object reference not set to an instance of an object."

Any ideas?

Csharp
01-27-2004, 02:52 PM
you need to initialize the array. eg:

Dim NumSlides As Integer = 0
Dim SlideArray(NumSlides) As String
SlideArray(NumSlides) = MyData
MessageBox.Show(SlideArray(NumSlides))

mrand01
01-27-2004, 02:54 PM
you need to initialize the array. eg:

Dim NumSlides As Integer = 0
Dim SlideArray(NumSlides) As String
SlideArray(NumSlides) = MyData
MessageBox.Show(SlideArray(NumSlides))


is this new for .NET or am I just stuck in Macromedia's world...?

Csharp
01-27-2004, 03:03 PM
there are many things which are very different in .NET , but once you get used to them you will see how great .NET is :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum