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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e89e4fc8b5c5f198 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: get_line Date: 1998/06/18 Message-ID: #1/1 X-Deja-AN: 363951610 References: <6lbg7h$nnv$1@goanna.cs.rmit.edu.au> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1998-06-18T00:00:00+00:00 List-Id: In article Matthew Heaney writes: > The test to make sure all of the text on the line has been > consumed is > Last < Input_Buffer'Last > which means "you have read all the text on the current line." > To use this predicate, you'll have to make your buffer size 1 more than > the advertised maximum. There is another (non-obvious) way to do this which doesn't require the odd buffer size: Text_IO.Get_Line(Some_Buffer,Length); if Ada.Text_IO.Col(Ada.Text_IO.Current_Input) /= 1 then -- Skip Line was not called. Ada.Text_IO.Skip_Line; end if; This always works, assuming that the buffer is of non-zero length, because Skip_Line always sets the column to one. (Incidently there is a typographic error in the RM at A.10.5(27), at least in the versions I have. The indentation is incorrect. The paragraph should be outdented to full width as it is in Ada 83 RM 14.3.4(26).) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...