New topic: 

Dimension Multi-Dimensional Array[Solved]

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

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        eugenedakin          Post subject: Dimension Multi-Dimensional 
Array[Solved]Posted: Wed Dec 19, 2012 11:48 am                         
Joined: Mon Jan 02, 2006 11:43 am
Posts: 148
Location: Calgary, Alberta, Canada                Hello Everyone, 

How do I make a multidimensional array with nothing in it. As an example, here 
is how to create a single array and append data.

Dim Array_Numbers() as Integer
Array_Numbers.Append 15


When I attempt to make a multi-dimensional array, a syntax error is being 
thrown. 
Dim Array_Numbers(,) as Integer
Array_Numbers.Append 15,5


The Language Reference has an example with a dimensioned array with elements 
defined. In this case I do not know how big the array needs to be. I am 
guessing I am missing something simple. This code is running a machine with 
Windows 8, Real Studio 2012 r2, on a Windows IDE.

Thanks for your help,

Eugene     

    Last edited by eugenedakin on Wed Dec 19, 2012 1:57 pm, edited 1 time in 
total.   
                             Top                doofus          Post subject: 
Re: Dimension Multi-Dimensional ArrayPosted: Wed Dec 19, 2012 12:34 pm          
                       
Joined: Thu Sep 10, 2009 2:50 am
Posts: 320
Location: Santa Cruz, CA, USA                For 2D and up you have to specific 
the bounds
dim boo(-1, -1) As integer

Append only works for 1D arrays. Instead redim the array and set it's values   
                             Top                doofus          Post subject: 
Re: Dimension Multi-Dimensional ArrayPosted: Wed Dec 19, 2012 12:44 pm          
                       
Joined: Thu Sep 10, 2009 2:50 am
Posts: 320
Location: Santa Cruz, CA, USA                eugenedakin wrote:In this case I 
do not know how big the array needs to be.

If you really can't pre-know the sizes use a different data structure. A 1D 
array of 1D arrays or a 1D array of classes or a class that acts like the 2D 
array you're after. What way are you intending to use this 2D array and 
'Append' to it?   
                             Top                eugenedakin          Post 
subject: Re: Dimension Multi-Dimensional ArrayPosted: Wed Dec 19, 2012 1:57 pm  
                       
Joined: Mon Jan 02, 2006 11:43 am
Posts: 148
Location: Calgary, Alberta, Canada                Hello, 

Here are a few examples where I am not sure of the size of the array: a) 
modifying a few columns of data in a database, b) reading a list from a text 
file, c) faster viewing of data once loaded, etc. 

Yes, there are many ways that I can create workarounds for this, and was just 
curious if there was a way to make a multi-dimension array without defining 
elements.

Ok my question is solved, there is nothing available at the moment. Thanks for 
your response.

Sincerely,

Eugene   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 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]

Reply via email to