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,459feef56669b92d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-03 02:55:24 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: "continue/next" for "loop" Date: Mon, 3 Nov 2003 10:55:24 +0000 (UTC) Organization: PVV Message-ID: References: NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1067856924 29736 129.241.83.82 (3 Nov 2003 10:55:24 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Mon, 3 Nov 2003 10:55:24 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:1957 Date: 2003-11-03T10:55:24+00:00 List-Id: On 2003-11-03, Preben Randhol wrote: > On 2003-11-03, Lutz Donnerhacke wrote: >> I might be out of coffee, but I do not find an elegant way to skip the rest >> of a loop body for the current cycle other than using "goto". >> >> with Ada.Text_IO; use Ada.Text_IO; >> >> procedure t is >> begin >> for j in 2 .. 8 loop >> for i in 2 .. 8 loop > >> if i mod j = 0 then -- Assume complex statements here. >> goto next; -- In my real case, it's another loop, >> end if; -- which detects the end of current path inside. >> Put(i'Img); >> <> null; > > You cannot do: > > if i mod j != 0 then ARG! if i mod j /= 0 then Been reading C sources :-( -- "Saving keystrokes is the job of the text editor, not the programming language."