From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d54559bde05f5bb8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!t3g2000yqa.googlegroups.com!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: Weird string I/O problem Date: Mon, 1 Dec 2008 21:44:34 -0800 (PST) Organization: http://groups.google.com Message-ID: <6d9d4120-3af9-42c6-b3e9-768418948084@t3g2000yqa.googlegroups.com> References: <7bXYk.50433$_Y1.8162@bgtnsc05-news.ops.worldnet.att.net> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1228196675 2258 127.0.0.1 (2 Dec 2008 05:44:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 2 Dec 2008 05:44:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t3g2000yqa.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 webwasher (Webwasher 6.8.2.3963) Xref: g2news1.google.com comp.lang.ada:2850 Date: 2008-12-01T21:44:34-08:00 List-Id: On 1 Dez., 20:47, a...@anon.org (anon) wrote: > -- > -- Build your own input routine. =A0Example: > -- > with Ada.Characters.Latin_1 ; -- Needed for control chars. > use Ada.Characters.Latin_1 ; > > -- ... > =A0 char : character ; > =A0 input_string : String ( 1..80 ) ; > =A0 last : natural ; > > -- ... > > input_string :=3D ( others =3D> nul ) ; > for index in input_string'Range loop > =A0 Get ( char ) ; > =A0 exit when char =3D CR or char =3D LF ; Does anon ever read the RM? See A.10.7(1..3): 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. Also A.9(8): Effect of input (Get) ... of control characters ... is not specified. This tries to do what Get_Line is for - and is wrong! > =A0 input_string ( index ) :=3D char ; > =A0 Last :=3D Index ; =A0 > end loop > > =A0 -- valid data is input_string ( 1 .. last ) ; with no term control ch= aracters > > -- ...