× 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.



that is so unfair...

a procedure with nested loops is not poorly structured





Thanks,


Jay Vaughn
iSeries Senior Programmer/Analyst
RateWatch
jayv@xxxxxxxxxxxxxx
251-633-8929


-----Original Message-----
From: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
Date: Fri, 01 Jun 2007 12:41:50 -0500
Subject: Re: rpgiv optcode to leave loopS


I know LEAVE will take you out of the current loop you are in... is
there an opcode to take you out of ALL loops you may be in?

I'm probably going to regret taking your question literally, but... if
you really want to break out of all loops, do ENDJOB OPTION(*IMMED)

If you only wanted to break out of the ones in the current activation
group (as opposed to the whole job) use CEETREC()

If you wanted to break out of all of the ones in the current procedure
(or program, if this is a UEP) then use RETURN.

If you wanted to break out of only the loops inside a given subroutine,
use LEAVESR.

If you wanted to break out of nested loops without even exiting the
subroutine, use GOTO.

Or better yet, do a better job of structuring your loops and your
program so that you don't need to do things like this!!

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.