G
Guest
Hi all, I wrote this sample code :
Private Sub Button1_Click( ..... ) Handles Button1.Click
Dim x As New ArrayList
x.Add(1)
x.Add(1)
TestArrayList(x)
MsgBox("TestArrayList : " & x.Count.ToString)
End Sub
Private Sub TestArrayList(ByVal lst As ArrayList)
lst.Add(1)
lst.Add(1)
lst.Add(1)
End Sub
When I wrote it, I was sure to see in the message box that the ArrayList
have 2 items, because TestArrayList use the "lst" parameter ByVal. But, when
I ran that, I saw in the message box that the arraylist have 5 items....
Can you explain me what append here ?
Thanks a lot
Michel
Private Sub Button1_Click( ..... ) Handles Button1.Click
Dim x As New ArrayList
x.Add(1)
x.Add(1)
TestArrayList(x)
MsgBox("TestArrayList : " & x.Count.ToString)
End Sub
Private Sub TestArrayList(ByVal lst As ArrayList)
lst.Add(1)
lst.Add(1)
lst.Add(1)
End Sub
When I wrote it, I was sure to see in the message box that the ArrayList
have 2 items, because TestArrayList use the "lst" parameter ByVal. But, when
I ran that, I saw in the message box that the arraylist have 5 items....
Can you explain me what append here ?
Thanks a lot
Michel