|
Dan wrote: > ... > > <my comments/questions follow> > > If AND & OR are always the lowest precedence, how can the array index example > above work? > According to the rules of precedence, as I interpret them, all of the > operands: > I<=%ELEM(ARRAY) > I>0 > ARRAY(I)>10 > would be evaluated before the AND relational operators. If 'I' is zero, I > would expect a run-time > error on the ARRAY(I)>10 because the > operator has a higher precedence than > the AND operator. > > BTW, I know from experience that this example works. I am questioning > whether the precedence of > operations really should be re-arranged to place AND & OR higher in the list. > Dan, in the expression A AND B AND C, there are actually two AND expressions: A AND B "value of A AND B" AND C For the first one, if A is false, B isn't evaluated. For the second one, if "value of A AND B" is false, C isn't evaluated.
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.