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



No, it's pretty easy...

One thing to consider, what happens if you've got this today

d cSUCCESS c '00000'

and tomorrow you what to start using constants in a module that needs
d cSUCCESS c ' '

So you might want to be a bit more specific...
d cSQL_STATE_SUCCESS...
d c '00000'

and group related constants using a prefix
d cSQL_STATE_CURSOR_NOT_OPEN...
d c '24501'

d BUSINESS_TYPE_FIRSTAID...
d c '01'
d BUSINESS_TYPE_FIRE...
d c '02'

d EXCHANGE_TYPE_HYDRO...
d c 'H'
d EXCHANGE_TYPE_INTERNAL...
d c 'I'

Finally, a piece of advice...when defining your constants, get in the
habit of always using two lines. That makes it easier to rename it 10
minutes later when you think of a better name. :) Plus I think it
looks better if they are all two lines.

HTH,
Charles

On Wed, Nov 10, 2010 at 3:43 AM, David FOXWELL <David.FOXWELL@xxxxxxxxx> wrote:
I'm writing my own source member with my own constants, so that each time I need a constant I will be able to copy from that member into the member I am editing. That way I'm sure to use the same names and hopefully gain some time. You've guessed it, we aren't putting our constants in copybook members. We do have one copybook member that contains a lot of general constants with no particular relation to each other. Here's an example :

     * No
    D cNo             C                   CONST('N')

Apart from the constant itself, don't you just love the comment?

When I have completed my own copybook members, I'd like to propose that everyone uses them. This will let us standardize the names. And then we would(should) no longer see things like :

D cRD4            C                   CONST('RD4')

But instead :

D cCLIENT_CODE_FOOTSIZE...
D                 C                   'RD4'

Now, when the copybooks are ready, I think they could just be added to each module that is currently being modified. My question is, this seems so easy and natural to do. Am I missing something?
--
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.