From: The Higgs bozo Date: 2009-03-13T01:00:22+09:00 Subject: Re: Newbie question about throw & catch. Song Choe wrote: > > When I run this and type "!" for every prompt(2) > then I get the following errortemp1.rb:4:in `throw': uncaught throw > `quitRequested' (NameError) > from temp1.rb:4:in `promptAndGet' > from temp1.rb:19Isn't catch supposed to run when "!" is ran? > If I don't put "!" on first prompt, I was expecting the program to end, > but the catch block runs anyway and asks > the Name at the end again. You have an extra call to promptAndGet("Name:") at the end, which appears outside of the catch block. Remove that and it works fine. Unless you meant to put it there? In which case it needs to be inside another catch block like the first one. -- Posted via http://www.ruby-forum.com/.