|
On 06/07/2008, at 9:41 PM, Terrence Enger wrote:
Does RPG guarantee that an expression is evaluated left-to-right? You
relieve my unpleasant twinge of doubt by writing explicitly ...
lastOfMonth = ( firstOfMonth + %months(1) ) - %days(1);
Yes. Like most (if not all) modern programming languages. Read about
operation precedence in the Reference. Addition and subtraction are
6th in the hierarchy and are evaluated left-to-right.
That is exactly the mistake I was making.
Don't confuse operator precedence with operand evaluation.
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.