New topic: array of classes
<http://forums.realsoftware.com/viewtopic.php?t=29371> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message Art Post subject: array of classesPosted: Mon Aug 03, 2009 9:19 pm Joined: Mon Sep 25, 2006 3:25 pm Posts: 235 How does one refer to an element of a class in an array? Suppose the class has ten elements, then what is the format? I know how to reference in multi-dimensional arrays of strings, but of classes it doesn't seem to be the same. I used the same basic format but it doesn't work. Top DaveS Post subject: Re: array of classesPosted: Mon Aug 03, 2009 9:25 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 1359 Location: San Diego, CA Dim classArray(-1) as MyClass classArray.Append new MyClass ClassArray(0).somemethod _________________ Dave Sisemore MacPro, RB2008r3.1 Top Jonathon Post subject: Re: array of classesPosted: Mon Aug 03, 2009 10:27 pm Joined: Fri Sep 30, 2005 5:54 pm Posts: 1877 Location: Great Falls, Montana USA Dave, DaveS wrote:Dim classArray(-1) as MyClass Question? Why the -1? Why not 0 instead? _________________ Jonathon Software Devlopement: http://www.medalertpc.com Surplus Hardware: http://www.semielectronics.com RB2005 R4 Pro for Windows XP Pro/SP2 Top npalardy Post subject: Re: array of classesPosted: Mon Aug 03, 2009 10:40 pm Joined: Sat Dec 24, 2005 8:18 pm Posts: 5142 Location: Canada, Alberta, Near Red Deer 0 is the Ubound so that would set aside an array with 1 element -1 means "create an empty array" _________________ My web site Great White Software RBLibrary.com REALbasic learning Top Jonathon Post subject: Re: array of classesPosted: Mon Aug 03, 2009 10:48 pm Joined: Fri Sep 30, 2005 5:54 pm Posts: 1877 Location: Great Falls, Montana USA npalardy wrote:0 is the Ubound so that would set aside an array with 1 element -1 means "create an empty array"Wow, thanks Norman as I didn't know, but I do now! _________________ Jonathon Software Devlopement: http://www.medalertpc.com Surplus Hardware: http://www.semielectronics.com RB2005 R4 Pro for Windows XP Pro/SP2 Top Art Post subject: Re: array of classesPosted: Tue Aug 04, 2009 5:02 am Joined: Mon Sep 25, 2006 3:25 pm Posts: 235 Thanks but what is the syntax for that element in an array of classes? Say MyClass has 10 elements classArray(154,8) doesn't work, since it isn't really a 2-D array. 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]
