comp.lang.ada
 help / color / mirror / Atom feed
From: "Paul Van Bellinghen" <pvanbell@mhv.net>
Subject: Re: In Exception ?
Date: 1998/04/04
Date: 1998-04-04T20:42:54+00:00	[thread overview]
Message-ID: <6g660e$khm$1@news.mhv.net> (raw)
In-Reply-To: 35214b7a.0@news.profinet.at



>
>My problem: I want to establish a  routine that is called out of normal
>flow, or out of an exception handler. How can I get the knowledge whether I
>am 'in' an exception (means in its processing) or not.  Is there a sort of
>function than can be coded like
>
>         if  in_exception_handler  then
>           ...
>        else
>           ...
>        end if;
>
>
Couldn't you just add a Boolean variable to your calling sequence that you
set to TRUE if you call the procedure from an exception handler and FALSE if
you call it from normal flow.  Or else use an enumeration variable that is
set to either EXCEPTION or NORMAL:

--------------------------------------------------
Procedure Foo(...) is

Type Calling_Source_Type is (Exception, Normal);

Calling_Source : Calling_Source_Type

.
.
Calling_Source := Normal;
Handler (Calling_Source);

Exception:

Calling_Source := Exception;
Handler (Calling_Source);
--------------------------------------------------

Procedure Handler (From_Where : Calling_Source_Type) is
.
.
if From_Where = Exception then
.
..
End IF;

--------------------------------------------------






       reply	other threads:[~1998-04-04  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35214b7a.0@news.profinet.at>
1998-04-04  0:00 ` Paul Van Bellinghen [this message]
1998-04-07  0:00   ` In Exception ? John Herro
1998-04-05  0:00 ` Corey Ashford
1998-04-07  0:00   ` nabbasi
     [not found]     ` <Er1n22.24v@world.std.com>
1998-04-07  0:00       ` Robert Dewar
1998-04-07  0:00     ` Corey Minyard
1998-04-09  0:00     ` Mats Weber
1998-04-09  0:00       ` nabbasi
1998-04-10  0:00         ` Larry Kilgallen
1998-04-09  0:00     ` Mats Weber
1998-04-09  0:00       ` nabbasi
replies disabled

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