Click here to Skip to main content

Visual Basic

   

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
GeneralRe: Sending SMS PinmvpLuc Pattyn8:43 20 Feb '12  
GeneralRe: Sending SMS PinmemberMember 421173415:10 24 Feb '12  
QuestionCombo box in List box PinmemberPasan1484:38 18 Feb '12  
AnswerRe: Combo box in List box PinmvpDave Kreskowiak4:51 18 Feb '12  
AnswerRe: Combo box in List box PinmemberEddy Vluggen7:31 18 Feb '12  
GeneralRe: Combo box in List box PinmemberProEnggSoft15:47 18 Feb '12  
QuestionHow to copy a two-dimensional array of List(of integer) as value PinmemberAlex Casals4:02 18 Feb '12  
hello:
 
I am trying to copy one two-dimensional array to another. The elements of the arrays are list of integers.
 
I want to copy by value. I mean, I need to change the second array without changing the first one.
 
I have tried with both array.copy and array.clone
Dim myarray1(3, 4) As List(Of Integer)
 
        Dim myarray2(3, 4) As List(Of Integer)
        Dim mylist As New List(Of Integer)
        For i = 1 To 3
            mylist.Add(i)
        Next
        For i = 0 To 3
            For ii = 0 To 4
                myarray1(i, ii) = New List(Of Integer)
                myarray2(i, ii) = New List(Of Integer)
                myarray1(i, ii).AddRange(mylist)
            Next
        Next
        'Array.Copy(myarray1, myarray2, myarray1.Length)
        myarray2 = CType(myarray1.Clone, Global.System.Collections.Generic.List(Of Integer)(,))
 
        myarray2(2, 2).Clear()
 
In both cases, the original array (myarray1(2,2)) is changed too.
I want the first array (myarra1) stay unchanged.
 
Any sugestion appreciated.
 
Greetings,
 
Alex
AnswerRe: How to copy a two-dimensional array of List(of integer) as value PinmvpLuc Pattyn4:17 18 Feb '12  
AnswerRe: How to copy a two-dimensional array of List(of integer) as value PinmvpDave Kreskowiak4:31 18 Feb '12  
GeneralRe: How to copy a two-dimensional array of List(of integer) as value PinmemberAlex Casals6:12 18 Feb '12  
GeneralRe: How to copy a two-dimensional array of List(of integer) as value PinmvpDave Kreskowiak6:32 18 Feb '12  
QuestionTree List Double Click Event PinmemberAlpherattz16:16 17 Feb '12  
AnswerRe: Tree List Double Click Event PinmvpDave Kreskowiak17:16 17 Feb '12  
AnswerRe: Tree List Double Click Event PinmemberEddy Vluggen2:41 18 Feb '12  
AnswerRe: Tree List Double Click Event (new) PinmemberProEnggSoft16:30 18 Feb '12  
QuestionRe: Tree List Double Click Event (new) [modified] PinmemberAlpherattz20:09 19 Feb '12  
AnswerRe: Tree List Double Click Event (new) PinmemberProEnggSoft20:38 19 Feb '12  
AnswerRe: Tree List Double Click Event (new) PinmemberAlpherattz21:35 19 Feb '12  
AnswerRe: Tree List Double Click Event (new) PinmemberProEnggSoft21:55 19 Feb '12  
AnswerRe: Tree List Double Click Event (new) PinmemberAlpherattz22:03 19 Feb '12  
GeneralRe: Tree List Double Click Event (new) PinmemberProEnggSoft22:09 19 Feb '12  
Questionhow to make slide puzzle game with VB 6.0 Pinmembergoteku2:38 17 Feb '12  
AnswerRe: how to make slide puzzle game with VB 6.0 PinmemberSimon_Whale3:14 17 Feb '12  
AnswerRe: how to make slide puzzle game with VB 6.0 PinmvpDave Kreskowiak3:57 17 Feb '12  
GeneralI used to love VB6 PinmemberMacRaider42:24 17 Feb '12  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Beta | 2.5.120517.1 | Last Updated 22 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid