From: marsberger@... (Andi Scharfstein) Date: 2003-04-19T02:16:49+09:00 Subject: Multi-dimensional arrays Hi, I have created a 'Person' class that uses multi-dimensional arrays to store information about particular interests of 'Person' objects. I don't know by compile time how many interest groups each person is going to have, and how many interests there are to each group. So, until now I have used a second array (that belongs to the Person class) to store meta-information about the interest array, in particular, how many interests there are to each interest group. E.g., if I had the following interest array: Interest 1 | Interest 2 | Interest 3 Sub1 | Sub2 | Sub6 | Sub3 | Sub7 | Sub4 | | Sub5 there would be a second array of: { 1, 4, 2 } I have implemented the multi-dimensional array as stated on http://www.ir.isas.ac.jp/~masa/ruby/mdary.html, like so: class MDArray < Array def [](n) self[n] = MDArray.new if super(n) == nil super(n) end end Now I wonder: is there a more efficient way to keep track of rows and columns of this array, i.e., is there some method to extract the number of rows a particular column has, and vice versa? Thanks a lot. -- Bye: Andi S. mailto:nullpointer@myrealbox.com