comp.lang.ada
 help / color / mirror / Atom feed
From: Jean Cohen <jean.cohen@MailAndNews.com>
Subject: input/output exceptions
Date: 2000/11/18
Date: 2000-11-18T00:00:00+00:00	[thread overview]
Message-ID: <3A2B4CF6@MailAndNews.com> (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.





             reply	other threads:[~2000-11-18  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-18  0:00 Jean Cohen [this message]
2000-11-18  0:00 ` input/output exceptions 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
replies disabled

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