Connecting Tech Pros Worldwide Help | Site Map

Can iterate List two dimentionally??

Newbie
 
Join Date: Oct 2007
Posts: 20
#1: Sep 29 '08
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's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Sep 29 '08

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
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#3: Sep 30 '08

re: Can iterate List two dimentionally??


Do you have to use a List?
Member
 
Join Date: Sep 2008
Posts: 40
#4: Oct 5 '08

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