I like it!
Steve Needles
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Denis Robitaille
Sent: Friday, June 09, 2017 2:58 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: Get a definition for a constant in a source member into a CL program
You can define your constant for RPG and CL in the same source member. Just make sure that the RPG constant looks like a comment in CL and vice versa.
Here is an example:
/* d @Active c 'A' */
/* */ DCL VAR(&ACTIVE) TYPE(*CHAR) LEN(1) VALUE('A')
The /* and */ in the RPG part are in column 1 and 81 so that they are ignored by the RPG compiler but considered as comments by the CL compiler
The /* */ start in column 6 so there is a * in column 7. The RPG compiler will consider the line a comment but the CL compiler will treat it
You still have to define your constant in both RPG and CL syntax, but they would be in a single member and grouped together which would ease maintenance.
How's that for a Friday.
Denis Robitaille
Chef de service TI - Solution d'entreprise Infrastructure et opérations
CASCADES CENTRE DES TECHNOLOGIES
412 Marie Victorin
Kingsey falls(Québec) Canada J0A 1B0
Tél : 819 363 6100 Poste :52130
Cell : 819 352 9362
-----Message d'origine-----
De : MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de Jeff Crosby
Envoyé : 9 juin 2017 15:30
À : Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Objet : Get a definition for a constant in a source member into a CL program
Off the wall question for a Friday.
I've got a source member full of constant definitions that I copy into hundreds of RPG programs. Here's a small sample:
* Active/deleted/suspended
D @Active C 'A'
D @Deleted C 'D'
D @Reinstate C 'R'
D @Suspended C 'S'
D @Update C 'U'
Makes code a lot more readable. I literally have hundreds of these constants. If I want a change, all I have to do is change it here, recompile any RPG programs that use the particular one I changed, and I'm done.
I have a situation now where I'd like to use one in a CL program. I know I could make an equivalent member for CL and copy _that_ into CL programs, but that defeats the purpose of having a constant defined in one and _only_ one place.
I'm not coming up with any slick way. Maybe there isn't any. Or else it's above my pay grade. Any ideas jump out?
Thanks.
--
Jeff Crosby
VP Information Systems
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
www.dilgardfoods.com
The opinions expressed are my own and not necessarily the opinion of my company. Unless I say so.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/midrange-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
CONFIDENTIAL: The information contained in this email communication is confidential information intended only for the use of the addressee. Unauthorized use, disclosure or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by return email and destroy all copies of this communication, including all attachments.
As an Amazon Associate we earn from qualifying purchases.