I think you might find it's the "i++". Try "i.next" or "i += 1" t. On 02/10/06, Josselin <josselin / wanadoo.fr> wrote: > I wrote the following loop some records , > > init an array db > get a record , loop on all records indexing by i > while record.start_at <= record.end_at > put in the db array [record.start_at, i] > end while > loop on records > end > > > but it seems that's Ruby doesn't like it .. what's wrong ? is theer any > way to write it better ? > > db = [] > record.each do |b| > aDate = b.start_at > i = 0 > while aDate <= b.end_at > db << [ aDate, i ] > i++ > aDate= aDate + i > end > end > > jossss > > >