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



Gerald Magnuson wrote:
Hans,
Are you saying it makes a difference
if we have the "and" on the top line,
or on the next line?
Could you explain why that is?


I believe someone else already answered this. But just to reiterate and clarify, the following three statements are equivalent:


#1: dow pos < 52 and
        (InputMAD(pos) <> ';');
#2: dow pos < 52
        and (InputMAD(pos) <> ';');
#3: dow pos < 52 and (InputMAD(pos) <> ';');

The compiler doesn't care how many lines are used to code an expression. It just boils down to personal preferences or site specific programming style conventions.

But they're not the same as:

dow (InputMAD(pos) <> ';') and pos < 52;

That is, order matters within a relational expression. For example, if the first argument of the AND operator is false, there's no point in evaluating the second argument. Likewise, if the first argument of the OR operator is true, there's no point in evaluating the second. That's why you test the array index before using it the reference an array element.

Cheers! Hans


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.