Connecting Tech Pros Worldwide Help | Site Map

Can iterate List two dimentionally??

  #1  
Old September 29th, 2008, 12:40 PM
Newbie
 
Join Date: Oct 2007
Posts: 20
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 ?
  #2  
Old September 29th, 2008, 01:27 PM
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,634
Provided Answers: 2

re: Can iterate List two dimentionally??


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

kind regards,

Jos
  #3  
Old September 30th, 2008, 07:30 AM
Lives Here
 
Join Date: Sep 2006
Posts: 12,084

re: Can iterate List two dimentionally??


Do you have to use a List?
  #4  
Old October 5th, 2008, 09:47 PM
Member
 
Join Date: Sep 2008
Posts: 40

re: Can iterate List two dimentionally??


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.
Reply