comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: writing on terminal before an exception
Date: Mon, 03 Aug 2009 02:39:12 -0400
Date: 2009-08-03T02:39:12-04:00	[thread overview]
Message-ID: <u4ospwgdr.fsf@stephe-leake.org> (raw)
In-Reply-To: h54jff$977$1@news.newsland.it

mfads@yahoo.com (Mark Fabbri) writes:

> 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. 

What compiler and operating system? It works for me with GNAT on
Windows:

with Ada.Text_IO; use Ada.Text_IO;
procedure Hello
is
   Sh3_NoData : exception;
begin
   Put ("No SH3 data.");
   New_Line;
   Flush;
   raise Sh3_NoData;

end Hello;

gnatmake -p -k -C -Pgnat.gpr  hello 
gnatbind -E -I- -x C:\Stephe\Ada_Work\Gnat\objects\hello.ali
gnatlink C:\Stephe\Ada_Work\Gnat\objects\hello.ali -LC:\Apps\GNAT-6.2.1\lib\asis -lasis -o C:\Stephe\Ada_Work\Gnat\hello.exe
./hello.exe 
No SH3 data.

Execution terminated by unhandled exception
Exception name: HELLO.SH3_NODATA
Message: hello.adb:9
Call stack traceback locations:
0x401776 0x4016c8 0x401235 0x401286 0x7c817075

Perhaps you have Text_IO.Standard_Output redirected somewhere?

-- 
-- Stephe



  parent reply	other threads:[~2009-08-03  6:39 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
2009-08-03  6:39 ` Stephen Leake [this message]
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