From: Song Choe Date: 2009-03-13T02:34:34+09:00 Subject: Re: Newbie question about throw & catch. --_38bbe7aa-a292-4c6d-b1cb-79e737a8de45_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Oh. OK.=20 =20 Thank you=2C =20 =20 > Date: Fri=2C 13 Mar 2009 01:00:22 +0900 > From: higgs.bozo@gmail.com > Subject: Re: Newbie question about throw & catch. > To: ruby-talk@ruby-lang.org >=20 > Song Choe wrote: > > > > When I run this and type "!" for every prompt(2)=20 > > then I get the following errortemp1.rb:4:in `throw': uncaught throw=20 > > `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=2C I was expecting the program to en= d=2C=20 > > but the catch block runs anyway and asks > > the Name at the end again. >=20 > You have an extra call to promptAndGet("Name:") at the end=2C which=20 > appears outside of the catch block. Remove that and it works fine. >=20 > Unless you meant to put it there? In which case it needs to be inside=20 > another catch block like the first one. > --=20 > Posted via http://www.ruby-forum.com/. >=20 _________________________________________________________________ Windows Live=99 Contacts: Organize your contact list.=20 http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-= cns!503D1D86EBB2B53C!2285.entry?ocid=3DTXT_TAGLM_WL_UGC_Contacts_032009= --_38bbe7aa-a292-4c6d-b1cb-79e737a8de45_--