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

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.