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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: After typing input of Integer it SKIPS getting the inputs of String. Date: Sat, 11 Jul 2015 18:36:00 +0300 Organization: Tidorum Ltd Message-ID: References: <4ab70bc8-b25f-4dc4-88d9-d7021c2bed30@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Jo3SoI4//m1X/+MGDXLeLQnAkUCx4+NV0tXYC32ELStC3amIFP Cancel-Lock: sha1:eCSRzLr/ND6lrJUywBXVNQJyHHo= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <4ab70bc8-b25f-4dc4-88d9-d7021c2bed30@googlegroups.com> Xref: news.eternal-september.org comp.lang.ada:26779 Date: 2015-07-11T18:36:00+03:00 List-Id: Flip answer to "question" in Subject: Yes, it does. So what? (That is, you could have been clearer about what you see as the problem, and what your question is.) Better answer below: On 15-07-11 18:14 , Trish Cayetano wrote: > Code: > with ada.Text_IO; use ada.Text_IO; > with ada.Integer_Text_IO; use ada.Integer_Text_IO; > procedure Main is > > > inputText: String (1..10); > inputNmbr : Integer; > StringNatural: Integer; > begin > > Put_Line("Enter Integer"); > Get(inputNmbr,1); The Get operation for integers leaves the "input point" after the last of the characters that form the integer. In this case, that point is before the "end of line" marker for that input line. If you then immediately call Get_Line, it will read characters up to the end-of-line marker, so it will return an empty string. In your program, you evidently expect the Get_Line to start reading from the _next_ line after the line that contains the integer. So insert a Skip_Line between the Get(inputNmbr) and the Get_Line; that will pass the input point over the end-of-line so that the Get_Line starts reading from the start of the next line. > Put_Line("Enter String"); > Get_Line(inputText,StringNatural); -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .