Code Comments
Programming Forum and web based access to our favorite programming groups.It has been a while since I posted a summary of "approaches" to the LOOP wit h immediate exist issue - with summary comments on the PHILOSOPHICAL issues wi th "GO TO and PERFORM THRU". Comments in no particular order. 1) For some (unknown to me) reason, the use of SECTIONS is more common in Eu rope while the use of PARAGRAPHS without SECTIONS is more common in the US. (Thi s may impact the programming style). 2) The '02 Standard introduced "EXIT PERFORM <CYCLE>" syntax which is a good way to exit from within an inline loop. EXIT PARAGRAPH and EXIT SECTION provide similar functionality for performed paragraphs and sections. 3) If one is coding in (or maintaining) programs in the "older" pre-85 Stand ard (no scope delimiters or inline performs), a (possibly the most common in th e US) way to handle "loops" with immediate "problem" exits was something like. : 001-MAINLINE. PERFORM 100-INITIAL-STUFF THRU 100-IS-EXIT PERFORM 200-LOOP THRU 200-LOOP-EXIT UNTIL SOME-CONDITION PERFORM 900-FINAL-STUFF THRU 900-FS-EXIT
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.