G
Guest
Hello All,
Thank you in advance. I have a quick question about array lists. Why
does the following code give me the same results if I reference two
different elements?
Dim myList As New ArrayList
Dim test(9) As String
test(0) = "A"
test(1) = "B"
test(2) = "C"
test(3) = "D"
test(4) = "E"
test(5) = "F"
test(6) = "G"
test(7) = "H"
test(8) = "I"
test(9) = "J"
myList.Add(test)
test(0) = "1"
test(1) = "2"
test(2) = "3"
test(3) = "4"
test(4) = "5"
test(5) = "6"
test(6) = "7"
test(7) = "8"
test(8) = "9"
test(9) = "10"
myList.Add(test)
TextBox1.Text = myList(0)(4) '= 5 (Incorrect. Should = E)
TextBox1.Text = myList(1)(4) '= 5 (Correct)
Could you please explain what is happening?
Thank you
Thank you in advance. I have a quick question about array lists. Why
does the following code give me the same results if I reference two
different elements?
Dim myList As New ArrayList
Dim test(9) As String
test(0) = "A"
test(1) = "B"
test(2) = "C"
test(3) = "D"
test(4) = "E"
test(5) = "F"
test(6) = "G"
test(7) = "H"
test(8) = "I"
test(9) = "J"
myList.Add(test)
test(0) = "1"
test(1) = "2"
test(2) = "3"
test(3) = "4"
test(4) = "5"
test(5) = "6"
test(6) = "7"
test(7) = "8"
test(8) = "9"
test(9) = "10"
myList.Add(test)
TextBox1.Text = myList(0)(4) '= 5 (Incorrect. Should = E)
TextBox1.Text = myList(1)(4) '= 5 (Correct)
Could you please explain what is happening?
Thank you