|
-
Oct 3rd, 2000, 04:43 PM
#1
Thread Starter
Frenzied Member
Hi,
How would I delcare and use a multi-dimension array?
I know how to use a single dimension:
Code:
Dim sArray() as string
sArray(0) = "Hello World!"
MsgBox sArray(0)
But what I would like to do is something like:
"Hello Dan" or "Hello John", etc... How would you declare this array and how would you call out the location of the array to get Dan or John?
Any help would be appreciated..
DAn
Dan
-
Oct 3rd, 2000, 04:53 PM
#2
Like this:
Code:
Dim sArray(2, 2) As String
Then you can store things like this
Code:
sArray(0, 0) = "Hello John"
sArray(2, 1) = "Hello Dan"
sArray(0, 2) = "Hello Jane"
etc.
-
Oct 3rd, 2000, 05:40 PM
#3
Member
or
Dim Stuff(0 to X, 0 to Y) as WHATEVER
where x and y are integers and whatever is variable type
-
Oct 3rd, 2000, 05:57 PM
#4
Hyperactive Member
If I understand you correctly
I don't think you are after a multi-dimensioned array. If you are, then the previous posts have answered that for you.
I think you want two arrays. One for names, and one for salutations perhaps.
Names
Dan
John
...
Salutations
Hello
Gidday
Bye
Ciao
...
If you actually want every combination possible to be stored in an array - Then this is when a multi-dimensional array would be of use to you because then you will be able to get to any combination by knowing the index number of the name and of the salutation (i.e. the order you filled the array in).
Post back if you need more help and someone will clarify...
Regards
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
|