Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The If Instruction evaluates an expression from a predicate and returns a boolean value true or false.
  • Therefore Boolean algebra is applied, e.g. to evaluate expressions such as $returnCode.toNumber == 0.
  • For details see JS7 - Expressions for Variables

Binary Operations

  • The If Instruction knows of two binary operations, which are and (conjunction) and or (disjunction) with the syntax  && and ||.
    • Possible operations correspond to the following matrix:

      xyx && yx || y
      falsefalsefalsefalse
      truefalsefalsetrue
      falsetruefalsetrue
      truetruetruetrue
    • Round brackets should be used to group multiple expressions and to control the order of evaluation.
    • Conjunction beats disjunction if no grouping is used, i.e.
      •   x && y || z  is the same as (x && y) || z   
      •   x || y && z  is the same as   x || (y && z) 
    • Both operations using the basic elements truefalse cover a number of algebraic laws such as associativity, commutativity and distributivity. For more details see Wikipedia.

...