Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > problems with String Array


Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2004, 02:44 PM
mrand01 mrand01 is offline
Centurion
 
Join Date: Apr 2003
Posts: 130
Default problems with String Array


Code:
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?
Reply With Quote
  #2  
Old 01-27-2004, 02:52 PM
Csharp's Avatar
Csharp Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

you need to initialize the array. eg:
Code:
Dim NumSlides As Integer = 0 Dim SlideArray(NumSlides) As String SlideArray(NumSlides) = MyData MessageBox.Show(SlideArray(NumSlides))
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
  #3  
Old 01-27-2004, 02:54 PM
mrand01 mrand01 is offline
Centurion
 
Join Date: Apr 2003
Posts: 130
Default

Quote:
Originally Posted by Csharp
you need to initialize the array. eg:
Code:
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...?
Reply With Quote
  #4  
Old 01-27-2004, 03:03 PM
Csharp's Avatar
Csharp Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

there are many things which are very different in .NET , but once you get used to them you will see how great .NET is
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Standards and Practices loquin Tutors' Corner 10 07-28-2006 12:16 PM
Deleting a file in dat question ? murphys General 5 11-06-2002 08:34 PM
Loop to format file kingesk General 2 09-10-2000 05:01 PM
File format problem kingesk General 1 09-08-2000 04:52 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->