comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne Hibou57" <yannick_duchene@yahoo.fr>
Subject: Re: writing on terminal before an exception
Date: Sun, 2 Aug 2009 18:13:05 -0700 (PDT)
Date: 2009-08-02T18:13:05-07:00	[thread overview]
Message-ID: <22b02ab4-e12b-4c59-89ba-7d2e7857cd13@b15g2000yqd.googlegroups.com> (raw)
In-Reply-To: h54jff$977$1@news.newsland.it

Hello Mark,

On 2 août, 19:47, mf...@yahoo.com (Mark Fabbri) wrote:
> i have a problem with text_io and exception:
>
> Text_IO.Put ("No SH3 data.");
> Text_IO.New_Line;
> raise Sh3_NoData;
>
> if it raise an exception, the string "NO SH3 data" is not displayed. it
> seems that the text_io don't actually print on screen. i also tryed with
> text_io.flush after the New_Line, but nothing happens.
Its quite common to me to display some informations on the console or
via a message box before a statement which raise en exception, while
debuging.

Perhaps a too much agressive optimizer ?

Or else, any redirection anywhere ?

I would suggest first to try to remove the raise statement, to see if
the string is displayed or not (just to be sure this is really due to
the raise statement).

If it happens to be confirmed, then insert some other statements
between the text I/O operations (some extra statements which would not
be Text_IO operations) and the raise statement, to see if it change
something.

Beside of the latter, another test I would be tempted to do, would be
to try to put the text I/O operations and the raise statement, each on
a dedicated scope. I mean, ... if the exception is raised after a
conditional test like

if Condition then
   Text_IO. ....
   raise ....
end if;

then to try

if Condition then
   Text_IO. ....
end if;

if Condition then
   raise ....
end if;

to see if it changes anything

Standard questions : what's your OS ? Your compiler ?

Always difficult to figure what the trouble is in such strange cases,
so I'm sorry if it does not help you as much as would expect, and I
just try to imagine some ways to guess where this behaviour comes
from.

Have a nice time

Y.



  reply	other threads:[~2009-08-03  1:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02 17:47 writing on terminal before an exception Mark Fabbri
2009-08-03  1:13 ` Yannick Duchêne Hibou57 [this message]
2009-08-03  6:39 ` Stephen Leake
2009-08-03 20:40 ` vlc
2009-08-03 22:29   ` Yannick Duchêne Hibou57
2009-08-04  0:14     ` Adam Beneschan
2009-08-04  1:07       ` stefan-lucks
2009-08-04 20:18 ` Mark Fabbri
replies disabled

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