New topic: List of Arrays. Is it a 2D array?
<http://forums.realsoftware.com/viewtopic.php?t=32411> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message JustSomeGuy Post subject: List of Arrays. Is it a 2D array?Posted: Mon Feb 08, 2010 10:03 pm Joined: Fri May 11, 2007 11:35 am Posts: 752 I have a property that is an array of polygons. dim mPolygons(-1) As Polygon Now I need a list of these... How do I declare that in RB? if I can try to explain it this way... typedef Polygons as Polygon(-1) 'in psuedo code... dim PolyLists(-1) as Polygons 'in RB Am I explaining myself well enough? _________________ 6502 Assembler on Steroids Top kendoll Post subject: Re: List of Arrays. Is it a 2D array?Posted: Mon Feb 08, 2010 10:10 pm Joined: Mon Jul 17, 2006 10:39 am Posts: 1629 Sounds like you're trying to get a 2D array in RB. You declare one like this: Code:Dim mPolygons(-1,-1) As Polygon _________________ Kenneth McCleary [email protected] Top JustSomeGuy Post subject: Re: List of Arrays. Is it a 2D array?Posted: Mon Feb 08, 2010 10:19 pm Joined: Fri May 11, 2007 11:35 am Posts: 752 It really isn't a 2D array... I thought so myself at first but really its a list of polygons. where Polyset is a list Polygons where Polygons is a list of Polygon where Polygon is a list of Points where Points is a vector _________________ 6502 Assembler on Steroids Top brisance Post subject: Re: List of Arrays. Is it a 2D array?Posted: Mon Feb 08, 2010 11:30 pm Joined: Tue Oct 06, 2009 2:38 am Posts: 147 Maybe it would be good to implement the data structures as Dictionarys, except for Points. http://en.wikipedia.org/wiki/Associative_array _________________ HOWTO: RB Feedback Utility Top computerfreaker Post subject: Re: List of Arrays. Is it a 2D array?Posted: Mon Feb 08, 2010 11:33 pm Joined: Thu Mar 05, 2009 1:03 pm Posts: 1555 Location: USA Not sure I completely understand what you're trying to get, but this might do it. class Polygon Property SinglePoint() As Points class Polygons Property SinglePolygon() As Polygon class Polyset Property SinglePolygons() As Polygons() _________________ With great power comes great responsibility. Learn something new every day, and the rest will take care of itself. Life is a journey, not a destination. Enjoy the trip! Top JustSomeGuy Post subject: Re: List of Arrays. Is it a 2D array?Posted: Mon Feb 08, 2010 11:41 pm Joined: Fri May 11, 2007 11:35 am Posts: 752 Almost! class Polygon Property Points(-1) As Point class Polygons Property Polygons(-1) As Polygon class Polyset Property Polyset(-1) As Polygons _________________ 6502 Assembler on Steroids Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
