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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2cb6c27047140e0 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: How to implement a continue statement in Ada? Date: 1998/09/01 Message-ID: #1/1 X-Deja-AN: 386821584 Sender: matt@mheaney.ni.net References: <35EA8153.7BFC91E3@physics.purdue.edu> <35EB6C10.D85EBCF2@physics.purdue.edu> NNTP-Posting-Date: Tue, 01 Sep 1998 08:54:33 PDT Newsgroups: comp.lang.ada Date: 1998-09-01T00:00:00+00:00 List-Id: "Robert T. Sagris" writes: > What I was asking; how would implement the code given, which really is > just a general example, in Ada. Specifically so you could use it any > any loop were you needed to skip an iteration. As has been pointed out, THE way to implement continue in Ada is to use a goto: for I in X .. Y loop if P then goto Continue; end if; <> null; end loop; As Robert pointed out, if you label the loop, then you can include the loop label in the name of the target of the goto (this is a stylistic convention): Paint_House: for I in X .. Y loop if P then goto Continue_Paint_House; end if; <> null; end loop Paint_House;