For Programmers: Free Programming Magazines  


Home > Archive > Cobol > February 2007 > Help! GO TO and PERFORM THRU!









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help! GO TO and PERFORM THRU!
William M. Klein

2007-02-26, 6:55 pm

It has been a while since I posted a summary of "approaches" to the LOOP with
immediate exist issue - with summary comments on the PHILOSOPHICAL issues with
"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 Europe
while the use of PARAGRAPHS without SECTIONS is more common in the US. (This
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 Standard
(no scope delimiters or inline performs), a (possibly the most common in the
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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com