× 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:10:02 -0700
  • Organization: Conex Global Logistics Services, Inc.

Okay, if I declare a Prototype and Procedure interface, can I still call my
RPG program from the command line?  Or would it always have to be called
from another program?

Prototyping I somewhat understand from C and Pascal, when I would prototype
a subroutine or a function so the compiler wouldn't have to make 2 passes.  But
what is the Procedure Interface for?  Is that just an indicator of my Parm List?
And
if so, is the Prototype required?

And I see you can declare an input variable as a Constant (CONST) which seems
somewhat foreign to my concept of a constant, but if that's the way RPG does it,
I can deal with it.

Thanks so much, Barbara and others that responded, this is exactly the type of
feedback I was looking for.

Regards,

Jim Langston

bmorris@ca.ibm.com wrote:

> >From:    Jim Langston [mailto:jlangston@conexfreight.com]
> >Sent:    Friday, September 24, 1999 11:39 AM
> >
> >I would request critiquing of this program.  That is, I am using D specs to
> >declare my variables, I am using a PLIST to declare my entry parameters
>
> Jim, I would replace the *ENTRY PLIST with a prototype and procedure 
>interface.
> When you call your program from ILE RPG, copy the prototype into the calling
> module and use CALLP to call it.  Lots of advantages to doing this; one
> advantage is that you can get used to using prototyped calls before you have 
>to
> mess with creating modules and other ILE stuff.
>
> /Copy file:
>   |D PGMNAME         PR                    EXTPGM('PGMNAME')
>   |D  Trailer                      10      CONST
>   |D  SCACCode                      4A     CONST
>
> Program source D specs:
>     /COPY prototype
>     * Entry parameters
>    D PGMNAME         PI
>    D  Trailer                      10       CONST
>    D  SCACCode                      4A      CONST
>
> (Code CONST on the parms since they aren't changed by your code.  This allows
> callers to CALLP with literals instead of declaring fields to hold the trailer
> and SCAC code.)
>
> In D specs, I always leave a space between the "D" and the name, and indent
> things like parameters and subfields, to show the relationship between the D
> specs.
>
> Barbara Morris
>
> +---
> | 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
> +---

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

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.