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



Hi Joe,

> Thanks Scott.  This makes sense, for the most part.  It's just not very
> intuitive, at least to me, to put in my program an EXTPGM reference to
> itself.  <shudder>

Yes, that seems to bug just about everyone who uses it. :)

However, you have to keep in mind that the concept behind a prototype is
to write it once, put it into a /copy member, and then use it everywhere,
since it makes sure that the parameters match what the program is
expecting.

Once you have it in a /copy member, and you're using the prototype to call
it from other places, suddenly the EXTPGM makes sense.

But, I do agree with you.  I often wish that the prototype was optional
for the main procedure.  I don't often need to call an RPG *PGM object
from another RPG.  (If I was going to call it from another RPG, I'd
have made it a service program in the first place!)  Having to code the
PR, only to call it from a menu or a CL batch program seems more than a
little silly -- especially since you have to hard-code the program name in
the EXTPGM statement.

But, since I can see why they did it, I don't complain. :)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.