×
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.
David;
From your description I would be annoyed by your style also because of one point "In these cases I will use global variables unless not possible."
IMO a procedure should not be using global variables unless it is not possible to avoid otherwise (pre-6.1 file fields etc... or other specific circumstances). All you've done is create a subroutine and thrown a prototype on it, more work for no gain.
Duane Christen
--
Duane Christen
Senior Software Engineer
(319) 790-7162
Duane.Christen@xxxxxxxxxx
Visit PAETEC.COM
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: Monday, March 01, 2010 4:44 AM
To: RPG programming on the IBM i / System i
Subject: More on RPG style
Hi,
I tend to divide my code into subprocedures in a program just to improve readability, even when there is very little risk of that subprocedure being called from anywhere else. Each subprocedure will correspond to a specific task executed by the program.
Eg,
/FREE
IF not doThis ( )
RETURN
ENDIF;
IF NOT DoThat ( )
RETURN
ENDIF;
/END-FREE
In these cases I will use global variables unless not possible. That leaves me with a load of one line prototype declarations in my code :
D doThis PR
D doThat PR
I've just discovered that this style seems to annoy at least one programmer who prefers to see all the code in one main procedure and does not like to see all those PR's PI's and returns, etc. Rather embarassing.
Am I justified in coding in this way or am I wrongly using subprocedures?
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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.