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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: "Dr Richard A. O'Keefe" Subject: Re: How to implement a continue statement in Ada? Date: 1998/09/01 Message-ID: <35EB7036.5585@atlas.otago.ac.nz>#1/1 X-Deja-AN: 386669607 Content-Transfer-Encoding: 7bit References: <35EA816A.E11FEA85@physics.purdue.edu> Content-Type: text/plain; charset=us-ascii Organization: Department of Computer Science, University of Otago Mime-Version: 1.0 Reply-To: ok@atlas.otago.ac.nz Newsgroups: comp.lang.ada Date: 1998-09-01T00:00:00+00:00 List-Id: Robert T. Sagris wrote: > I was wondering if there is a general way of implementing > the behavior of C's continue statement in Ada. > > If at all possible without using a goto statement. Will you accept an 'exit'? Loop statements can have names (LRM 5.5). But so can blocks (LRM 5.6). The general C form for (init; cond; updt) stmt can be converted to begin init; Loop_All: while cond loop Loop_Body: begin stmt end; updt; end loop end; 'break' => exit Loop_All; 'continue' => exit Loop_Body; Obvious simplifications apply to particular cases.