Multi-dimensional arrays

campbdy
02-04-2004, 08:04 AM
Please help.

I have created a multi-dimensional array, comprising 3 rows, with each row having 180 elements, as follows:-

Dim ret (2, 179) As Double

I am trying to populate the three rows of this array, with 3 other existing arrays, and have tried every variation of code to do so and can't get it to work. Can any one advise how to do this. I currently have the following as the code to populate this array.

ret(0) = array1 'array1 is existing array of doubles
ret(1) = array2 'array 2 is existing array of doubles
ret(2) = array3 'array3 is existing array of doubles

I keep getting the following error message "no of indices is less than the number of dimensions of the indexed array". I can see what this message is getting at, as I don't specify something like ret(0, x) = array1, but I have specifically not put this, as this is to insert a single value at position x, which I don't want to do - I want to populate the whole of each row with the array.

Hopefully you can understand what I am trying to do and can help.

Cheers
Diane

Iceplug
02-04-2004, 09:08 AM
Well, you can't use a multidimensional array directly as an array of arrays.
You may be able to make a Structure for a Double Array.

Public Structure DoubleArray
Public Elements() As Double
End Structure

And then you can declare an array of these doublearrays.
:)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum