From mboxrd@z Thu Jan 1 00:00:00 1970
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
ip-172-31-91-241.ec2.internal
X-Spam-Level:
X-Spam-Status: No, score=-1.0 required=3.0 tests=FREEMAIL_FROM,NICE_REPLY_A
autolearn=ham autolearn_force=no version=3.4.6
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Blady
Newsgroups: comp.lang.ada
Subject: Re: Weird behavior of Get character with trailing new lines.
Date: Mon, 25 Sep 2023 21:55:56 +0200
Organization: A noiseless patient Spider
Message-ID:
References:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 25 Sep 2023 19:55:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cc4641d4419fd484928a042cceb1e692";
logging-data="2196801"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rps4Dl6cUsxZ+Xx40W1ft"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.15.1
Cancel-Lock: sha1:07oY/O78oPBWDnmoImppPXh6cew=
Content-Language: fr, en-US
In-Reply-To:
Xref: news.eternal-september.org comp.lang.ada:65723
List-Id:
Le 24/09/2023 à 09:50, Dmitry A. Kazakov a écrit :
> On 2023-09-23 16:03, Niklas Holsti wrote:
>> On 2023-09-23 10:02, J-P. Rosen wrote: >>> Le 22/09/2023 à 22:05, Jeffrey R.Carter a écrit :>>>> On 2023-09-22
21:30, Blady wrote:
>>>>
>>>> A.10.7 Input-Output of Characters and Strings
>>>> For an item of type Character the following procedures are provided:
>>>> procedure Get(File : in File_Type; Item : out Character);
>>>> procedure Get(Item : out Character);
>>>> After skipping any line terminators and any page terminators, reads
>>>> the next character from the specified input file and returns the
>>>> value of this character in the out parameter Item.
>>>> The exception End_Error is propagated if an attempt is made to skip
>>>> a file terminator.
Thanks all for your helpful answers.
It actually helps.
Especially, I was not aware of the particular behavior of End_Of_File
with a single line terminator before the file terminator.
In my case, I prefer to reserve exceptions for exceptional situations
:-) so I've took the code from Niklas example.
Regards, Pascal.