From: Harry Date: 2007-02-19T15:34:33+09:00 Subject: Re: For loops don't count down > I realize that using "downto" can get me what I > want for down counting, like so: > > 5.downto(1) do |number| > puts number.to_s > end > > but I'd like to use the for because it's easier for me to see the start > and end of the block (especially when using syntax highlighting editors > like RDE). > > Michael > > I never use 'for' loops in Ruby. So I can't explain if or why not, etc. But if you want to use 'for' loops, you could try something like this. for number in (1..5).to_a.reverse puts number.to_s end Harry -- http://www.kakueki.com/ruby/list.html