From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: Wide_Text_IO: bad data in text file
Date: Fri, 25 Oct 2002 06:56:07 +0200 (MET DST)
Date: 2002-10-25T06:56:07+02:00 [thread overview]
Message-ID: <mailman.1035522182.23022.comp.lang.ada@ada.eu.org> (raw)
> The RM doesn't specifically address this issue, as far as I can tell.
> Data_Error seems to be intended for cases where characters can be read
> from the file but they're not in the proper syntax for an integer
> (when using an instance of Integer_IO), or a float, or whatever. The
> closest thing I could find was A.13(10), which says "Use_Error is
> propagated if an operation is attempted that is not possible for
> reasons that depend on characteristics of the external file". When I
> tried a test using GNAT, it raised Constraint_Error, which seems
> counterintuitive.
Exactly when did Gnat raise Constraint_Error? At the Get? Or later when you use the value
read?
My interpretation of the RM is that Data_Error should be raised, however it need
not be raised if this would be too much of a burden (cannot be easily done). If
Data_Error is not raised, you have invalid data.
The 'Valid attribute can be used to insure that the data read really is valid
(i.e. has a legal interpretation). This attribute is there for just this
purpose.
next reply other threads:[~2002-10-25 4:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-25 4:56 Grein, Christoph [this message]
2002-10-25 11:48 ` Wide_Text_IO: bad data in text file Jean-Pierre Rosen
2002-10-25 15:22 ` Adam Beneschan
2002-10-25 17:22 ` Frank J. Lhota
2002-10-26 1:21 ` Adam Beneschan
-- strict thread matches above, loose matches on Subject: below --
2002-10-24 20:32 Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox