|
That is truly scary isn't it.
On 2013-12-06, at 7:19 PM, Barbara Morris <bmorris@xxxxxxxxxx> wrote:
RPG isn't consistent though. Both DSPLYs are done in this program, so
it's both false and true.
D fld s 10a inz('a')
C move fld *in10
C 10'cond t' dsply
C N10'ncond t' dsply
C return
Many languages specifically define that 0 is false and anything else is
true. But for RPG, it's undefined what will happen if an indicator
doesn't have the value '0' or '1'.
With RPG, since it's undefined behaviour, the compiler is free to
generate code to compare the indicator to either '0' or '1' depending on
which makes more sense for that specific case.
As an Amazon Associate we earn from qualifying purchases.
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.