|
BUZZ! I poop on the do-do's.
Why not...
Key chain(e) file_name
Select
when %status(file_name) = xxxxx Not found
when %status(file_name) = yyyyy Locked
other
(good read logic goes here)
endsl
No GOTO and no misuse of DO. //Besides, this is what you mean!//
Regarding "F" for the use of a GOTO: if you can justify the use of a GOTO
(program readability, logic flow, etc.), you should get an "A".
-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
Behalf Of Troy.C.Dills@blum.com
Sent: Thursday, December 06, 2001 9:40 AM
To: rpg400-l@midrange.com
Subject: RE: Cycle Processing vs. Doing it my way
Amen
I always use Do loops to avoid using a goto. I've always been taught that
goto's were bad.
(In school we got an automatic F for a project that used a "goto") although
there are times
where I wished I could use them, I force myself not to. I know we all have
programming
standards, I prefer using a "Do" and on a specified condition you can
LEAVE the Do
and continue processing. Ex.
Do
Read Custmast
If NOT % FOUND
LEAVE
Endif
continue processing
EndDo
Looks much cleaner than using a goto, make it a lot easier to maintain
also.
Your not having to look for tags and Gotos everywhere. (I have seen and
used both) and yes I think gotos create spaghetti code, it will have you
mind
wrapped around in circles trying to find out how the cycle works.
This is Just my 2 cents.
Thanks
Troy Dills
Julius Blum Inc.
Mike.Collins@syan
.co.uk To: rpg400-l@midrange.com
Sent by: cc:
rpg400-l-admin@mi Subject: RE: Cycle
Processing vs. Doing it my way
drange.com
12/06/2001 09:13
AM
Please respond to
rpg400-l
And what is wrong with LEAVE? It hardly creates spaghetti code as the
program flow is always in the one direction. I like to refer to a LEAVE as
a structured GOTO!!!!!
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.