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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,386228a37afe967f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-18 10:31:17 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Computer Language Shootout Date: 18 Jul 2003 10:31:16 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0307180931.2139f563@posting.google.com> References: <1ec946d1.0307150715.4ba69f85@posting.google.com> <3F149243.80304@attbi.com> <3F15930C.2070907@attbi.com> <198fhv0avvpqc39dq7paiqpf3lntca8v4g@4ax.com> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1058549477 22450 127.0.0.1 (18 Jul 2003 17:31:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 18 Jul 2003 17:31:17 GMT Xref: archiver1.google.com comp.lang.ada:40477 Date: 2003-07-18T17:31:17+00:00 List-Id: Dmitry A. Kazakov wrote in message news:<198fhv0avvpqc39dq7paiqpf3lntca8v4g@4ax.com>... > On Thu, 17 Jul 2003 19:36:19 +0200, "Jean-Pierre Rosen" > wrote: > > What will happen if a line is exactly of 500 character length? From > the quote above I suppose that Get_Line will boldly go to the next > line. If so, then your program would merge all lines of 500 character > length into one adding the first shorter line, or raise an unexpected > End_Error if there is no one. No, Get_Line will read exactly 500 characters, and leave the line terminator in the input stream. The line terminator won't get consumed until the next read. This behavior is why the following idiom for consuming a line of text works: Get_Line (Line, Last); if Last < Line'Last then --we consumed line terminator, too else --we have not consumed the line terminator yet end if; In a sense, you can imagine the that bytes in the range Line (Last + 1 .. Line'Last) hold a virtual line terminator. See my "get_line mystery" article for more info.