|
-
Aug 14th, 2000, 05:08 AM
#1
Thread Starter
Addicted Member
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
-
Aug 14th, 2000, 07:23 PM
#2
Fanatic Member
Are you using a FOR/NEXT loop?
Or is that a stupid Question?
DocZaf
{;->
-
Aug 14th, 2000, 08:07 PM
#3
Frenzied Member
yeah, populate it at runtime, use loops.
-
Aug 15th, 2000, 03:55 AM
#4
Thread Starter
Addicted Member
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
-
Aug 15th, 2000, 07:27 AM
#5
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 15th, 2000, 07:37 AM
#6
Thread Starter
Addicted Member
Cheers,
I have already done it now (all 2886 values!!!!). I will look into different ways of doing it though.
Thanks,
Shaun.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|