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!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: stopping a loop iteration without exiting it Date: Wed, 3 Jan 2018 15:19:49 -0600 Organization: JSA Research & Innovation Message-ID: References: <81971548-23c9-4927-a6a8-6f0f1dba896b@googlegroups.com> Injection-Date: Wed, 3 Jan 2018 21:19:49 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="13636"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:49738 Date: 2018-01-03T15:19:49-06:00 List-Id: "Lucretia" wrote in message news:81971548-23c9-4927-a6a8-6f0f1dba896b@googlegroups.com... > On Wednesday, 3 January 2018 16:54:36 UTC, Mehdi Saada wrote: >> Is there a way to tell to ignore the remaining of a loop ? Like an exit >> statement, but instead of quiting the loop, it would go to the next >> iteration. >> Can we do this except with a recursive structure ? > > You mean like "continue" in C? No, there's no way in Ada, unless you use a > goto > which is stupid. Just structure your loop properly. A "goto" is *not* stupid in this case. It isn't always sensible to restructure a loop to avoid "continue". We looked at adding the feature sometime back (it happens hundreds of times in the GNAT source code), but the decision was that a goto was good enough. (Especially after the syntax change allowing it directly at the end of a loop.) That is: loop ... goto Continue; ... <> end loop; Randy.