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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9127c759a41fcfda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-05 12:50:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!router1.news.adelphia.net!solaris.cc.vt.edu!news.vt.edu!msunews!not-for-mail From: "Chad R. Meiners" Newsgroups: comp.lang.ada Subject: Re: [ot... well kindof] SDI Date: Mon, 5 Aug 2002 15:46:14 -0400 Organization: Michigan State University Message-ID: References: <5ee5b646.0208040616.77f0460a@posting.google.com> Reply-To: "Chad R. Meiners" NNTP-Posting-Host: arctic.cse.msu.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:27723 Date: 2002-08-05T15:46:14-04:00 List-Id: "chris.danx" wrote in message news:Ynz39.11$5d3.56@news13-win.server.ntlworld.com... >> procedure get_personal_detials (person : out PersonRecord) is > begin > ... -- read person.name and person.address. > loop > begin > put ("enter postcode"); > > get_postcode (person.pc); > exit; -- ??? > exception > when Postcode_Error => Put_Line ("Postcode is ill-formed!"); > end; > end loop; > end get_personal_details > > > My concern is at the line marked "-- ???" the code will just exit the > begin-end block not the loop, is this correct? If so a simple revision > that introduced a flag set after get_postcode would do. Read the Ada Reference Manual Section 5.7 on Exit Statements. When in doubt look up the rules of the language ;) or label your loop. For instance you will find the following nice example in the above section which I think you'll agree is quite helpful in expressing you intentions clearly. Main_Cycle: loop -- initial statements exit Main_Cycle when Found; -- final statements end loop Main_Cycle; -CRM