Re: Ada exception block does NOT work?
- From: "bubble" <bubble@xxxxxxxxxxxx>
- Date: Tue, 16 Aug 2005 17:32:48 +0800
dear Georg:
thank to your reply so quickly.
and the problem still not be sloved.
you can test "test code".
you will find some thing interesting.
the statement , Avg := Sum / Data'Length;
should be throw a exception signal when Data'length is 0 (empty array)
and then the exception block handler should catch the signal, and do some
recovery process.
in the test case, it doesn't work
in first exceptin case, Ada throw a exception and transfer the control to
exception handler (greater).
in 2nd exception case,Ada "should" throw exception and do control transfer.
Unfortunately, it does not do.
> bubble wrote:
>
>> I found Ada can not re-enter the exception block twice.(oh! my god)
>> It should be work.
>
> It does :-). Reentering means to loop, so you could write,
> in your procedure's body
>
> loop
> begin
> some_computation(data);
> exit retrying;
> exception
> when Some_Exception =>
> report;
> make_adjustments;
> end;
> end loop;
>
> or
>
> retry: loop
> begin
> some_computation(data);
> exit retry;
> exception
> when Some_Exception =>
> report;
> make_adjustments;
> end;
> end loop retry;
.
- Follow-Ups:
- Re: Ada exception block does NOT work?
- From: Jeffrey R. Carter
- Re: Ada exception block does NOT work?
- From: Georg Bauhaus
- Re: Ada exception block does NOT work?
- From: gautier_niouzes
- Re: Ada exception block does NOT work?
- References:
- Ada exception block does NOT work?
- From: bubble
- Re: Ada exception block does NOT work?
- From: Georg Bauhaus
- Ada exception block does NOT work?
- Prev by Date: Re: Ada exception block does NOT work?
- Next by Date: Re: Ada exception block does NOT work?
- Previous by thread: Re: Ada exception block does NOT work?
- Next by thread: Re: Ada exception block does NOT work?
- Index(es):
Relevant Pages
|