From: Tim Hunter Date: 2002-12-02T10:05:47+09:00 Subject: Re: For statements On Mon, 02 Dec 2002 09:28:39 +0900, Daniel Carrera wrote: > Hi, > > Is there a way to do a for statement of this form?: > > for (i = 0; i < num; i += 3) ... > > Does the for statement have any form other than 'for i in array ...'? > > Can I use a for statement to do the equivalent this?: > 3.step(9,2) {|i| puts i } > > Thanks for the help. > Daniel. The step method is the Ruby-idiomatic way to do a for loop. Also times and upto.