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



No, I am not saying we should go back to GOTO...never....ever...just
pointing out the 'like' functionality that Iter and Leave have with GOTO.

What is the difference between the example I showed in my previous email
or this one: None, the both perform the exact same functionality, why
would one be frowned upon, when the other is praised?

dow 1 = 1
read file
if eof
Leave
endif
... processdata
enddo

I know everyone has a different style of programming. I believe it would
be a boring career if that wasn't true. My personal style is not to use
Iter or Leave op codes, is that correct, yes is some minds and no in
others.


Jeff Davis
Programmer
Dental Network of America
2 Transam Plaza Drive, Suite 500
Oakbrook Terrace, IL. 60181
630.691.0336




"Marvin Radding" <marvin.radding@xxxxxxxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
01/09/2009 01:35 PM
Please respond to
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>


To
rpg400-l@xxxxxxxxxxxx
cc

Subject
RE: Good places to use "The Cycle" in today's RPG






Jeff,

I have to disagree with your 3rd point. Are you proposing that we go back
to GOTO?

Using leave or iter is good structured programming. It allows the program
to exit the loop (in the case of leave) or to start the loop over (in the
case of iter). It also means that someone reading the program doesn't have
to look for a tag to make sure the GOTO was meant to exit the loop or
start the loop over, that is inherent in the operation code. These codes
are simpler and easier to understand because of how they work. With a GOTO
you don't know what it does until you find the tag.

Thanks,

Marvin

------------------------------

message: 3
date: Fri, 9 Jan 2009 13:05:50 -0600
from: jdavis@xxxxxxxx
subject: RE: Good places to use "The Cycle" in today's RPG was->Re:
FW: Niftiest thing(s) you have done in RPG ILE or /FREE

That is a maintence nightmare for most new programmers. Lets code an
endless loop and make you figure out when I want to terminate it with the
leave.

IMHO,1 should never code an endless loop DOW 1 = 1......not very
documenting
2 Leave and Iter are limited varations of a GOTO, but not
GOTOS themselves. I can make a GOTO/TAG do the same thing as a Iter or
Leave ( would that be ok then?)

dow 1 = 1
read file
if eof
Goto End
endif
... processdata
enddo
Tag End

3 Leave and Iters just show that the programmer didn't want or
have the time to properly figure out the loop termination points


Jeff Davis
Programmer
Dental Network of America
2 Transam Plaza Drive, Suite 500
Oakbrook Terrace, IL. 60181
630.691.0336




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.