From: Peter Hickman Date: 2002-12-06T22:16:19+09:00 Subject: Re: on error resume next Shannon Fang wrote: > on error resume next > conn=tcpserver.connect(remote) > if conn==nil then > #some problem with connection > exit > end > f=File.open(testfile) > if f.class!=File then > #cannot open file > #do something with it > end > # normal processing... > begin conn=tcpserver.connect(remote) rescue #some problem with connection exit end begin f=File.open(testfile) rescue #cannot open file #do something with it end # normal processing... Your example has 12 lines mine (excluding blanks) has 13. Whats the big deal about not having an on error handler? PS I've been a basic programmer on PCs, Minis (VAX) and Mainframes since 1984 and was greatfull to get away from such bad exception handlers as you find in cheap basics. VAX Basic, now there was a good basic it had real exception handlers like... WHEN ERROR IN conn=tcpserver.connect(remote) USE #some problem with connection exit END WHEN ERROR IN f=File.open(testfile) USE #cannot open file #do something with it END # normal processing... So exception handlers like Ruby are hardly new (about 30 years old, give or take).