Re: Perform loop enhancements
From: Chuck Stevens (charles.stevens_at_unisys.com)
Date: 10/28/04
- Next message: Howard Brazee: "Re: Report enhancements"
- Previous message: Lueko Willms: "Re: Report enhancements"
- In reply to: Howard Brazee: "Perform loop enhancements"
- Next in thread: Richard: "Re: Perform loop enhancements"
- Reply: Richard: "Re: Perform loop enhancements"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 28 Oct 2004 10:19:48 -0700
"Howard Brazee" <howard@brazee.net> wrote in message
news:clr6k5$ra8$1@peabody.colorado.edu...
>
> On 28-Oct-2004, "Chuck Stevens" <charles.stevens@unisys.com> wrote:
>
> > I agree that an out-of-line indefinite PERFORM pretty much requires
either
> > the despised GO TO or the prohibited EXIT PERFORM, but I'm not really
> > opposed to relaxing the restriction on the latter, unless someone
convinces
> > me that there's a good reason why it's there. .
>
> The question here is what would an EXIT PARAGRAPH do. I was assuming it
would
> do the same thing as an EXIT PERFORM does in an in-line perform.
"The execution of an EXIT PARAGRAPH statement causes control to be passed to
an implicit CONTINUE statement immediately following the last explicit
statement of the current paragraph, preceding any return mechanisms for that
paragraph." EXIT PARAGRAPH would NOT terminate the execution of an
out=of-line PERFORM, it'd just bypass the code that might have been executed
from the point at which it occurred to the end of the perform range.
> Some languages have two types of exits to their equivalents of performs.
> 1. Skip the rest of this iteration of the perform-loop and go to the
next
> iteration
> 2. Skip the rest of this iteration of the perform-loop and exit the
perform
> altogether.
>
> Both of these are useful tools, and both should be considered when
proposing
> this change.
>
> EXIT-CONTINUE anybody?
For out-of-line PERFORMs, the first can be handled by proper structure of
the code and EXIT PARAGRAPH; I'd be inclined to allow EXIT PERFORM in
out-of-line PERFORMs which I'd expect to provide the second. Again, given
all the enhancements to EXIT that went into the 2002 standard, I'm at
somewhat of a loss as to understand why this wasn't allowed in the first
place, unless it was intended as a "toe in the water" approach to the
construct to make sure it didn't fall over and break something.
Certainly I don't see a problem with allowing EXIT PERFORM in our
implementation; we were doing EXIT HERE in COBOL(68) as an extension back in
the Dark Ages (maybe mid 1970's?). In response to complaints that we
couldn't do the same thing in COBOL74, I added EXIT PERFORM in 1987 (using
the syntax proposed for the post-1985 standard) and haven't seen a single
indication of a failure involving it since.
-Chuck Stevens
- Next message: Howard Brazee: "Re: Report enhancements"
- Previous message: Lueko Willms: "Re: Report enhancements"
- In reply to: Howard Brazee: "Perform loop enhancements"
- Next in thread: Richard: "Re: Perform loop enhancements"
- Reply: Richard: "Re: Perform loop enhancements"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|