Can iterate List two dimentionally??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bsonline
    New Member
    • Oct 2007
    • 21

    Can iterate List two dimentionally??

    Hiii, ALL....

    I have a bunch of data in tabular format, columns r fixed but rows may varry.
    I store this bunch of data in a List.
    When I retrive data form this List generally I get a linear format. but I want to retrive data row by row.(This Collection Structure (List) is Fixed here)
    Now my q is can I able to iterate the list two dimentionally as we can do in normal two dimentional array ?
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    A List is intrinsically a one dimensional sequence that can only be iterated over
    that one single dimension.

    kind regards,

    Jos

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Do you have to use a List?

      Comment

      • labmonkey111
        New Member
        • Sep 2008
        • 44

        #4
        A 2 dimensional array is really just an array of arrays. You could just as easily have a List of Lists. Each element in the main List would be a List containing one row's worth of info. This would allow the row width to vary. The code to handle this would be very similar to a 2 dimensional array.

        Comment

        Working...