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,49f7dd1bad1910ff X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-15 14:59:58 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!skynet.be!skynet.be!louie!tlk!not-for-mail Sender: lbrenta@lbrenta Newsgroups: comp.lang.ada Subject: Re: Problems with Ada.Text_IO and strings. References: <8336eb21.0310131423.7410e1ec@posting.google.com> <1106548.PnMF1M2W6X@linux1.krischik.com> From: Ludovic Brenta Date: 16 Oct 2003 00:00:51 +0200 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 80.200.204.11 X-Trace: 1066255198 reader1.news.skynet.be 15646 80.200.204.11:47169 X-Complaints-To: usenet-abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:924 Date: 2003-10-16T00:00:51+02:00 List-Id: "CheGueVerra" writes: > While I've bookmarked the link you posted, and am very thankfull, the thing > is I don't believe I can use external libs for the homework, But at the same > time if I have a String variable that is declared (1..20) Well, I don't > wnat the user to insert all blank spaces after his(her) name and not one > more because it will enter the buffer of the other string !! I want to > understand, but I guess I'm seeing things to C or C++ like still, and have > to reteach my brain how to think, but it's hard to grasp everything when > your just entering Names and addresses > > CheGueVerra I'm not going to post working code and do your homework for you, but here are hints you may find useful. Hint 1: declare S : String (1 .. 20); Last : Natural; begin Ada.Text_IO.Get_Line (S, Last); -- User's input is S (S'First .. Last) end; Hint 2: if Last = S'Last, then you will want to call Ada.Text_IO.Get_Line again to read the rest of the input, and concatenate this to S. Hint 3: recursive calls are your friends. HTH -- Ludovic Brenta.