Is it possible to pull something out of only one spot of a dimensional array?
Printable View
Is it possible to pull something out of only one spot of a dimensional array?
I don't understand the question.Quote:
Is it possible to pull something out of only one spot of a dimensional array?
Maybe you are searching for the Array.CopyTo() method.
Bye!
Say my array is this:
0|0
1|1
2|2
3|3
How can i get just the bolded strings?
?
VB Code:
dim item as object=myarray(0)
Thats how you get the first one, right?
Use variables, let it on the fly pick which 1 you want, then use MyArray(N)Quote:
Originally posted by Azkar
Thats how you get the first one, right?
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)
AHHHH i got it, thanks :)
Hmmm, i cant have a 4 dimintional array?
Four dimentional array :
VB Code:
Dim ary(3,3) As String
Umm, that would be a 2 dimensional array!Quote:
Originally posted by Pirate
Four dimentional array :
VB Code:
Dim ary(3,3) As String
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.
Oops . :o