comp.lang.ada
 help / color / mirror / Atom feed
* input/output exceptions
@ 2000-11-18  0:00 Jean Cohen
  2000-11-18  0:00 ` Robert Dewar
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Cohen @ 2000-11-18  0:00 UTC (permalink / raw)


Hi all,

I have a question regarding input/output exceptions. Suppose the following 
procedure:


with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;

procedure Test_Type_IO is

	First,	Second	: Integer := 0;

begin

	Get(First);
	Get(Second);

	Put(First);
	Put(Second);
	
end Test_Type_IO;


One should expect, that an input value which is not an integer (eg. a float) 
will raise an exception. However by executing the program I only get an 
exception [1] if the first value is not an integer. If the second one is not 
an integer, it seems, as if it is treated as one [2]:

3
2.54
          3          2

Why does the second value not raise an exception?

(The program is compiled by GNAT 3.13p on Debian GNU/Linux.)

Thank you,
Jean Cohen

(English is not my native language. I apologize for any misunderstandings 
that 
result of this reason.)


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

[1]	raised ADA.IO_EXCEPTIONS.DATA_ERROR : a-tiinio.adb:91 instantiated at 
a-inteio.ads:20

[2]	This is not the case if for instance strings are used - then the 
exceptions occur in every case.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-12-16 20:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-18  0:00 input/output exceptions Jean Cohen
2000-11-18  0:00 ` Robert Dewar
2000-11-18  0:00   ` Amal Kurian
2000-11-18  0:00     ` DuckE
2000-11-18  0:00       ` Amal Kurian
2000-11-19  0:00         ` Robert Dewar
     [not found]           ` <3A28353B.40B4F990@ebox.tninet.se>
     [not found]             ` <90dp4s$45c$1@nnrp1.deja.com>
2000-12-16 20:00               ` Stefan Skoglund

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