New topic: Dictionary of Arrays of some Class
<http://forums.realsoftware.com/viewtopic.php?t=47612> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message neonash7777 Post subject: Dictionary of Arrays of some ClassPosted: Tue Apr 16, 2013 2:52 pm Joined: Mon Nov 29, 2010 7:01 pm Posts: 436 I have a dictionary where the values are an array of a specific class. How do I cast a value of the dictionary to handle it as an array of the specific class? I know I can do d.value(key).isArray to tell that it is an array (which I already know). But how do I traverse the array? Thanks! Top timhare Post subject: Re: Dictionary of Arrays of some ClassPosted: Tue Apr 16, 2013 3:01 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 12234 Location: Portland, OR USA d.Value is a variant. You don't cast a variant. You either use it directly (for scalar types like string and integer) or you assign it to a variable of the appropriate type. dim a() as myClass = d.Value(key) for i = 0 to Ubound(a) .. next Top neonash7777 Post subject: Re: Dictionary of Arrays of some ClassPosted: Tue Apr 16, 2013 3:11 pm Joined: Mon Nov 29, 2010 7:01 pm Posts: 436 timhare wrote:d.Value is a variant. You don't cast a variant. You either use it directly (for scalar types like string and integer) or you assign it to a variable of the appropriate type. dim a() as myClass = d.Value(key) for i = 0 to Ubound(a) .. next I knew I was over complicating things, thanks! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 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]
