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



Yes, why IBM has not defined literal constants *True and *False I do not
know.

The reason for defining your own is obvious. Field type N are Logical data
type. Boolean only two values allowed True or False. The only reason for
them being character 1 with 0 or 1 is to maintain compatibility with
existing RPG code with indicators.

Using *On and *Off just means you have to translate into true or false and
you would never want to do

If LogicalField = *On

or

If LogicalField = *Off

You would always do

If LogicalField; (If True)

If Not LogicalField (If False)

Where the constants come in set the value of logical field obviously.

DisplaySubfileMessage = cTrue;

EditMode = cTrue;
DisplayMode = cFalse;

Condition is true or false.


On Fri, Dec 6, 2013 at 11:35 AM, Monnier, Gary <Gary.Monnier@xxxxxxxxx>wrote:

Frankly *ON and *OFF do not equate to true and false except by your
design. They just mean '1' and '0'. You can make this mean anything you
want. Barbara's comment about making them constants was a good one. Many
shops use this technique.

One big issue with many developers for as long as I've been around is
assuming everyone will understand their logic. With some developers their
thinking is quite clear. With others you feel like you have to take a trip
around the world and back then unwind a ball of twine to figure out what
they did.

I suspect IBM will add them eventually. RPG gets more and more like other
languages all the time.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Englander, Douglas
Sent: Friday, December 06, 2013 10:16 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Define field as an indicator in D-specs


I'm not confused. I don't understand why someone would want to write more
code than they have to.

If people steeped in other languages can't figure out what is meant by *ON
and *OFF, then we, as developers, have bigger issues.

Maybe we should ask IBM to include *TRUE and *FALSE as additional ways to
signify *ON and *OFF.

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