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


  • Subject: Re: RPG IV program - comments requested
  • From: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Fri, 24 Sep 1999 13:16:45 -0700
  • Organization: Conex Global Logistics Services, Inc.

I *think* I understand...

A prototype tells the compiler how to expect the program to be called, so that
when it is compiled it only has to make one pass, instead of two.

And then, the Program Interface is the declaration of how it is being used.  I
understand it, because it is done in PC languages extensively, such as C and
Pascal.

The Prototype is only needed for the compiler, if you had many callable
subroutines
in your source code, you would put all the Prototypes at the top, but put each
program
interface by each subroutine?  Wait, that doesn't make since, since all D specs
have
to be declared at the top of code anyway!

Also, I don't think it would be a good idea, if using the /COPY, to use external
definitions for the prototype, since another program that /COPYes the file in 
may

not use the same files, so won't have the definition for the variable.

Am I right in all this?  Since this is all new to me anyway.

Regards,

Jim Langston

Peter Dow wrote:

> Can someone please explain why the repetition between the prototype and
> procedure interface? The ILE RPG manual has the following definitions:
>
> "A prototype is a definition of the call interface."
>
> "A procedure interface definition is a repeat of the prototype information
> within the definition of a procedure."
>
> Why all the repetition? Assuming there's a reason, then I suppose IBM's
> recommendation for using COPY's is a good one, although I have not used
> those for years because they tended to make it difficult to find a statement
> number in source code from the one given in an error message, a problem
> which cropped again when I started using ILE RPG. In most cases now it is
> necessary to use STRDBG to find the actual statement in the source code
> given a statement# in an error message.
>
> Also, aren't external definitions preferable? As in:
>
> D*  First the prototype
> Dprogramname      pr
> DTrailer                                              LIKE(BSXTRL)
> DSCACCode                                    LIKE(SCACCode)
> D* Now the procedure interface
> Dprogramname      pi
> DTrailer                                              LIKE(BSXTRL)
> DSCACCode                                    LIKE(SCACCode)
>
> Regards,
>  Peter

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