Use an array of objects instead. You would create a class that has 5 properties that represent the columns. Then New the objects and add them to your singly-dimensioned array. Put this array in another class (a 'wrapper' class) that provides a method that 'looks like' an accessor for a doubly-dimensioned array. This approach is probably faster, and definitely more extendable. Plus, many of the useful array methods in RB only work with single-dimension arrays anyway. Multi-dimension arrays, IMHO, are only useful when all the data elements are the same type (such as for a bar graph, data plot, pie chart, etc...) and even then, implementing some of the 'dimensions' as objects in singly-dimensioned arrays is - for me anyway - preferable.

On Feb 15, 2007, at 2:01 PM, Octave Julien wrote:

Hi,

I'm using a method that analyses a text given as an argument and returns a two-dimensional array. This array has 5 columns, one filled with strings, two with integers, and three with booleans. The returned array is defined as an array of type variant. It works and returns an array with around 2000 rows from a text of 2 or 3 pages. But it is so slow ! It takes 6 or 7 seconds on my PowerBook G4 867 mHz, with 384 Mo. With the same sample text it used to work very fast with a function filling up 6 different one- dimensional arrays defined before calling the method and given as arguments. So my question is : is it slower because I'm using a multidimensional array, or because this array is defined with the variant type ? Or both ?
Thanks in advance.

Octave

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to