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,47b871fef9bb1459 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-26 09:37:27 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: string input Date: Mon, 26 Nov 2001 10:11:54 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:16992 Date: 2001-11-26T10:11:54-05:00 List-Id: wrote in message news:GhByriDlSyh1@ludens... > helo > > what can i do if i wanna read user input to a string with > length short (i wanna do it in loop), and user write a > very long string. if it happens the next and the next... > input is filled with that trash of first input... You can either use a loop, and copy the short string into a longer buffer (say, an Unbounded_String); or, you could use a recursive solution. The idiom for reading lines of text in Ada is: declare Line : String (1 .. 10); --say Last : Natural; begin loop Text_IO.Get_Line (Line, Last); exit when Last < Line'Last; end loop; end; That should give you enough info to get started.