|
-
November 15th, 2009, 03:39 PM
#1
[RESOLVED] List of Lists?
I'm trying to make a list of flight plans loaded into my program, with each flight plan having a list of waypoints along the route, along with a few other properties associated with the flight plan. Each waypoint has its own associated properties, i.e. waypoint ID, waypoint type, location, etc.
Here's the declarations:
Code:
Public Class WPinfo
Public WPType As String
Public WPID As String
Public WPName As String
Public WPAltitude As Integer
End Class
Public Class FlightPlan
Public FileName As String
Public Waypoints As List(Of WPinfo)
End Class
Public FlightPlans As List(Of FlightPlan)
How do I implement the List methods to access the list elements, and add, remove, etc? The way I'm doing it now just gets me an 'Object reference not set to an instance of an object' error during runtime.
Thanks!
-
November 15th, 2009, 08:03 PM
#2
Re: List of Lists?
Solved this one myself...
-
November 16th, 2009, 04:36 AM
#3
Re: [RESOLVED] List of Lists?
Wat was the problem and how you resolved it?
-
November 18th, 2009, 09:11 PM
#4
Re: [RESOLVED] List of Lists?
I created a single new instance of my WPInfo called 'thisWP'. Every time I loaded in a waypoint, I put my converted info into thisWP, and then added thisWP to my waypoint list using the Add() method once I was done processing the info for the current waypoint. I am able to reference my flight plans and their waypoints using index references in the lists once I've actually added items to them. I kept trying to reference my lists and set values in them as if they were arrays before I had 'added' anything to them, which doesn't work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|