Nп/п : 38 из 100
 От   : Dmitry A. Kazakov                   2:5075/128        23 сен 23 11:25:05
 К    : Niklas Holsti                                         23 сен 23 12:29:03
 Тема : Re: Weird behavior of Get character with trailing new lines.
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> 4ffd803c
@REPLY: <kn7mhtF58psU1@mid.individual.net>
5d1cec91
@REPLYADDR Dmitry A. Kazakov
<mailbox@dmitry-kazakov.de>
@REPLYTO 2:5075/128 Dmitry A. Kazakov
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: 1@dont-email.me>
1@dont-email.me> 1@dont-email.me> <kn7mhtF58psU1@mid.individual.net>
@TZUTC: 0200
@PID: Mozilla Thunderbird
@TID: FIDOGATE-5.12-ge4e8b94
On 2023-09-23 10:39, Niklas Holsti wrote:
> On 2023-09-23 10:02, J-P. Rosen wrote:

>> That`s why I never check End_Of_File, but handle the End_Error 
>> exception. It always works.

> True, but it may not be convenient for the overall logic of the program 
> that reads the file. That program often wants do to something with the 
> contents, after reading the whole file, and having to enter that part of 
> the program through an exception does complicate the code a little.

It rather simplifies the code. You exit the loop and do whatever is 
necessary there.

Testing for the file end is unreliable and non-portable. Many types of 
files simply do not support that test. In other cases the test is not 
file immutable with the side effects that can change the program logic.

It is well advised to never ever use it.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

--- Mozilla Thunderbird
 * 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    
                                                                                
В этой области больше нет сообщений.

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