Collapse
CollapsingX
  • - or -

Building complex expressions


When creating complex expressions, some basic building techniques need to be followed to minimize errors when running your project.

Hints for working with complex expressions

Employ the following techniques to improve your expressions:

  • To improve readability, you can insert line breaks and whitespace to make the expression easier to verify.

  • To improve readability, you can use short sub-expression names to substitute for long link paths that have numeric results.

  • Use the syntax-based coloring to check parentheses nesting: click on a function name and its parameter list will be shown with a background highlight.

  • Use the Quick Evaluate pane to check on values in an array (either the whole array, or edit the index to see one value at a time) and check on intermediate results by pasting expressions into the Quick Evaluate pane. Remember that all links need to have the name of the flowchart that contains the step or variable prepended to the link.

Sub-expressions

Any unrecognized identifier in an expression is assumed to be a sub-expression. An identifier is a sequence of characters that begins by an alphabetic character or an underscore (for example: _, a... z, or A... Z) and is followed by either a numeric or several alphabetic characters (for example: _, a... z, or A... Z, 0... 9).

Sub-expressions can be set to either a number, a constant value, or to a complex expression. The sub-expression always returns a floating-point value. The sub-expression can be used in the inline expressions of a string input. They are not accepted in an object input, string comparison, or object comparison. The following are examples of sub-expressions used in the calculation of a distance:

Unrecognized identifiers are assumed to be sub-expressions. Until the sub-expression is defined, it will display an error.

Right-clicking on the identifier will bring up an editor to enter the sub-expression.

Sub-expressions are useful to improve readability of expressions that have repeated terms, especially those with multiple links.

In general, you can use variables instead of sub-expressions. Unlike sub-expressions, variables can be used more than once, their value can be viewed in the Quick Evaluate pane, and they are not local to an expression. However, they require more overhead, as you must add a Store step to your flowchart.