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



That was it thanks, nice to read it again!

2011/7/1 CRPence <CRPbottle@xxxxxxxxx>:
  Ignoring the archive search [capabilities]...

  A google web search with the following tokens and site-specific
clause [to include only the archive site] yielded the first link
included below, from which the second link to the thread on the archives
was found:

      simon include defined prototype dave OR foxwell OR david
site:midrange.com

http://archive.midrange.com/midrange-l/200802/msg01387.html
http://archive.midrange.com/midrange-l/200802/threads.html#01387

  Perhaps that was the thread?

Regards, Chuck

On 30-Jun-2011 23:43 , Dave wrote:
I remember getting slammed by Simon for exposing this technique
(which I still use), maybe 4 years ago. I haven't been able to find
it in the archives. I notice you can no longer sort the archive
search results on time ascending. Also, when I click on next or
previous by author, I get a post written by someone else.

2011/7/1 Sam_L<lennon_s_j@xxxxxxxxxxx>:
Below is the technique I use, where there is only *one* source
member in QRPGLESRC, that of the service program, including
prototype and code. No additional source member for the prototypes
is needed.

I assume that the service program is fairly static after being
written and thus will be compiled infrequently, but will be bound
to other program more frequently.

So,those doing the compile and binding to other program do not have
to do anything, except code a /include pointing to the source of
the service program. Their compile will pull in just the prototypes
and ignore everything else, because the compiler directive is not
set.

If the service program has to be compiled, then you need a
compiler directive, but that is easy to set up with WDSC (Compile,
Work with Compile commands), or I suppose a user command in PDM. It
is also easy to set up with our source control system, which
remembers how the source should be compiled.

If anyone sees any drawbacks with this technique I'd like to know.

Sample stripped source of QRPGLESRC/SRV_DATE shown below. Hopefully
it will wrap correctly.

I use /include because there was a problem with the SQL
precompiler, though it is probably fixed by now.

       /if defined (CompileSRV_DATE)
      h nomain option(*NoDebugIo)
       *=====================================================
       * To use, include these lines in your program:
       *    H Bnddir('SRV_DATE')
       *     /include QRPGLESRC,SRV_DATE
       /endif
       *=== Prototypes for Exported SRV_DATE routines =======
       *    (This is copied into the user's code )
      D MthName3        PR             3a
      D InMth                          2p 0 Const
      D MthName         PR             9a   varying
      D InMth                          2p 0 Const
      D GetDOW          PR             1P 0
      D InDate                          d   Const DatFmt(*ISO)
      D DayName         PR             9a   varying
      D InDay                          1p 0 Const
       *=== End of Prototypes for Exported SRV_DATE routines
       /if not defined (CompileSRV_DATE)
       /eof
       /endif

      P MthName3        B                   export
      D                 PI             3
      D InMth                          2p 0 Const
      D wkMth           s                   like(MthName3)
       /free
        monitor;
            wkMth = G_MonthNames3(InMth);
            on-error;
            wkMth=%char(InMth);
        endmon;
        return wkMth;
       /end-free
      P MthName3        E


On 6/30/2011 11:22 AM, BButterworth@xxxxxxxxxxxxxx wrote:
Another option is that with the use of compiler directives, you
can copy the prototypes out of your module source without the use
of an  additional copybook member like so:
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




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.