|
Second. Your correct on this. I just copied this from an example I
found (not that I really understood it) so this was just a typo.
(The quality of English on this list is appalling "Your correct on this"
is syntactically incorrect. It should be "You're correct on this".
Jeez)
I remember getting slammed by Simon for exposing this technique (whichcopy
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.
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
additionalthe prototypes out of your module source without the use of an
listcopybook member like so:--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
listTo 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.
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
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 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.