comp.lang.ada
 help / color / mirror / Atom feed
From: Dave Jones <davedave@io.com>
Cc: davedave@io.com
Subject: Re: Help with Exceptions!
Date: 1996/05/13
Date: 1996-05-13T00:00:00+00:00	[thread overview]
Message-ID: <319764DA.3A8C@io.com> (raw)
In-Reply-To: 31935435.3C00@mmc1001.lfwc.lockheed.com


George F.Rice wrote:
> 
> Dave Jones wrote:
> 
> : procedure test is
> :         x:integer ;
> : begin
> :         begin
> :                 x := 10000000 ;
> :         exception
> :                 when CONSTRAINT_ERROR =>
> :                         goto Next_Block ;
> :         end ;
> : <<Next_Block>>
> :         begin
> :                 x := 3 ;
> :         exception
> :                 when CONSTRAINT_ERROR =>
> :                         RETURN ;
> :         end ;
> :         RETURN ;
> : end test;
> 
> The goto is unnecessary; when the exception handler completes,
> control will pass to the next statement anyway.
> 
That's very true.  I was just trying to show what could be done
with regard to jumping out of a block where an exception has 
occured.  

In any case, like I said in my post, I don't recommed this way of 
approaching the problem.  In fact, I actually regret making
that post because, every time I have seen an Ada program with a 
"goto", I have always been able to find a better way to write the
program; so I suppose that I really should not be gently encouraging
people to use "goto".  

Most others seem to have an experience similar to mine:  "goto" means 
you need to change your approach.  So I was wondering, has anyone out
there ever encountered a situation where "goto" was actually necessary?

-- Dave Jones




  reply	other threads:[~1996-05-13  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-07  0:00 Help with Exceptions! Robert Gelb
1996-05-07  0:00 ` Vincent Smeets
1996-05-07  0:00 ` John Herro
1996-05-07  0:00 ` Steve Howard
1996-05-07  0:00   ` Robert Dewar
     [not found]   ` <4mqio5$a8b@news.sanders.lockheed.com>
1996-05-09  0:00     ` Robert L. Spooner, AD3K
1996-05-10  0:00   ` Jon S Anthony
1996-05-10  0:00     ` Robert A Duff
     [not found] ` <318F94D9.35AB@io.com>
1996-05-10  0:00   ` George F.Rice
1996-05-13  0:00     ` Dave Jones [this message]
1996-05-13  0:00   ` Robert I. Eachus
1996-05-14  0:00     ` John Herro
1996-05-14  0:00       ` Robert I. Eachus
1996-05-14  0:00   ` Theodore E. Dennison
1996-05-14  0:00     ` Robert A Duff
1996-05-14  0:00 ` Michel Gauthier
1996-05-14  0:00   ` Robert A Duff
1996-05-15  0:00     ` Norman H. Cohen
1996-05-15  0:00       ` Robert A Duff
1996-05-15  0:00 ` Michel Gauthier
1996-05-16  0:00 ` Jon S Anthony
1996-05-16  0:00 ` Jon S Anthony
1996-05-16  0:00   ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1996-05-09  0:00 tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox