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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b6f6d8ca2974313b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-25 17:51:42 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!library.ucla.edu!csulb.edu!paris.ics.uci.edu!ucivax!gateway From: kanderso@mabillon.ICS.UCI.EDU (Ken Anderson) Subject: Re: Easy ADA question from a hapless Newbie Message-ID: <9410251405.aa17336@paris.ics.uci.edu> Newsgroups: comp.lang.ada References: <38jl8h$rqb@columbia.acc.brad.ac.uk> Date: 25 Oct 94 21:07:47 GMT Date: 1994-10-25T21:07:47+00:00 List-Id: In comp.lang.ada you write: Hi Adam, >Can anyone help me? I'll give it a shot. > Is there a way of ending a loop such as a while loop, etc, by jumping to the > end of that loop. There used to be a command in Pascal that would let you > do this. I think it was something like stop. I know that halt stopped the > entire program. You are looking for the exit statement. declare A : INTEGER := 1; begin loop exit when A > 5; A := A + 1; end loop; end; This code will increment A until it is greater than 5 at which time it will exit the loop. Note, the when clause is optional. You could also right. declare A : INTEGER := 1; begin loop exit; A := A + 1; end loop; end; In which case A would never be incremented, although it doesn't make sense in this code, there are situations where the exit statement without a when clause is useful. Hope this helps, Ken P.S. >I'm new to ADA, used to PASCAL. Just a quick comment, its Ada not ADA. ADA is an acronym like the American Dental Association. P.P.S. One additional comment, not a criticism, but when sending text to a USENET newsgroup be sure to type a return every 80 or so characters. This helps those of us who have to read news on a VT100 terminal. :) -- -------------------------------------------------------------------------------- -Ken Anderson Ken_Anderson@acm.org U.C. Irvine- - "A knowledge of C is probably better than nothing." -- J.G.P. Barnes - - Finger kanderso@ics.uci.edu for PGP Public Key - --------------------------------------------------------------------------------