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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,865c3d125a8dbc3b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!n8g2000vbb.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?bj=F6rn_lundin?= Newsgroups: comp.lang.ada Subject: Re: Howto read line from a stream Date: Mon, 1 Jun 2009 12:12:11 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <83317a97-dae5-4c84-a1ac-88a87833cf3f@q14g2000vbn.googlegroups.com> <1a90e055-44a3-4d00-b4cd-64798c731a55@e24g2000vbe.googlegroups.com> NNTP-Posting-Host: 78.82.58.64 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1243883531 1804 127.0.0.1 (1 Jun 2009 19:12:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 1 Jun 2009 19:12:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n8g2000vbb.googlegroups.com; posting-host=78.82.58.64; posting-account=3_reEwoAAAC163IAIrx427KYmwahFuh9 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.9.0.10) Gecko/2009042513 Ubuntu/8.04 (hardy) Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6167 Date: 2009-06-01T12:12:11-07:00 List-Id: On 31 Maj, 13:29, Tomek Wa=B3kuski wrote: > I have done so far: > > =A0 =A0function Read_Line (Channel : in Stream_Access) return String is > =A0 =A0 =A0 Buffer : String (1 .. 1); > =A0 =A0 =A0 Result : Unbounded_String; > =A0 =A0begin > =A0 =A0 =A0 loop > =A0 =A0 =A0 =A0 =A0String'Read (Channel, Buffer); > =A0 =A0 =A0 =A0 =A0Append (Result, Buffer); > =A0 =A0 =A0 =A0 =A0exit when Buffer (1) =3D ASCII.LF; > =A0 =A0 =A0 end loop; > =A0 =A0 =A0 return To_String(Result); > =A0 =A0end Read_Line; > > I know, this is completely NOT smart solution. I would look into the solution in Ada Sockets, procedure Get_Line, by Sam Tardieu, I think -- Bj=F6rn Lundin