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



This is not a technique that I personally use these days - but the article was written in part to respond to clients who were complaining about having to have "extra" source files to worry about.

I think it has a place in shops that are resistant to the introduction of subprocedures - particularly when they are also stuck with SEU. In RDi you see the protos anyway in the Outline view - but in SEU it takes more work to see them if they are in a separate source member which makes it harder for newbies to understand why the compiler is complaining about the parameters being used.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Sep 12, 2017, at 5:40 PM, Dan <dan27649@xxxxxxxxx> wrote:

So, I'm on a runaway train now with service programs, taking time off-hours
(I'm a contractor) to learn all of this stuff, and now stumbling onto
conditional compiler directives.

I've always disliked the idea of keeping prototypes in their own source
file, usually QPROTOSRC. So, while I was searching for information on how
to use /DEFINE, /IF DEFINED, etc., I found Jon and Susan's article at
http://ibmsystemsmag.com/ibmi/developer/rpg/iseries-extra--using-conditional-compiler-directiv/?page=2
and opened up "Code Sample 1" (pasted below), which appears to be an answer
to avoiding QPROTOSRC files. My question: Is anyone actually using this
technique? If anyone has considered using it, but decided not to, can you
explain why?

- Dan

* Source member EndOfMonth
* Ignore H-spec if only processing prototypes
/If Not Defined(OnlyProtos)
H DatFmt(*ISO) NoMain
/EndIf

D EndOfMonth Pr D DatFmt(*ISO)
D WorkDate D DatFmt(*ISO) Value

* If prototypes is all we want, then
* skip straight to end of file
/If Defined(OnlyProtos)
/EOF
/EndIf

P EndOfMonth B
D PI D DatFmt(*ISO)
D WorkDate D DatFmt(*ISO) Value

* Working variables
D DayNo S 3P 0

* Advance the input date (WorkDate) by one month

C AddDur 1:*M WorkDate

* Subtract day number from result to reach last
* day of previous month

C Extrct WorkDate:*D DayNo
C SubDur DayNo:*D WorkDate

C Return WorkDate

P EndOfMonth E
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


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.