From: John Johnson Date: 2003-05-31T03:31:40+09:00 Subject: Re: Iteration - last detection on 5/30/03 2:13 PM, Anders Borch at spam@deck.dk wrote: > John Johnson wrote: >> I may be over simplifiying, but Enumerable defines max, so couldn't you: >> >> a = {} >> a["a"] = "A" >> a["b"] = "B" >> a["c"] = "C" >> a.each { |key, val| >> print "#{key} = #{val}" >> if key === a.keys.max >> puts " and that's the last one" >> else >> puts >> end >> } > > that would only work if the array is sorted... > Ah yes, this is true. Thanks! -- Regards, JJ Be Kind, Be Careful, Be Yourself