|
Peter, Just to clarify:- The procedure interface is the equivalent of the *ENTRY PLIST with the addition that the compiler will validate it. The validation is performed by comparing the definition of the procedure interface (PI) against the definition in the prototype (PR). On the same basis, in a calling module the compiler will validate the call statement (CALLP or EVAL) against the definition in the prototype. Hence, since the prototype will be required in many modules (each calling module and the module in which the called procedure exists) it is best to have only one copy of it and include it where required, using /COPY. The reason that the compiler does not look at the called program is that the called program may not yet exist. The validation is performed on the CRTRPGMOD. I amn't quite sure that the version of the /COPY is an issue. If you are using the wrong version, the module will not be created. Paul Tuohy Peter Dow wrote: > Thanks David. But why does the one program that has the procedure interface > also need the prototype? In fact, why call it two different things at all? > My first thought when I saw all that was why doesn't the compiler simply > look at the called program to determine the prototype (after all, I don't > have to have a prototype for a BIF, and I'd prefer some sort of external > definition) but I suppose it keeps the compiler simpler and helps the > programmer to see it documented. > > A problem with using /COPY's to define prototypes is that there is no > reference in the program indicating which version of the /COPY was used when > the program was compiled. Which is one of the nice things about > externally-defined files. > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.