Precedence in hide-when formula

I found a strange result when investigating why a field I expected to be hidden was showing. The formula has many “OR” elements, like this:

@Name([CN];From) != @Name([CN];@UserName) | OnlineMeeting=“1” | EventID!=“” | AppointmentType!=“3” | (Flag!=“1” & (!@IsNewDoc & !SaD=“0”)) | Repeats = “1” & !@Contains(LocalParams;“B”)

I expected that it would hide if any of the OR statements is True, and the last statement should read as a single test like Repeats = “1” & !@Contains(LocalParams;“B” because AND comes before OR.

But it turns out that it gives the AND in the last test lower precedence than OR, so in effect it’s testing each of the cases AND the last, something like this…

(@Name([CN];From) != @Name([CN];@UserName) | OnlineMeeting=“1” | iwEventID!=“” | AppointmentType!=“3” | (iwFlag!=“1” & (!@IsNewDoc & !iwSaD=“0”)) | Repeats = “1”) & !@Contains(iwLocalParams;“B”)

My reading of the Help entry on precedence says AND comes before OR

Quote:

The following table summarizes the order of operator precedence. The operands in the table are binary except where noted. Operators on the same line have the same precedence. In order of highest-to-lowest, the precedence of LotusScript operators is:

Not

And

Or

Xor

Do I misunderstand?

Subject: Observation is correct.

But it turns out that it gives the AND in the last test lower precedence than OR, so in effect it’s testing each of the cases AND the last, something like this…

Your observation is correct, but your interpretation not. Breaking down the formula, everything prior to the final “&” is enclosed in ( ). So what the formula says is test for any of of the conditions in the ( ) AND the last one both to be true. Thus, the final AND is taking the highest precedence. IT must be one of the first set AND the last condition. All of the ORs inside the ( ) first set of conditions are taking the same precedence, however the set where {(iwFlag!=“1” & (!@IsNewDoc & !iwSaD=“0”))} actually does not need the internal parens. Those are taking a second precendence.

(

@Name([CN];From) != @Name([CN];@UserName) |

OnlineMeeting=“1” |

iwEventID!=“” |

AppointmentType!=“3” |

(iwFlag!="1" & (!@IsNewDoc & !iwSaD="0")) |

Repeats = “1”

) & 

!@Contains(iwLocalParams;“B”)

The Notes help appears correct to me in this case.