New topic: 

Array inside a class?

<http://forums.realsoftware.com/viewtopic.php?t=32153>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       anode           Post subject: Array inside a class?Posted: Sat 
Jan 23, 2010 9:33 am                        
Joined: Sat Feb 09, 2008 12:21 pm
Posts: 24              Can I declare an array as a class property?
ie:
pseudo code:

Class bob:
 Dim name as string
 Dim phone(-1) as string
End class

I get an out of bounds error at run time.  I tried hard coding a 
bob(ct).phone(0) = "blah" with same error.  The '(ct)' isn't the prob since the 
rest of the class works fine and value of ct is correct.

Do I need to declare it with a definite size? ie: Dim phone(5) as string?
(that can toss a wrench in the works)

edit:
declaring the size of the array seemed to fix the prob.     
_________________
----
Mac OSX 10.6 RB2009r5  Codin' for fun  
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
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]

Reply via email to