From: Gennady Bystritsky Date: 2002-12-06T15:40:49+09:00 Subject: Re: on error resume next On Thursday, Dec 5, 2002, at 18:10 US/Pacific, Shannon Fang wrote: > Hi > > I'm sorry I don't understand why $on_error...? Is it mean Global var? > again, ... symbol... RTFM ;-) > > I tried to do the following: (peudo-code) > > def test > begin > conn=adodb.connection > conn.open ... > if conn!=nil then > #add data to db > else > #add data to file > end > rescue DBError > conn=nil > resume next > end > end > > > On Thu, 5 Dec 2002 23:50:12 +0000 (GMT) > ahoward wrote: > >> On Fri, 6 Dec 2002, Shannon Fang wrote: >> >>> Not what I want :( I want "On Error Resume Next"... If that is >>> available in ruby. >> >> #!/usr/local/bin/ruby >> >> def error >> callcc do |$on_error_resume_next| >> raise "ERROR_DELIBERATE" >> end >> puts "I'm back" >> end >> >> begin >> error >> puts "Finishing..." >> rescue >> $on_error_resume_next.call >> end >> >> >>>> I'm back >>>> Finishing... >> >> >> -a >> >> -- >> >> ==================================== >> | Ara Howard >> | NOAA Forecast Systems Laboratory >> | Information and Technology Services >> | Data Systems Group >> | R/FST 325 Broadway >> | Boulder, CO 80305-3328 >> | Email: ahoward@fsl.noaa.gov >> | Phone: 303-497-7238 >> | Fax: 303-497-7259 >> ==================================== > > > > >