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



On Sun, 2008-07-06 at 22:28 +1000, Simon Coulter wrote:
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.

Right you are.

Don't confuse operator precedence with operand evaluation.

That is exactly the mistake I was making.

"Interesting", isn't it, that
%diff( %timestamp() : $timestamp() : *msseconds )
could theoretically be positive or negative.

Thanks,
Terry.



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.