arraylist copy
- From: "Sam" <samuel.berthelot@xxxxxxxx>
- Date: 8 Apr 2005 09:24:51 -0700
Hi,
I have the following code :
Dim rNodeList As New ArrayList
Dim rNodeListNew As New ArrayList
For iCntr As Integer = 0 To tvRelations.Nodes.Count - 1
rNodeList.Add(tvRelations.Nodes(iCntr).Text)
Next
rNodeListNew = rNodeList
rNodeList.RemoveAt(2)
after I've filled rNodeList, it contains 8 elements.
So does rNodeListNew
But when I remove the element 2 of rNodeList, it is also removed in
rNodeListNew. Why ? Do they both point to the same memory location ?
How can I prevent that in vb ?
Thx
.
- Follow-Ups:
- Re: arraylist copy
- From: Herfried K. Wagner [MVP]
- Re: arraylist copy
- From: Marcie Jones
- Re: arraylist copy
- From: Joseph MCAD
- Re: arraylist copy
- Prev by Date: RE: Dataview Find method, case insensitive?
- Next by Date: Serialization Performance
- Previous by thread: How do you force a thread to run on a specific processor?
- Next by thread: Re: arraylist copy
- Index(es):
Relevant Pages
|