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
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  
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  
Your code won't work because you're not making copies of the List(Of Integer) objects. Your code holds references to 12 seperate List(Of) objects, and when you use Array.Copy or Array.Clone, you are copying the references to those Lists, not the values in them. So, you now have two arrays with references to the same 12 Lists. Any changes you make in one array will be seen in the seconds array because they both point to the exact same objects.
 
    ' Setup source array of Lists.
    Dim originalLists(3, 4) As List(Of Integer)
 
    For i = 0 To 3
        For j = 0 To 4
            originalLists(i, j) = New List(Of Integer) From {1, 2, 3}
        Next
    Next
 
    ' Now make copies of the original Lists.
    Dim copyLists(3, 4) As List(Of Integer)
 
    For i = 0 To 3
        For j = 0 To 4
            copyLists(i, j) = New List(Of Integer)
            copyLists(i, j).AddRange(originalLists(i, j))
        Next
    Next

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  
AnswerRe: I used to love VB6 PinmemberAlpherattz16:28 17 Feb '12  
QuestionIncluding domain admin/password in script - how to avoid? Pinmembercharlieg8:17 16 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