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,f6a85e71d2c330ab X-Google-Attributes: gid103376,public From: Andreas Schulz Subject: Re: checking a loop execution Date: 2000/04/20 Message-ID: <38FEA052.8DA1E8F2@nord-com.net>#1/1 X-Deja-AN: 613464768 Content-Transfer-Encoding: 7bit References: <8dl76u$etf$1@nnrp1.deja.com> X-Accept-Language: de Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@iradj.is-bremen.de X-Trace: iradj.is-bremen.de 956211442 24764 195.90.19.74 (20 Apr 2000 06:17:22 GMT) Organization: frei & daheim Mime-Version: 1.0 NNTP-Posting-Date: 20 Apr 2000 06:17:22 GMT Newsgroups: comp.lang.ada Date: 2000-04-20T06:17:22+00:00 List-Id: pumilia@my-deja.com schrieb: > > Is there a way to check if a loop has been exited before completion or > if all iterations have been performed? > In fortran the loop index is increased one last time, at the end of > the loop, but in Ada that trick cannot be exploited; the index is not > even defined outside the loop. If you want too use its value outside the loop, you might try a while-loop instead : > procedure loop_test is > ivar : integer :=1; > > begin while ivar <= 10 loop if then > exit ; > end if ; ivar := ivar + 1; > end loop; > put(ivar,2); > end loop_test;