From: Robert Klemme Date: 2008-01-31T19:38:10+09:00 Subject: Re: For Loop question 2008/1/30, Mark Mr : > thanks to everyone who posted. This one worked for what i was doing > > i = 0 > while @question_array[i].nil? do > code here.... What code? The question is what are you trying to achieve here? This has not become clear from your postings. > i += 1 > end > > although i was hoping i wouldn't have to declare the i=0 beforehand just > from a style standpoint but it works fine so i guess that's all that > matters. Thanks again :) If you are doing a kind of initialization you could do this @questions.map! do |q| q or begin # init code, here just a constant value 1 end end Kind regards robert -- use.inject do |as, often| as.you_can - without end