From: Thomas Preymesser Date: 2008-01-30T07:22:48+09:00 Subject: Re: For Loop question ------=_Part_13309_17691340.1201645373684 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 29/01/2008, Mark Mr wrote: > > ok basically i cant quite figure out how to do a for loop i want in > ruby. Here's what i want to do in C++, with some ruby mixed in > > for (i =3D 0; @question_array[i].nil?; i++) > { > > code here.... > > } > > it's supposed to run until it finds an element of the array that isnt > blank and then stop. anyone know how to make a loop like this in ruby? > thanks :) > -- > Posted via http://www.ruby-forum.com/. > > i =3D 0 while @question_array[i].nil? do code here.... i +=3D 1 end this is the semantic aequivalent of the C/C++ loop above. --=20 Thomas Preymesser thopre@gmail.com thomas@thopre.com B=FCro: 030 - 830 353 88 mobil: 0176 - 75 03 03 04 Privat: 030 - 49 78 37 06 http://thopre.wordpress.com/ http://www.thopre.com/ ------=_Part_13309_17691340.1201645373684--