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: Matthew Heaney Subject: Re: get_line Date: 1998/06/06 Message-ID: #1/1 X-Deja-AN: 360316709 References: <6lcql0$8qj$1@goanna.cs.rmit.edu.au> Organization: Network Intensive Newsgroups: comp.lang.ada Date: 1998-06-06T00:00:00+00:00 List-Id: Dale Stanbrough writes: > Yes you are correct. I didn't write exactly what i should have, I can > now see! What i should have said is "if you do read in exactly the number > of characters as are in the buffer, then you really don't know what > situation you are in - you can still never tell if a skip_line was > called". I'm still confused by your answer. I'm confused, because you definately can tell what state you're in, if the buffer size is the same as the number of input characters, because the rule for this case is "No, skip line is NOT called." This very issue was the subject of an AI. To determine when you're finished consuming all the text on a line, the definitive test is if Last < Line'Last then else end if; Which is why I said to make the Line'Last greater than the maximum number of input characters: so you can write that predicate. I like to do this: declare Max_Length : constant Positive := ; Line : String (1 .. Max_Length + 1); Last : Natural; begin Get_Line (Line, Last); if Last <= Max_Length then else end if; end; If the user enters Max_Length characters, then all is well, and Skip_Line is called automatically. If the user enters more than max_length characters, then Skip_Line is definately NOT called. This you know, because the language says so.