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: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Something I don't understand Date: Sat, 15 Feb 2014 22:05:43 +0200 Organization: Tidorum Ltd Message-ID: References: <4a3e55f6-9f54-4084-9f37-96efd4b0d349@googlegroups.com> <0b358700-871b-4603-addd-65e07c7d59e5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net F6Xx+M8w1URMxt1RyKdQ3Q3X+4PCnlF2b4R/MR1vuip8hE6dRv Cancel-Lock: sha1:gVavugobS3RCu9lo1wlQR/vi4hI= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <0b358700-871b-4603-addd-65e07c7d59e5@googlegroups.com> X-Original-Bytes: 2478 Xref: number.nntp.dca.giganews.com comp.lang.ada:184885 Date: 2014-02-15T22:05:43+02:00 List-Id: On 14-02-15 21:10 , Laurent wrote: > Hi > > Now it works as I think it should. > > Name : LOOP > BEGIN --exception handler block > Ada.Text_IO.Put ("Name (1 - "); > Ada.Integer_Text_IO.Put (Item => MaxName, Width => 1); > Ada.Text_IO.Put (Item => " characters) >"); You might want to insert Ada.Text_IO.Flush here, to make sure that the preceding Put text appears on the terminal. (I'm not sure if the standard requires an implicit Flush when a Put is followed by a Get.) > DECLARE > S : String := Ada.Text_IO.Get_Line; [snip] > EXCEPTION > > WHEN Name_Too_Short => > Ada.Text_IO.Skip_Line; [snip] > The only thing which I find annoying is the fact that I > have to tape ENTER 2 times. Does that happen only in the exception cases? Then the reason is probably the Skip_Line calls in the exception handlers. They are superfluous because the Get_Line function includes the effect of a Skip_Line (RM 17.2/2) -- it consumes the line terminator. Remove the Skip_Lines. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .