Re: arraylist copy



"Joseph MCAD" <anonymous@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb:
If you use the .Clone method then both arraylists will still point to the same objects. HTH

That is not true. 'Clone' will create a shallow copy of the arraylist:

\\\
Dim a1 As New ArrayList
Dim a2 As ArrayList = a1.Clone()
MsgBox(CStr(a1 Is a2))
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
.



Relevant Pages

  • arraylist - childmdifrm.Activate - how?
    ... Dim frm As frmEdit = CType, ... So I get the position of the record on the grid from the ... But I am using 2 arraylists. ... >from the grid and then invoke a childmdi form. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ArrayList - Newbie Misunderstanding
    ... Dim arrCats As New ArrayList ... In your loop, what is actually happening is that you are just setting and resetting the properties for the same fred object and adding multiple references to the same fred object to the arraylist. ... arraylists to an ArrayList in a Sessionso that I can persist ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Use a variable to call an arraylist
    ... Lee ... > It's obvious that I haven't had enough caffiene yet!! ... a set of data is read into these arraylists. ... >> Dim AL10 as New ArrayList ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help with sorting an Arraylist that contains Structures
    ... Googling "VB.NET list" came up with nothing but arraylists and listboxes. ... Dim myList as New List(Of TabStructure) ... Then I add "tab" to an arraylist. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Use a variable to call an arraylist
    ... Lee ... a set of data is read into these arraylists. ... > Dim AL10 as New ArrayList ...
    (microsoft.public.dotnet.languages.vb)