For Programmers: Free Programming Magazines  


Home > Archive > Cobol > November 2004 > Re: Infinite Loops and Explicit Exits









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 Re: Infinite Loops and Explicit Exits
Chuck Stevens

2004-11-16, 6:44 pm

Sorry, I garbled my response. Let's try this again:

"Peter Lacey" <lacey@mb.sympatico.ca> wrote in message
news:418A7805.D4C9605D@mb.sympatico.ca...
> If I understand the discussion properly, there's a need for a
> distinction between not performing one iteration of the loop, and
> getting out of it altogether.
>
> EXIT CYCLE resembles EXIT PERFORM in the sense that they both imply
> getting the hell out of there; as such, EXIT CYCLE might be better
> expressed by SKIP CYCLE. Only a suggestion.
>
> PL


The 2002 standard added EXIT PERFORM CYCLE (and EXIT PERFORM -- without
CYCLE), not EXIT CYCLE. CYCLE was added as a *context-sensitive* word in
the 2002 standard (where it is only recognized as "special" in the context
of the EXIT statement).

To provide SKIP CYCLE as new syntax in 2002, it would have been necessary to
add "SKIP" as a reserved word. J4 is reluctant to add new reserved words
unless there's really no other reasonable alternative. That didn't happen,
so what we *now have* in 2002 COBOL is "EXIT PERFORM CYCLE".

Or are you suggesting we should have EXIT PERFORM and EXIT PERFORM CYCLE in
the context of in-line PERFORM (as the 2002 standard now specifies), and
EXIT PERFORM and SKIP CYCLE in the context of out-of-line PERFORM? I don't
think I like that idea all that much ...

-Chuck Stevens


Sponsored Links







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

Copyright 2008 codecomments.com