Hi David,

First, remember that the "Array" statement creates a single dimensional array. Think of it as if the variable is a pointer to that single dimensional array. that's all it can do. So let's say you want to create an array containing names and addresses. You need to declare a two-dimensional array. For example:
Dim addresses(3, 4)
Think of the first dimension as how many rows you have to work with and the second dimension as how many columns in each row. The following is an example I just wrote up in the immediate mode window to demonstrate how this works.

Dim addresses(3, 4)
addresses(1, 1) = "John"
addresses(1, 2) = "John's street"
addresses(1, 3) = "John's town"
addresses(1, 4) = "John's postal code"
Dim johnsInfo : johnsInfo = 1
Print addresses(johnsInfo, 1)
John
Print addresses(johnsInfo, 2)
John's street
Print addresses(johnsInfo, 3)
John's town
Print addresses(johnsInfo, 4)
John's postal code

Hope this helps.
Tom

----- Original Message ----- From: "David" <[email protected]>


Thanks to all, who has helped me out with my array problems, recently. I am starting to get at it, by now. But I have some more questions. This time, as to making an array multi/dimentional.

First of all, I got this far (simplified sample):

dim X
X = Array( "Mister green",_
   "Mrs johnson",_
   "Baby blue" )

X(2) = "Name has been changed to mrs WhoEver"

So far, the one dimentional array works, OK.

Now, how can I make it so that each of the three names, in the first dimention, holds four 'sublines', in a second dimention? And how do I 'refer' to for instance 3rd point in dimention 1, 2nd point in dimention 2 - for reading/writing? Could anyone, please, show me how to do this?

Thanks alot"



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4714 (20091224) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Reply via email to