contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
Precedence of logical operators
     

The precedence of logical operators in order from highest to lowest is:

  1. not (!)
  2. = (is equal) or != (isnt equal)
  3. and (&)
  4. or (|)

not has precedence over the rest because unary operators always have precedence over binary operators.

Parentheses can be used to override these precedences.

This example illustrates the precedence of logical operators.

The condition is true either if an explicit value for the attribute "docno" occurs in the document, or if both the value of the counter "chapno" is greater than 1 and the stream "xref" is not open.

  local counter chapno
  local stream xref
  ...
  when attribute docno is specified or chapno > 1 and not xref is open

In this example, parentheses are used to override the precedence of logical operators. The condition is true if, and only if, "xref" is not open and either "docno" is specified for the current element or "chapno" is larger than 1.

  local counter chapno
  local stream xref
  ...
  when (attribute docno is specified or chapno > 1) and not xref is open

       
----

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:00:50 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.