Array Lists
- From: "unwantedspam" <unwantedspam@xxxxxxxxx>
- Date: 28 Nov 2005 16:10:14 -0800
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
.
- Follow-Ups:
- Re: Array Lists
- From: Bruce Barker
- Re: Array Lists
- From: Peter Rilling
- Re: Array Lists
- From: Ganesh Ramamurthy
- Re: Array Lists
- Prev by Date: Re: caching: Session state or Application state...
- Next by Date: Displaying the default fields from a DataSet, to the GridView
- Previous by thread: Do you use the new datasource controls?
- Next by thread: Re: Array Lists
- Index(es):