×
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.
On 12/28/13 11:05 AM, D*B wrote:
... if I would recommend the same, others did, my post would have
been obvious! Making only partial use of procedures, does have nearly
no benefit. Go the road to the end, or stay, where you are!
In the first place, ILE procedures work almost exactly like FORTRAN
subroutines, whereas RPG subroutines work exactly like BASIC subroutines.
If you've had a proper education as a programmer, which requires
exposure to as many programming languages as possible, then you know
that THE ONLY THINGS UNIQUE TO RPG are (1) The Cycle, (2) classic RPG
syntax (which really isn't that far off from some assembler languages),
(3) the degree of integration with record-level access (including
under-the-covers things like scatter-gather I/O), and (4) the ease of
calling external programs.
Of course it's useful to encapsulate code into procedures and functions,
with their own local variables, even if it's never shared between
programs. Just as of course it's useful for a program to ride The Cycle,
even if it doesn't have any level breaks, or secondary files, and even
if it doesn't have a primary file (The Cycle makes a great "event-loop"
for interactive, terminal-based programs; just slave LR to your F3
and/or F12 indicators.
The ability to pass parameters means you avoid having to manually move
data in and out of where the subroutine expects to find it. And using
local variables means you don't have to double-check global variables to
avoid side effects (even if, as I said before, that also means that
converting subroutines to procedures can break a program that depends on
side effects).
--
JHHL
As an Amazon Associate we earn from qualifying purchases.