Nп/п : 35 из 100
 От   : Jeffrey R.Carter                    2:5075/128        22 сен 23 22:05:55
 К    : Blady                                                 22 сен 23 23:07:05
 Тема : Re: Weird behavior of Get character with trailing new lines.
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> ad9e7f67
@REPLY: 1@dont-email.me> 4e5ef6ae
@REPLYADDR Jeffrey R.Carter
<spam.jrcarter.not@spam.acm.org.not>
@REPLYTO 2:5075/128 Jeffrey R.Carter
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: 1@dont-email.me>
@TZUTC: 0200
@PID: Mozilla/5.0 (X11; Linux x86_64; rv:102.0)
Gecko/20100101 Thunderbird/102.15.1
@TID: FIDOGATE-5.12-ge4e8b94
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.

As you have quoted, Get (Character) skips line terminators. End_Of_File returns 
True if there is a single line terminator before the file terminator, but False 
 if there are multiple line terminators before the file terminator.
So you either 
have to explicitly skip line terminators, or handle End_Error.

-- 
Jeff Carter
"Unix and C are the ultimate computer viruses."
Richard Gabriel
99

 --- Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх