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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6a85e71d2c330ab,start X-Google-Attributes: gid103376,public From: pumilia@my-deja.com Subject: checking a loop execution Date: 2000/04/19 Message-ID: <8dl76u$etf$1@nnrp1.deja.com>#1/1 X-Deja-AN: 613290945 X-Http-Proxy: 1.0 x24.deja.com:80 (Squid/1.1.22) for client 212.239.48.58 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Apr 19 21:07:55 2000 GMT X-MyDeja-Info: XMYDJUIDpumilia Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.72 [en] (X11; I; Linux 2.2.13 i686) Date: 2000-04-19T00:00:00+00:00 List-Id: 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. I could add a control variable (ivar, in my example) to take care of the iteration number when exiting, but that would decrease the peformance of my algorithm Example procedure loop_test is ivar : integer; begin for i in 1 .. 10 loop if then ivar := i; exit ; end if ; end loop; put(ivar,2); end loop_test; thank you for your suggestions Pol Sent via Deja.com http://www.deja.com/ Before you buy.