-
Hi,
I have a multi-dimensional array (3,24,37) that needs to be populated. Is there an easier way to do it than by doing it one at a time ie. a(1,1,1) = 25, a(1,1,2) = 36 etc... I dont want to use a database or anything external because I want the dll to be selfcontained.
Is there a way to use the Array function or does this only work with a single dimension array??
Thanks in advance
Shaun
-
Are you using a FOR/NEXT loop?
Or is that a stupid Question?
DocZaf
{;->
-
yeah, populate it at runtime, use loops. ;)
-
Sorry but I cant do that that. What it is going to be is a Function that takes a couple of parameters and then returns a number that is looked up in the array. This is then going to be compiled into a DLL as it needs to be included in a couple of programs. What I was looking for (if anybody knows how to do it) is a sort of 'READ' function where it reads data values and populates arrays in one go like there used to be in old BASIC ie:
Code:
For i = 1 to 10 then
read iData
myArray(i) = iData
Next i
Data 5,8,12,56,34,23,54,66,33,5
as this would be far easier than going:
Code:
MyArray(1,1,1) = 23
.....
MyArray(3,26,37) = 800
Any comments would be appreciated (even if it is to tell me that it can't be done a quick way!!)
Cheers, Shaun
-
I think you could have your data stored in a file, binary. You could write an app so that you can populate the array or you could do it directly in immediate window.
Code:
Dim ff as integer
ff=freefile
'To write
Open Filename for binary as ff
put #ff,, myarray
close ff
'To read
Open Filename for binary as ff
get #ff,, myarray
close ff
-
Cheers,
I have already done it now (all 2886 values!!!!). I will look into different ways of doing it though.
Thanks,
Shaun.