Behaviour of Ada.Text_IO on GNAT/Windows 11:
(1) Get_Immediate does not read the CR in CRLF pairs
(2) Get_Immediate does not read the ending CRLF pair at all (in loop terminated upon End_Of_File)
(3) an extra ending CRLF pair is output
Does this behaviour follow from the ARM?
Do other compilers behave 'better'?
Sequential_IO instantiated with Character works correctly (so I am not blocked, just curious:-)
Behaviour of Ada.Text_IO on GNAT/Windows 11:
(1) Get_Immediate does not read the CR in CRLF pairs
Behaviour of Ada.Text_IO on GNAT/Windows 11:
(1) Get_Immediate does not read the CR in CRLF pairs
(2) Get_Immediate does not read the ending CRLF pair at all (in loop terminated upon End_Of_File)
(3) an extra ending CRLF pair is output
On 08/03/2022 07:45, Marius Amado-Alves wrote:
Behaviour of Ada.Text_IO on GNAT/Windows 11:
(1) Get_Immediate does not read the CR in CRLF pairsIsn't this where you need to check for EOL and then Skip; when you hit it?
Get_Immediate returns the character corresponding to the key pressed. What is the character for the Enter key? GNAT has decided to return LF in that case.
Text_IO should just get the character from the OS. Without assumptions that it is this or that key.
On Tuesday, 8 March 2022 at 07:46:53 UTC, Luke A. Guest wrote:
On 08/03/2022 07:45, Marius Amado-Alves wrote:
Behaviour of Ada.Text_IO on GNAT/Windows 11:Isn't this where you need to check for EOL and then Skip; when you hit it?
(1) Get_Immediate does not read the CR in CRLF pairs
Sorry, Luke, I dont understand the question.
Sorry, Luke, I dont understand the question.There is a procedure called Skip to get past the EOL/EOP.
Sorry, Luke, I dont understand the question.There is a procedure called Skip to get past the EOL/EOP.
Thanks. Does not look applicable to the usecase which is just to read characters (graphic or not) from a file.
Get_Immediate as defined in the ARM looked to me as an escape from the page and line (and keyboard) abstractions. Guess not. Thanks.
Sorry, Luke, I dont understand the question.There is a procedure called Skip to get past the EOL/EOP.
Thanks. Does not look applicable to the usecase which is just to read characters (graphic or not) from a file.
Get_Immediate as defined in the ARM looked to me as an escape from the page and line (and keyboard) abstractions. Guess not. Thanks.
Sorry, Luke, I dont understand the question.There is a procedure called Skip to get past the EOL/EOP.
Thanks. Does not look applicable to the usecase which is just to read characters (graphic or not) from a file.
Get_Immediate as defined in the ARM looked to me as an escape from the page and line (and keyboard) abstractions. Guess not. Thanks.
On 2022-03-08 13:20, Marius Amado-Alves wrote:
Text_IO should just get the character from the OS. Without assumptions that it is this or that key.That is technically impossible under Windows. Windows does not deal with characters it does with scan codes which then might be converted to characters this or that way, or not at all.
On Tuesday, 8 March 2022 at 12:53:17 UTC, Dmitry A. Kazakov wrote:
On 2022-03-08 13:20, Marius Amado-Alves wrote:
Text_IO should just get the character from the OS. Without assumptions that it is this or that key.That is technically impossible under Windows. Windows does not deal with
characters it does with scan codes which then might be converted to
characters this or that way, or not at all.
You mean Text_IO scans the keyboard?!
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (3 / 13) |
Uptime: | 64:42:32 |
Calls: | 8,355 |
Calls today: | 15 |
Files: | 13,159 |
Messages: | 5,893,806 |
Posted today: | 1 |