From: Michael Brooks Date: 2007-02-20T01:15:09+09:00 Subject: Re: For loops don't count down Michael Fellinger wrote: > > anyway, how is the syntax-highlighting different for for...end vs do...end? > and if you want matching highlighting, you can still do > > 5.downto(1) { |number| > puts number > } > > > (1..5).to_a.reverse.each do |number| > puts number > end > > hope i could help you with that a little > ^ manveru Thank you for the reply. The syntax-highlighter highlights the "for" and the "end" which are both on the left most edge of the block. I like that because it saves me time scanning my code since I don't have to scan to the right to realize it's a block. I might use the "for number in (1..5).to_a.reverse" variation of the for that Harry suggested below. I just thought it was strange that the for couldn't do the BASIC style step -1 and the Ruby docs didn't seem to discuss it that I could find. Thank You!