Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

24 Apr, 2024: Testing a new version of the Overboard here. If you have an issue post about it to rocksolid.nodes.help (I know. Everyone on Usenet has issues)


devel / comp.lang.ada / Get_Immediate does not read CR in CRLF pairs

SubjectAuthor
* Get_Immediate does not read CR in CRLF pairsMarius Amado-Alves
+* Re: Get_Immediate does not read CR in CRLF pairsLuke A. Guest
|`* Re: Get_Immediate does not read CR in CRLF pairsMarius Amado-Alves
| `* Re: Get_Immediate does not read CR in CRLF pairsLuke A. Guest
|  `* Re: Get_Immediate does not read CR in CRLF pairsMarius Amado-Alves
|   `- Re: Get_Immediate does not read CR in CRLF pairsLuke A. Guest
+- Re: Get_Immediate does not read CR in CRLF pairsDmitry A. Kazakov
`* Re: Get_Immediate does not read CR in CRLF pairsJeffrey R.Carter
 `* Re: Get_Immediate does not read CR in CRLF pairsMarius Amado-Alves
  `* Re: Get_Immediate does not read CR in CRLF pairsDmitry A. Kazakov
   `* Re: Get_Immediate does not read CR in CRLF pairsMarius Amado-Alves
    `- Re: Get_Immediate does not read CR in CRLF pairsDmitry A. Kazakov

1
Get_Immediate does not read CR in CRLF pairs

<1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6691&group=comp.lang.ada#6691

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:2401:b0:67c:85ef:7122 with SMTP id d1-20020a05620a240100b0067c85ef7122mr2228206qkn.293.1646725530375;
Mon, 07 Mar 2022 23:45:30 -0800 (PST)
X-Received: by 2002:a25:b9d2:0:b0:628:a85f:953c with SMTP id
y18-20020a25b9d2000000b00628a85f953cmr10964106ybj.312.1646725530201; Mon, 07
Mar 2022 23:45:30 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 7 Mar 2022 23:45:30 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=94.60.27.164; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY
NNTP-Posting-Host: 94.60.27.164
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
Subject: Get_Immediate does not read CR in CRLF pairs
From: amado.al...@gmail.com (Marius Amado-Alves)
Injection-Date: Tue, 08 Mar 2022 07:45:30 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 71
 by: Marius Amado-Alves - Tue, 8 Mar 2022 07:45 UTC

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:-)

Thanks.
______
with Ada.Text_IO; use Ada.Text_IO;

procedure Get_Immediate_Test is
C: Character;
F_In: File_Type;
F_Out: File_Type;

procedure Default_Files_With_End_Of_File is
begin
while not End_Of_File loop
Get_Immediate (C);
Put (Character'Pos (C)'Img);
end loop;
end;

procedure Default_Files_With_Exception is
begin
loop
Get_Immediate (C);
Put (Character'Pos (C)'Img);
end loop;
exception
when others => null;
end;

procedure Named_Files_With_End_Of_File is
begin
Open (F_In, In_File, "imm_test_in_file.txt");
Create (F_Out, Out_File, "imm_test_out_file.txt");
while not End_Of_File loop
Get_Immediate (F_In, C);
Put (F_Out, Character'Pos (C)'Img);
end loop;
Close (F_In);
Close (F_Out);
end;

procedure Named_Files_With_Exception is
begin
Open (F_In, In_File, "imm_test_in_file.txt");
Create (F_Out, Out_File, "imm_test_out_file.txt");
begin
loop
Get_Immediate (F_In, C);
Put (F_Out, Character'Pos (C)'Img);
end loop;
exception
when others =>
Close (F_In);
Close (F_Out);
end;
end;

begin
Named_Files_With_Exception;
end;

Re: Get_Immediate does not read CR in CRLF pairs

<t071l9$15k3$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6692&group=comp.lang.ada#6692

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Lx7EM+81f32E0bqku+QpCA.user.46.165.242.75.POSTED!not-for-mail
From: lagu...@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Tue, 8 Mar 2022 07:46:26 +0000
Organization: Aioe.org NNTP Server
Message-ID: <t071l9$15k3$1@gioia.aioe.org>
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="38531"; posting-host="Lx7EM+81f32E0bqku+QpCA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Luke A. Guest - Tue, 8 Mar 2022 07:46 UTC

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 pairs

Isn't this where you need to check for EOL and then Skip; when you hit it?

Re: Get_Immediate does not read CR in CRLF pairs

<t072kn$1jeo$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6693&group=comp.lang.ada#6693

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!hzzNxxMX5IPvnEV4b74Cww.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Tue, 8 Mar 2022 09:03:36 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t072kn$1jeo$1@gioia.aioe.org>
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="52696"; posting-host="hzzNxxMX5IPvnEV4b74Cww.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Tue, 8 Mar 2022 08:03 UTC

On 2022-03-08 08:45, Marius Amado-Alves wrote:
> 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:-)

I guess this is a part of translation text I/O does and sequential and
stream I/O do not.

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

Re: Get_Immediate does not read CR in CRLF pairs

<t0769t$id9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6694&group=comp.lang.ada#6694

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: spam.jrc...@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Tue, 8 Mar 2022 10:06:02 +0100
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <t0769t$id9$1@dont-email.me>
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Mar 2022 09:06:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="101cb3e40e232cbf9aa095c202bc615b";
logging-data="18857"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0/Vs3YS+zBNEH3L0O0KXYPLKYQptlWnA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.0
Cancel-Lock: sha1:JXof76ak+J3ONS17qQ2V9JGOKDA=
In-Reply-To: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
Content-Language: en-US
 by: Jeffrey R.Carter - Tue, 8 Mar 2022 09:06 UTC

On 2022-03-08 08:45, Marius Amado-Alves wrote:
> Behaviour of Ada.Text_IO on GNAT/Windows 11:
>
> (1) Get_Immediate does not read the CR in CRLF pairs

Get_Immediate is only of interest for reading from Standard_Input, primarily
when it is the keyboard. It's better to use Get for other cases.

Get_Immediate is not well defined for reading line terminators. Whatever the
compiler decides to implement is probably correct, and implementation defined.
Should it behave like Get, which ignores line terminators? ObjectAda 10.2
ignores the Enter key (10.3 returns CR).

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.
Should it behave differently if the input is from a file? Presumably,
Get_Immediate should behave the same whether Standard_Input is the keyboard or
redirected from a file.

> (2) Get_Immediate does not read the ending CRLF pair at all (in loop terminated upon End_Of_File)

End_Of_File is defined to return True if all that remains in the file is a line
terminator followed by a page terminator (A.10.5). As such, it is broken, since,
when reading a file with a null last line, it will return True before the last
line is read. In practice, most compilers treat a final line terminator the
same, to work with files produced by non-Ada programs.

> (3) an extra ending CRLF pair is output

Close is defined to call New_page if the file does not already end with a page
terminator [ARM A.10.2(3),
http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-A-10-2.html], and a page
is defined to be terminated by a line terminator followed by a page terminator
(A.10). GNAT seems to use the same character sequence for line and page
terminators, presumably so that text files output with Ada.Text_IO may be read
by non-Ada programs. If you've output a single LF as the last thing in a file on
Windows, that is not a page terminator, so Close adds one.

If you need to see all the bytes in a file, Sequential_IO or Stream_IO are the
ways to go. Of course, there is no portable way to read Standard_Input using
Sequential_IO.

--
Jeff Carter
"What's the amount of the insult?"
Never Give a Sucker an Even Break
104

Re: Get_Immediate does not read CR in CRLF pairs

<ee3c28e8-4aca-48bb-9eae-f5d097cb4069n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6695&group=comp.lang.ada#6695

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:14d0:b0:2e0:64e7:3920 with SMTP id u16-20020a05622a14d000b002e064e73920mr8313417qtx.61.1646741331747;
Tue, 08 Mar 2022 04:08:51 -0800 (PST)
X-Received: by 2002:a81:14c4:0:b0:2dc:da43:3537 with SMTP id
187-20020a8114c4000000b002dcda433537mr5753986ywu.204.1646741331490; Tue, 08
Mar 2022 04:08:51 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 8 Mar 2022 04:08:51 -0800 (PST)
In-Reply-To: <t071l9$15k3$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.60.27.164; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY
NNTP-Posting-Host: 94.60.27.164
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com> <t071l9$15k3$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ee3c28e8-4aca-48bb-9eae-f5d097cb4069n@googlegroups.com>
Subject: Re: Get_Immediate does not read CR in CRLF pairs
From: amado.al...@gmail.com (Marius Amado-Alves)
Injection-Date: Tue, 08 Mar 2022 12:08:51 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: Marius Amado-Alves - Tue, 8 Mar 2022 12:08 UTC

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:
> >
> > (1) Get_Immediate does not read the CR in CRLF pairs
> Isn't this where you need to check for EOL and then Skip; when you hit it?

Sorry, Luke, I dont understand the question.

Re: Get_Immediate does not read CR in CRLF pairs

<d05cc258-7ba9-4bf3-a40d-c43be08528cdn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6696&group=comp.lang.ada#6696

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:627:b0:435:2dcd:d6c0 with SMTP id a7-20020a056214062700b004352dcdd6c0mr11840047qvx.100.1646742038912;
Tue, 08 Mar 2022 04:20:38 -0800 (PST)
X-Received: by 2002:a5b:9cc:0:b0:61d:f7ba:7fc with SMTP id y12-20020a5b09cc000000b0061df7ba07fcmr11225104ybq.434.1646742038759;
Tue, 08 Mar 2022 04:20:38 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 8 Mar 2022 04:20:38 -0800 (PST)
In-Reply-To: <t0769t$id9$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=94.60.27.164; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY
NNTP-Posting-Host: 94.60.27.164
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com> <t0769t$id9$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d05cc258-7ba9-4bf3-a40d-c43be08528cdn@googlegroups.com>
Subject: Re: Get_Immediate does not read CR in CRLF pairs
From: amado.al...@gmail.com (Marius Amado-Alves)
Injection-Date: Tue, 08 Mar 2022 12:20:38 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 14
 by: Marius Amado-Alves - Tue, 8 Mar 2022 12:20 UTC

On Tuesday, 8 March 2022 at 09:06:07 UTC, Jeffrey R.Carter wrote:
> 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.

Surely Text_IO is not scanning the keyboard. Or it should not. The OS does. Text_IO should just get the character from the OS. Without assumptions that it is this or that key.

For me the ARM is very clear:

"Reads the next character, either control or graphic, from the specified File or the default input file. " A.10.7 (10/3)

That is why I dont understand the issue.

My guess was that redirection on the Windows command line was the culprit (and it does interfere a bit, but not enough to explain all).

Thanks.

Re: Get_Immediate does not read CR in CRLF pairs

<t07jjq$2ee$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6697&group=comp.lang.ada#6697

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!hzzNxxMX5IPvnEV4b74Cww.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Tue, 8 Mar 2022 13:53:15 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t07jjq$2ee$1@gioia.aioe.org>
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
<t0769t$id9$1@dont-email.me>
<d05cc258-7ba9-4bf3-a40d-c43be08528cdn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="2510"; posting-host="hzzNxxMX5IPvnEV4b74Cww.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.2
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Tue, 8 Mar 2022 12:53 UTC

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.

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

Re: Get_Immediate does not read CR in CRLF pairs

<t07qu2$1t5b$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6698&group=comp.lang.ada#6698

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Lx7EM+81f32E0bqku+QpCA.user.46.165.242.75.POSTED!not-for-mail
From: lagu...@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Tue, 8 Mar 2022 14:57:48 +0000
Organization: Aioe.org NNTP Server
Message-ID: <t07qu2$1t5b$1@gioia.aioe.org>
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
<t071l9$15k3$1@gioia.aioe.org>
<ee3c28e8-4aca-48bb-9eae-f5d097cb4069n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="62635"; posting-host="Lx7EM+81f32E0bqku+QpCA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Luke A. Guest - Tue, 8 Mar 2022 14:57 UTC

On 08/03/2022 12:08, Marius Amado-Alves wrote:
> 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:
>>>
>>> (1) Get_Immediate does not read the CR in CRLF pairs
>> Isn't this where you need to check for EOL and then Skip; when you hit it?
>
> Sorry, Luke, I dont understand the question.

There is a procedure called Skip to get past the EOL/EOP.

Re: Get_Immediate does not read CR in CRLF pairs

<30c0029f-8a26-4254-8baa-e604943a240en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6699&group=comp.lang.ada#6699

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:58c2:0:b0:2de:326e:9dcb with SMTP id u2-20020ac858c2000000b002de326e9dcbmr14694818qta.689.1646757784203;
Tue, 08 Mar 2022 08:43:04 -0800 (PST)
X-Received: by 2002:a25:3b87:0:b0:628:b8a6:c1e7 with SMTP id
i129-20020a253b87000000b00628b8a6c1e7mr12994587yba.422.1646757783938; Tue, 08
Mar 2022 08:43:03 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 8 Mar 2022 08:43:03 -0800 (PST)
In-Reply-To: <t07qu2$1t5b$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.60.27.164; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY
NNTP-Posting-Host: 94.60.27.164
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
<t071l9$15k3$1@gioia.aioe.org> <ee3c28e8-4aca-48bb-9eae-f5d097cb4069n@googlegroups.com>
<t07qu2$1t5b$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <30c0029f-8a26-4254-8baa-e604943a240en@googlegroups.com>
Subject: Re: Get_Immediate does not read CR in CRLF pairs
From: amado.al...@gmail.com (Marius Amado-Alves)
Injection-Date: Tue, 08 Mar 2022 16:43:04 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: Marius Amado-Alves - Tue, 8 Mar 2022 16:43 UTC

> > 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.

Re: Get_Immediate does not read CR in CRLF pairs

<t09r0n$1vh5$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6701&group=comp.lang.ada#6701

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Lx7EM+81f32E0bqku+QpCA.user.46.165.242.75.POSTED!not-for-mail
From: lagu...@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Wed, 9 Mar 2022 09:11:28 +0000
Organization: Aioe.org NNTP Server
Message-ID: <t09r0n$1vh5$1@gioia.aioe.org>
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
<t071l9$15k3$1@gioia.aioe.org>
<ee3c28e8-4aca-48bb-9eae-f5d097cb4069n@googlegroups.com>
<t07qu2$1t5b$1@gioia.aioe.org>
<30c0029f-8a26-4254-8baa-e604943a240en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="65061"; posting-host="Lx7EM+81f32E0bqku+QpCA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.5.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: Luke A. Guest - Wed, 9 Mar 2022 09:11 UTC

On 08/03/2022 16:43, Marius Amado-Alves wrote:
>>> 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.
>

Yeah, it's been years since I touched any file i/o stuff.

Re: Get_Immediate does not read CR in CRLF pairs

<c9a3d847-057f-4c20-9283-57adeaf65374n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6702&group=comp.lang.ada#6702

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:2293:b0:600:2b7b:2a19 with SMTP id o19-20020a05620a229300b006002b7b2a19mr13153308qkh.408.1646825214100;
Wed, 09 Mar 2022 03:26:54 -0800 (PST)
X-Received: by 2002:a25:2e50:0:b0:629:1c69:aa61 with SMTP id
b16-20020a252e50000000b006291c69aa61mr14753566ybn.213.1646825213779; Wed, 09
Mar 2022 03:26:53 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 9 Mar 2022 03:26:53 -0800 (PST)
In-Reply-To: <t07jjq$2ee$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.60.27.164; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY
NNTP-Posting-Host: 94.60.27.164
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
<t0769t$id9$1@dont-email.me> <d05cc258-7ba9-4bf3-a40d-c43be08528cdn@googlegroups.com>
<t07jjq$2ee$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9a3d847-057f-4c20-9283-57adeaf65374n@googlegroups.com>
Subject: Re: Get_Immediate does not read CR in CRLF pairs
From: amado.al...@gmail.com (Marius Amado-Alves)
Injection-Date: Wed, 09 Mar 2022 11:26:54 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: Marius Amado-Alves - Wed, 9 Mar 2022 11:26 UTC

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?!

Re: Get_Immediate does not read CR in CRLF pairs

<t0a81b$bnn$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6703&group=comp.lang.ada#6703

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!hzzNxxMX5IPvnEV4b74Cww.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Wed, 9 Mar 2022 13:54:03 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t0a81b$bnn$1@gioia.aioe.org>
References: <1bd9b7ee-9195-44b3-8de2-c018a44b7eden@googlegroups.com>
<t0769t$id9$1@dont-email.me>
<d05cc258-7ba9-4bf3-a40d-c43be08528cdn@googlegroups.com>
<t07jjq$2ee$1@gioia.aioe.org>
<c9a3d847-057f-4c20-9283-57adeaf65374n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="12023"; posting-host="hzzNxxMX5IPvnEV4b74Cww.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.2
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Wed, 9 Mar 2022 12:54 UTC

On 2022-03-09 12:26, Marius Amado-Alves wrote:
> 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?!

Of course not, usually you have no direct access to it.

Specifically GNAT's Text_IO implementation under Windows seems to use
Microsoft's getch from the C run-time:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/getch-getwch?view=msvc-170

So all translation happens in the layer emulating file descriptors on
top of Windows I/O system; on top of whatever sits below, console driver
etc.

Interestingly getch let you access some actual scan codes as follows
from the description. Though of course you get them only if you deal
with an actual console and not with a pipe etc.

The point is that "character" is a fiction unless you read a modem line
and even then.

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

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor