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





-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Charles Wilt

* Global figurative constants
* Type relation = aunt
D gA C 'A'

myRelation = gA;


That's just plain silly.

Of course it is. Any advice on how to break the news to the person who wrote it?


I tend to tie the constant value to the field:
d RELATION_AUNT
d c 'A'
d RELATION_UNCLE
d c 'U'


I like that too. I did have the same, but when I saw my code :

TypeRelation = RELATION_AUNT;

I decided to reduce my constant name to AUNT to avoid repetition.

One could argue that a constant should never be local. As
that would allow you to have different definitions of it in
different procedures.
Which defeats the purpose of a constant.

We have one programmer who likes to make everything local where possible. In the case of a constant, it would be changed to global as soon as another procedure needed the same constant.

How about this for a rule ? :
All constants declared directly in the source are local.
All global constants must be in a copy book.

The idea being to use standard definitions wherever possible.

Thanks, Charles.

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.