Arraylist Of Arraylists


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Arraylist Of Arraylists

  1. #1
    Join Date
    Dec 2003
    Posts
    83

    Arraylist Of Arraylists

    What is the syntax in VB.NET for accessing an arraylist that is stored inside another arraylist?

    For example, I have an arraylist that contains 2 other arraylists that each contain 3 items. How do I retreive item 3 from the second arraylist?

    So far everything I've tried throws this error:
    "Public member 'ArrayList' on type 'ArrayList' not found."

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Short way:
    Code:
    ' Retrieve third item from second item of ArrayList A
    Value = A(1)(2)
    Long way:
    Code:
    Dim Temp As ArrayList = A(1)
    Dim Value As Object = Temp(2)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 3
    Last Post: 08-22-2007, 02:58 PM
  2. Help with displaying contents of ArrayList
    By jawolken in forum Java
    Replies: 3
    Last Post: 10-11-2006, 04:30 PM
  3. ArrayList
    By docfish in forum Java
    Replies: 1
    Last Post: 03-06-2006, 04:36 PM
  4. Replies: 10
    Last Post: 05-15-2005, 07:14 AM
  5. Replies: 4
    Last Post: 04-13-2005, 10:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center