× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 24 Jul 2013 18:38, Luis Rodriguez wrote:
On Wed, Jul 24, 2013 at 3:23 AM, whatt sson wrote:
On 23 Jul 2013 14:09, Scott Schollenberger wrote:
LEAVE command

The Leave (LEAVE) command can be used to exit an active
DOWHILE, DOUNTIL, or DOFOR group. It provides a structured
manner to leave an active group without resorting to the
use of the Goto (GOTO) command.
LEAVE is not valid with simple Do (DO) command groups.

In RPG it is.

A Leave (LEAVE) command without a label will leave the
innermost active DO group.

Specifying a label allows the processing to break out of one
or more enclosing groups.

Wish we had that in RPG so that GOTO is not missed (be me anyway).
Shouldn't be too much to implement in the RPG compiler?


Huh?

Maybe I didn't understand your post well (Spanish is my native
language, so sometimes I make mistakes) but, THERE is a LEAVE opcode
in RPG, as well as ITER, LEAVESR, etc...


<<SNIP>>


The comment was specific to the CL ability to name a LABEL to /leave/ the current nesting level, to a specific outer nesting level; i.e. the "that" referred to the ability of CL to "break out of one or more enclosing groups."

A review of the LEAVE opcode syntax for RPG will show that there is no support to name a label:
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzasd/sc092508959.htm#zzleave

A review of the LEAVE command-statement for CL will show that there is support for a label; the CMDLBL parameter:
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/cl/leave.htm

With the reinsertion of the since-removed contextual details from the prior discussion thread [with corrected indenting\usenet-quoting], hopefully a reread of the above quoted messages helps clarify the response about the comparison between what RPG and CL can do; i.e. what is lamented as missing from RPG as compared with what is allowed within a CLP. The LEAVE of each language is contrasted with the emphasized text [delimited by asterisks] in the two bullets below:

- The LEAVE command-statement of the CL allows specifying a label to enable /leaving/ *more than one* nesting level.

- The LEAVE opcode of the RPG, within a nesting level, the "LEAVE causes control to transfer 'outwards' by *one level* only." The complete quote from the manual suggests "In nested loops, LEAVE causes control to transfer 'outwards' by one level only", but it may intend to imply nested Do-groups vs _loops_ because the LEAVE can be used in a non-iterative DO\ENDDO according to the same poster; i.e. the earlier comment "In RPG it is [allowed to LEAVE a non-iterative Do-group]".


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.