On Feb 15, 2007, at 20:01 UTC, Octave Julien wrote: > 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.
Yikes. You're giving up an awful lot of type-safety there, as well as making the computer work harder than it should have to. > 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. Plus, with that approach, you maintain type safety. I think that was a much better solution than your current approach. Alternatively, define a class that has these arrays as properties, and have your analysis method return an instance of this class. But quit using Variant -- that's a hack really only appropriate for cases where the type can't be known (for example, with the Dictionary class). You know your data types, so its use is not a good idea. > 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 ? Probably because of using Variant, though I wouldn't expect *that* much speed penalty. Could also have something to do with your code and how you're sizing the array. Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
