mark007 Posted July 19, 2005 Posted July 19, 2005 If I have 4 1 dimensional arrays each declared like: dim Array1(120) as Single Is there a faster way of combining them into 1 2-dimensional array declared: Dim ArrayAll(120,3) as Single other than looping through all 120*4 values? :) Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
Machaira Posted July 19, 2005 Posted July 19, 2005 I don't believe so. The mass copy functions work only if they target is the size # dimensions as the source. Quote Here's what I'm up to.
jmcilhinney Posted July 20, 2005 Posted July 20, 2005 I think you mean Array1(3, 120). A multidemensional array is actaully a matrix, not an array of arrays. If you still want to be able to consider your original arrays as objects after they are combined, what you actually want is a jagged array, i.e. ArrayAll(3)(120). In that case, ArrayAll is a 1-dimensional array with four elements, each of which is an Array. In the first case, ArrayAll is a 2-dimensional array with 484 elements, each of which is a Single. If you decide that the jagged array fits the criteria of what you are doing then you can simply assign each of the existing arrays to the four elements of the jagged array. If the 2-dimensional array is the better fit, you're stuck with copying one element at a time. Quote
mark007 Posted July 20, 2005 Author Posted July 20, 2005 Hmm, an array of array's like that might just work.... Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.