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



Jon,

Yeah, I think I learned false = 0 and true = not false while learning C or
Pascal...

Interesting that RPG reverses that. I bet there's a story there somewhere!

Charles


On Fri, Dec 6, 2013 at 2:59 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

That is certainly the case in PHP for example, but if I recall correctly
there are certainly situations in RPG where non '1' values will evaluate to
false - but not a good idea to rely on it I'm sure but ... I just recall
having to try to understand code where someone had set an indicator to
either '1', 'A', or 'B' or some such.

Just ran a quick test and that appears to hold true for the current
version of RPG IV - so in most cases at least RPG appears to be the
reverse. i.e. True = 1 and False = not 'True.


On 2013-12-06, at 2:43 PM, Charles Wilt <charles.wilt@xxxxxxxxx> wrote:

The idea that true=1 and false = 0 is pretty much universal. (Well
technically it's really false = 0 and true = not false. But true = 1 is
pretty common since binary bits are either on = 1 or off = 0)

Jon Paris

www.partner400.com
www.SystemiDeveloper.com




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