Cerebrus is right, Take a look at the error and at first glance it may look like it is encrypted but when it says that Object not set to Object reference. An Array is stored on the heap like any other object but the reference to the Array is stored on the stack. The stack holds primitive types of data like int, decimal, and even structures. The error tells you that you have your object but it can't be found. When you instantiate the Array then the stack will have a reference to the particular object or Array that is stored on the heap.
On Tue, Sep 23, 2008 at 12:42 PM, Paul <[EMAIL PROTECTED]> wrote: > Public Structure convertedCodes > Dim code As String > Dim field As *New* List(Of String) > End Structure > > > On Tue, Sep 23, 2008 at 9:35 AM, Andrew <[EMAIL PROTECTED]> wrote: > >> >> Hi, Im new to VB.net and am running into a small problem. >> >> I've created the following structure >> >> Public Structure convertedCodes >> Dim code As String >> Dim field As List(Of String) >> End Structure >> >> and I try to create an instance as follows: >> >> Dim temp As New convertedCodes >> temp.code = oldc.code >> temp.field.Add(oldc.field) >> >> and it crashes horribly! >> >> I get "Object reference not set to an instance of an object.", so I am >> assuming there is a real problem with creating lists in a structure, >> and anyone who could offer assistance, or a better approach would make >> my day. >> >> Cheers! >> -Andrew >> >> >> > > > -- > _______________________________ > > Take care, > Paul > > It is not we non-interventionists who are isolationists. The real > isolationists are those who impose sanctions and embargos on countries and > peoples across the globe and who choose to use force overseas to promote > democracy. A counterproductive approach that actually leads the U.S. to be > more resented and more isolated in the world. > > Dr. Ron Paul > > www.RonPaul2008.com > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://cm.megasolutions.net/forums/default.aspx -~----------~----~----~----~------~----~------~--~---
