locked
Array of Array equal Array RRS feed

  • Question

  • User783916550 posted

    Hi, i am here now because i was trying to do something, and until now, i have not suceed.

    If anyone know, i apreciate.

    What i want is:

    we are calling ArrayA, ArrayB, ArrayS for arrays

    I want to put a ArrayA into ArrayB.

    And then put ArrayB into ArrayS.

    And when i need, i want to put ArrayS,B,A into ArrayA

    Can you understand me?

    I can't....

    Here is a little of my code.

    Private SaveAll(3) as Object      ' ArrayS
    Private SaveTab() as String
    Private SavePics() as Object       'ArrayB
    Private SavePoint() as Object
    
    Private TablePics() as String      'ArrayA
    Private TablePoint() as String
    
    
    'Load:
    
     ReDim SaveTab(TabControl1.TabPages.Count)
            ReDim SavePics(TabControl1.TabPages.Count)
            ReDim SavePoint(TabControl1.TabPages.Count)
            For count As Integer = 0 To TabControl1.TabPages.Count - 1
                SaveTab(count) = TabControl1.TabPages(count).Text
                'If TabControl1.SelectedTab.Text = TabControl1.TabPages(count).Text Then SavePics(count) = TablePics
                'If TabControl1.SelectedTab.Text = TabControl1.TabPages(count).Text Then SavePoint(count) = TablePoint
                SavePics(count) = TablePics
                SavePoint(count) = TablePoint
            Next
            SaveAll(0) = SaveTab
    SaveAll(1) = SavePics
      SaveAll(2) = SavePoint 'Save: For count As Integer = 0 To TabControl1.TabPages.Count - 1 If TabControl1.SelectedTab.Text = TabControl1.TabPages(count).Text Then SavePics(count) = TablePics SavePoint(count) = TablePoint End If Next SaveAll(1) = SavePics SaveAll(2) = SavePoint 'TabChange: For count As Integer = 0 To TabControl1.TabPages.Count - 1 If TabControl1.SelectedTab.Text = TabControl1.TabPages(count).Text Then Erase TablePics TablePics = SavePics(count) Erase TablePoint TablePoint = SavePoint(count) End IF Next

    Thursday, September 8, 2011 6:14 AM

All replies

  • User699558600 posted

    your requirement is not clear but just to tell you in VB.NET every array has funcion call CopyTo

    so when want to put a ArrayA into ArrayB ...do it like this

    ArrayA.CopyTo(ArrayB, 0);

    and when you want to copy ArrayB into ArrayS do this

    ArrayB.CopyTo(ArrayS, 0);

    Hope this helps.

    Cheers!

     

     

    Thursday, September 8, 2011 6:34 AM
  • User783916550 posted

    Then how can i do for a thing like that ?

    'Save:
    
    For count As Integer = 0 To TabControl1.TabPages.Count - 1
                If TabControl1.SelectedTab.Text = TabControl1.TabPages(count).Text Then
                    TablePics.Copyto (SavePics(count),0) 
                    TablePoint.Copyto (SavePoint(count),0) 
                End If
            Next
            SaveAll(1) = SavePics
            SaveAll(2) = SavePoint



    Thursday, September 8, 2011 6:58 PM
  • User783916550 posted

    Copy a array into other array

    Array(cont) have other array in. it's what i want.

    No sucess.

    AnyOne knows ??

    Wednesday, October 12, 2011 10:22 AM
  • User-1889364718 posted

    Why Can't you use a hierrarchical Generic List instead ?

    Monday, November 7, 2011 6:39 AM