|
-
Aug 18th, 2003, 03:45 PM
#1
Thread Starter
Lively Member
Using an array like a variable
Is it possible to pull something out of only one spot of a dimensional array?
-
Aug 18th, 2003, 03:52 PM
#2
Lively Member
Re: Using an array like a variable
Is it possible to pull something out of only one spot of a dimensional array?
I don't understand the question.
Maybe you are searching for the Array.CopyTo() method.
Bye!
-
Aug 18th, 2003, 03:58 PM
#3
Thread Starter
Lively Member
Say my array is this:
0|0
1|1
2|2
3|3
How can i get just the bolded strings?
-
Aug 18th, 2003, 03:58 PM
#4
?
VB Code:
dim item as object=myarray(0)
-
Aug 18th, 2003, 04:06 PM
#5
Thread Starter
Lively Member
Thats how you get the first one, right?
-
Aug 18th, 2003, 04:08 PM
#6
Originally posted by Azkar
Thats how you get the first one, right?
Use variables, let it on the fly pick which 1 you want, then use MyArray(N)
-
Aug 18th, 2003, 04:08 PM
#7
Yes that will retrieve the first element in a zero based array (all arrays are by default zero based).
To retrieve the next one:
VB Code:
MessageBox.Show(myarray(1).ToString)
-
Aug 18th, 2003, 04:16 PM
#8
Thread Starter
Lively Member
AHHHH i got it, thanks
-
Aug 18th, 2003, 04:28 PM
#9
Thread Starter
Lively Member
Hmmm, i cant have a 4 dimintional array?
-
Aug 18th, 2003, 05:27 PM
#10
Sleep mode
-
Aug 18th, 2003, 10:19 PM
#11
Hyperactive Member
Originally posted by Pirate
Four dimentional array :
Umm, that would be a 2 dimensional array!
Unless I'm wrong, here's how it is:
Dim Ary(1) As String - 1 dimensional (imagine each element as a point on a line)
Dim Ary(2,3) As String - 2 dimensional (imagine each element as a point on a square grid)
Dim Ary(4,5,6) As String - 3 dimensional (imagine each element as a point on a 3D cube grid)
Dim Ary(7,8,9,10) As String - 4 dimensional (a point on a cube grid at a specific time?)
The number of dimensions an array contains has nothing to do with the number of elements each dimension contains.
Last edited by Hu Flung Dung; Aug 18th, 2003 at 10:26 PM.
-
Aug 19th, 2003, 06:23 AM
#12
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
|