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



Another really good idea to define all these shared literals in one place.
Of course, mixed language environments compilcate things, so maybe one place
per language. At any rate, having a few places where '32' is given a name
is better than 100's or 1000's references to '32'.


On 5/3/07, Alan Shore <AlanShore@xxxxxxxx> wrote:

Brian - I agree with your thought process, but over time, I have found
there is one problem with this idea.
To you, Acct_type 32 is defined as DEAD-BEAT, but to someone else
Acct_type
32 is defined as DEFUNCT_TYPE, therefore a search on DEFUNCT will result
in
nothing found, and therefore a search of 32 is then required.
By itself - no great shakes, but somewhat irksome.



Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx
"If you're going through Hell, keep going" - Winston Churchill

rpg400-l-bounces@xxxxxxxxxxxx wrote on 05/03/2007 10:30:28 AM:

> Named literals avoid the magic number anti-pattern. What does these
> statements mean:
>
> if status_code = 32
> return
> endif
>
> if acct_type = 32
> ...
> endif
>
> What the heck is 32? Are both 32's the same thing?
>
> Compare to this
>
> d EXIT_KEY_PRESSED C 32
> d DEAD_BEAT C 32
> ...
>
> if status_code = EXIT_KEY_PRESSED
> return
> endif
>
>
> if acct_type = DEAD_BEAT
> ...
> endif
>
> Now the code is much clearer. And, if you want to locate code that
> processes dead-beat accounts, it is ead to find. If you search for 32,
you
> have to examine each reference and decide if it is account type or some
> function key thing.
>
>
>
> On 5/3/07, Raby, Steve <agnictsr@xxxxxxxxxxxxx> wrote:
> >
> > You can run but you cannot hide, retribution will be upon you!!!!
LOL
> >
> > -----Oorspronkelijk bericht-----
> > Van: rpg400-l-bounces@xxxxxxxxxxxx
> > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]Namens rob@xxxxxxxxx
> > Verzonden: donderdag 3 mei 2007 15:23
> > Aan: RPG programming on the AS400 / iSeries
> > Onderwerp: Re: Benefits of declaring literals in D-specs
> >
> >
> > Because it makes your code look more like COBOL and it's definition
> > section and isn't that what we should all be striving for? (ducking
and
> > running - in a serpentine fashion).
> >
> > Rob Berendt
> > --
> > Group Dekko Services, LLC
> > Dept 01.073
> > PO Box 2000
> > Dock 108
> > 6928N 400E
> > Kendallville, IN 46755
> > http://www.dekko.com
> >
> >
> >
> >
> >
> > "Kent Hohlen" <khohlen@xxxxxxxxxxxxxxx>
> > Sent by: rpg400-l-bounces@xxxxxxxxxxxx
> > 05/03/2007 09:05 AM
> > Please respond to
> > RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
> >
> >
> > To
> > "RPG400 (E-mail)" <rpg400-l@xxxxxxxxxxxx>
> > cc
> >
> > Fax to
> >
> > Subject
> > Benefits of declaring literals in D-specs
> >
> >
> >
> >
> >
> >
> > We are in the process of revamping our coding standards. Eons ago
(and
I
> > still see it today) I saw a few presenters declare all literals in the
> > D-specs. One presenter explained why he liked declaring literals this
> > way,
> > though I don't remember the reasons given. Now I have been asked to
> > compile
> > a list of reasons/benefits for declaring literals in the D-specs. If
> > there
> > are some real benefits to declaring literals this way, then we will
make
> > it
> > part of our standards. If you would be so kind to share your thoughts,
I
> > would appreciate it.
> >
> > Kent Hohlen
> > Eagle Window & Door
> > --
> > This is the RPG programming on the AS400 / iSeries (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.
> >
> >
> > --
> > This is the RPG programming on the AS400 / iSeries (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.
> >
> >
> > --
> > This is the RPG programming on the AS400 / iSeries (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.
> >
> >
>
>
> --
> Brian Johnson
> brian.johnson.mn@xxxxxxxxx
> --
> This is the RPG programming on the AS400 / iSeries (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.
>
--
This is the RPG programming on the AS400 / iSeries (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 ...

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.