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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec4cde5d799065b6,start X-Google-Attributes: gid103376,public From: "Heath, Terry D." Subject: Is there an ADA analogue to the C++ continue statement? Date: 1997/09/17 Message-ID: <01bcc32e$350b5ba0$6409868b@gateway>#1/1 X-Deja-AN: 273190205 Newsgroups: comp.lang.ada Date: 1997-09-17T00:00:00+00:00 List-Id: Almost all of my programming is done in C++, and I have never programmed in Ada (my loss!), although I have seen some examples of Ada syntax. I am curious, does Ada have a statement analogous to the C++ continue statement (see immediately below) ? EXAMPLE OF C++ CONTINUE STATEMENT: while (condition-1) { statement-1; if (condition-2) continue; statement-3; } In the above, if condition-2 evaluates to be true, then flow of control is immediately transferred back to the top of the while loop (where condition-1 is then tested for, in order to determine whether iteration of the while loop is to continue). Note, although the word 'continue' might suggest a NOP type instruction (NOP = No OPeration ... just continue forward!), that is not what occurs in C++ (instead, a jump occurs as described in the previous sentence) ... they should have chosen a better name for the statement ! That is, the C++ continue statement has the opposite effect to the Ada exit statement (the former transfers flow of control to the start of the loop construct, whereas the latter transfers control to the end of the loop construct). Certainly, the pattern of execution defined by the pseudo-code above can be implemented by way of traditional structured programming techniques without recourse to a 'continue' type statement such as that above. Nonetheless, I believe the flow of control defined by the pseudo-code above to be consistent with all widely accepted structured programming principles (after all, it is just the reverse concept of that underpinning the Ada exit statement). So, does Ada have a statement analogous to the C++ continue statement ? Thanks in advance, Terry.