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



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.

Sam


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:

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.