Formula Editor

Write an expression in the Formula field

The expressions are based on Microsoft® Visual Basic. The Formula editor knows a basic set of Visual Basic functions, as well as all OpenLab fields, functions, report parameters or calculation variables. The Formula editor tries to autocomplete your commands as you type, and shows the best matches in a drop-down list.

To find the required item, do one of the following:

  • Start typing the full word

  • Type a partial match

  • Type the occurring capital letters (Latin letters only, does not apply to Chinese or Japanese fonts)

To insert a selected item, press [Tab], [Enter],or [Space].

To close the list without inserting anything, move the cursor out of the current word, or press [Esc].

To open the list again, continue typing the expression, or press [Ctrl]+[Space].

If you enter invalid expressions, a red, serrated line will be shown in the Formula field. A tool tip shows detailed information about the error and provides a solution for solving it. However, you can still save the expression, as it may contain code that is just not modeled by the Formula Editor, but is still valid Visual Basic.

Break expression into multiple lines

To break a single long expression into multiple lines, choose one the following approaches:

Syntax highlighting for expressions

In the Formula editor text box, the syntax of your entered expression is highlighted in a defined color.

These colors are used to highlight different syntax types:

Color

Syntax type

Fixed text that is placed in quotation marks.

Program flow actions, such as If, Choose, etc.

All other supported functions.

All operators, such as +, -, and, or, etc.

All constant numbers.

All field names (VB.net fields, properties) and functions listed under Fields and Functions in the Items tree.

True, displayed for valid expressions.

False, displayed for invalid expressions.

Place the cursor in front of an open or after a closed bracket, respectively, and the corresponding bracket will be highlighted in this color.

Use predefined items

In the Details area:

  • The Items panel displays the categories (for example, Sequence, Sample, Injection) and their fields, functions, and operators provided by OpenLab CDS, plus several common functions and operators.

    For more information about the Operators category, see Operators.

    For more information about the Common functions category, see Basic functions and aggregators.

  • The Fields and Functions panel displays the specific items corresponding to the selected category. You can insert the item into your expression by double-clicking it.

  • The Description panel shows a short description on the selected item.