Versions Compared

Key

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

...

Please also note that the value of an expression (e.g. the value that will be assigned into a Stream Attribute ) is the value of the last statement to be evaluated. In the above example, this seems very trivial as the last statement to be evaluated is the last line. However when we look at Conditional Statements the last statement evaluated is not always the last statement in the expression. For  For example:


Expression
Result

if (

    in.customerName == "Smith",
    45 ,

// else 36

)

45 if the customer's name is "Smith" but otherwise the value 36.


Adding Comments

In longer scripts (and even short scripts) it is a good idea to add comments to remind yourself (and anyone else who may need to modify the script in future) what steps are being followed. For short, 1 line comments, just prefix the line with // and for longer, multiline comments, enclose the lines in /* .... */. For example:

...