× 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: rob@xxxxxxxxx
  • Date: Wed, 28 Mar 2001 10:48:18 -0500


Thank you Barb!  I wasn't getting exactly how the conditional compilation
worked.  Your example was very clear and should be included in the manual.

Rob Berendt

==================
Remember the Cole!


                                                                                
                                       
                    bmorris@ca.ibm.co                                           
                                       
                    m                        To:     RPG400-L@midrange.com      
                                       
                    Sent by:                 cc:                                
                                       
                    owner-rpg400-l@mi        Subject:     Re: Naming /copy 
prototype members.                          
                    drange.com                                                  
                                       
                                                                                
                                       
                                                                                
                                       
                    03/27/01 04:49 PM                                           
                                       
                    Please respond to                                           
                                       
                    RPG400-L                                                    
                                       
                                                                                
                                       
                                                                                
                                       





Date: Mon, 26 Mar 2001 11:15:46 -0500
From: rob@dekko.com
> ...
>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, what you have is good, except as Anton says, use the EXTPGM keyword
if you want your callers to call this as a program.

I think it's a good idea to put the *ENTRY-PLIST comment right by the PI.
I try to do that too, leave a comment if I know someone (maybe me) will
be scanning for something that I've replaced.

I don't know if it's worth it, but you can keep the prototype in the same
source file and allow other modules to just copy the prototype using
directives several ways.  Here's one.

 /if not defined(prototypesOnly)
H ...
F ...
 /endif
 * Beginning of shared source also used for /COPY by other modules

D XYZ123         PR           EXTPGM('XYZ123')
D   parms ...
 * End of "/copy" part

 /if defined(prototypesOnly)
 /eof
 /endif

D XYZ123         PI
D   parms ...

 /define prototypesOnly
 /copy other prototype files
 /undefine prototypesOnly
...the rest of your module

Don't forget to code CONST for your parameters when it makes sense.

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


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.