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


  • Subject: Re: ILE RPG:Is the use of ITER & LEAVE Structured Programming?
  • From: Bob Larkin <blarkin@xxxxxx>
  • Date: Fri, 24 Apr 1998 22:30:17 -0700

1.  DO loops DO NOT exit at the bottom. They exit at the top, the DO is 
basically
an IF with a branch to the statement past the corresponding ENDDO.
2. A LEAVE would exit to the bottom, so by your definition, it is still
structured.

I think what is being missed is the fact that LEAVE and ITER have PREDICTABLE
behavior. With a GOTO, you never know where you will end up, until you locate 
the
corresponding TAG

Of course, if you haven't seen COBOL's ALTER GOTO, you don't know what you are
missing. The ALTER GOTO branches to different locations based on the value of a
variable. The more obscure the variable, the higher your Obfuscation Factor.

Of course, COBOL is a much superior language to RPG (<vbg>).
Ducking before the incoming arrive,
Bob Larkin

Scott Johnson wrote:

> Frank,
>
> I am on your side.  ITER and LEAVE are not structured programming.
> They are just GOTOs in disguise.  Rumor has it that IBM is working on
> another one that will allow a person to leave an subroutine in the middle
> of it. I ask why?  Couldn't their time be better spent elsewhere?  Wouldn't
> this be the same as a GOTO and a TAG??
>
> I view Structured Programming as one entry point/one exit point.
> DO loops are entered at the top and you exit at the bottom.  Same
> with Subroutines.  I just don't like that leaving something in the middle.
> It can make debugging somebody else's code more difficult.
>
> --  My Two Cents Worth
> ------------------------------------------------------
> Scott P. Johnson


begin:          vcard
fn:             Bob Larkin
n:              Larkin;Bob
org:            <A HREF="HTTP://web.wt.net/~blarkin/">Larkin Computer Consulting</A>
adr:            <A HREF="http://web.wt.net/~blarkin/">Bob and Diana's Page</A>;;;Houston;TX;<A HREF="http://web.wt.net/~blarkin/">;United States
email;internet: blarkin@wt.net
title:          Systems Consultant
x-mozilla-cpt:  ;4104
x-mozilla-html: FALSE
version:        2.1
end:            vcard


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.