From: "Albert L. Wagner" Date: 2001-11-14T07:28:50+09:00 Subject: [ruby-talk:25093] Re: exiting blox Unless I am missing something obvious, break should work. Alan Chen wrote: > > On Wed, Nov 14, 2001 at 06:51:41AM +0900, Niko Schwarz wrote: > > Hi there, > > is there a way to exit a block before time? > > like: > > > > field.each { |el| > > if(el.alsacian?) > > break #no, dont want anymore > > else > > puts el > > end > > } > > > > is there? (note: i want to exit it just for one el, of course) > > > > tia, > > > > nick > > I'd like to know this one also. I find that I keep trying to write > "return" or "break" in these cases. (And it works as badly the first > time as the subsequent times :) > > -- > Alan Chen > Digikata LLC > alan@digikata.com > http://digikata.com -- "It requires wisdom to understand wisdom: the music is nothing if the audience is deaf." - Walter Lippman