× 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: Naming /copy prototype members.
  • From: Paul Tuohy <tuohyp@xxxxxxxxxxxxx>
  • Date: Tue, 27 Mar 2001 10:01:35 +0100

Rob, after re-reading my last post - and after getting a prod from Jon Paris. I 
would
just like to clarify that my comments re "one member per protptype" applied 
only to
external program calls - not to procedure calls. For procedure calls you should
bundle as many prototypes as possible into the one copy member.

It would be nice if you could do the same with PRs for external calls, and you 
may
well be able to if you are a one or two man operation. This has more to do with 
ease
of conversion and ease of maintenance. If you have one copy member for a group 
of
external program calls, it is going to see a lot of changes from a lot of 
different
programmers - because they are
all working on different programs.

Now procedures are a totally different matter. Generally, a programmer will 
work on a
set of related procedures (APIs) and therefore easily write and maintain the 
copy
member for the PRs.

Not a hard and fast rule this. If I am writing a set of related programs and can
easily put all the PRs in one member - I will.

Paul

Paul Tuohy wrote:

> Hi Rob,
> Since you are talking about prototypes for external programs, I would 
>recommend
> that you:-
>
>     - have one member per prototype
>     - place the prototype member in a different source file (QPROTOSRC or
> whatever)
>     - give the member the same name as will be used on the CallP.
>
> Just to explain the last bit.
>
> Your prototype will need the EXTPGM keyword to identify an external call. So 
>your
> example should be
>
> D XYZ123          PR                    EXTPGM('XYZ123')
> D  PhoneNbr                     15A
> D  Faxing#                      30A
>
> But, since you are using this keyword, you can give the procedure a more
> meaningful name
>
> D PhoneNos        PR                    EXTPGM('XYZ123')
> D  PhoneNbr                     15A
> D  Faxing#                      30A
>
> So the call would be CallP      PhoneNos(Phone:Fax)
>
> HTH
>
> Paul Tuohy
>
> rob@dekko.com wrote:
>
> > Ok, so I decide I want to create prototypes for external programs.  I want
> > to use /copy.  I thought of having a separate member for each programs
> > prototype.  If I do this what should the member name be?  Or is this
> > something better handled by Conditional Compilation?
> >
> > For example, let's say we have the program XYZ123.  And this program had:
> > C     *ENTRY        PLIST
> > C                   PARM                    PHONE            15
> > C                   PARM                    FAX#             30
> >
> > Now I change this to:
> > D XYZ123          PR
> > D  PhoneNbr                     15A
> > D  Faxing#                      30A
> >  * Replaces *ENTRY PLIST
> > D XYZ123          PI
> > D  Phone                        15A
> > D  Fax#                         30A
> >
> > Now, to make this easier for other developers do I move
> > D XYZ123          PR
> > D  PhoneNbr                     15A
> > D  Faxing#                      30A
> > to another member, perhaps named XYZ123P, and end up with
> > /copy mylib/qrpglesrc,xyz123p
> >  * Replaces *ENTRY PLIST
> > D XYZ123          PI
> > D  Phone                        15A
> > D  Fax#                         30A
> >
> > Or is it better to leave the PR in XYZ123 and use conditional compilation
> > to just pull in the prototype?  If so, how?
> >
> > I try to put the comment * Replaces *ENTRY PLIST, in there for the people
> > who scan for this.
> >
> > Rob Berendt
> >
> > ==================
> > Remember the Cole!

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