Features of the Edit Box

The edit box is where you type or build the expression to be used in your calculation. Features of the edit box include: drag and drop, syntax highlighting, real-time validation, comments, entity display name, and auto-complete.

Related: Calculation Overview and Syntax, Using the Calculation Editor

Drag and Drop

You can drag and drop a function, entity, tag, template or another calculation from the Component Selector into the edit box.

The function is presented in syntax form - you need to edit this for it to become valid.

 

You can also use drag and drop to replace tags, entities, and attribute values in the edit box.

 

Syntax Highlighting

The edit box uses syntax highlighting for keywords, functions and strings, and also uses bracket matching highlights. 

Purple: Keyword, Function
Dark Red: String

 

Real-time Validation

Your calculation expression is validated as you build it. As soon as an error is encountered, it appears in the Error tab.

When you click on an error in the error tab, it is highlighted within the expression.

 

Comments

You can enter comments within calculations by using // at the beginning of a row or the end of a row. Anything following the // syntax is not interpreted by the calculation engine, for that row only.

In the following screenshot, comments have been entered on rows 1, 2, 4, and 7.

 

Entity Display Name and Syntax

Entities are specified using standard syntax, however the calculation engine automatically uses the display name of the entity, which is shown in a formatted cell that also shows the icon of the entity's primary template. 

The icon provides the distinguishing feature when there are multiple entities with the same display name. The icon and display name are also displayed in the Details panel when you click on the entity.

 

Auto-complete

The auto-complete feature allows you to choose tag and entity names from a drop-down list. The auto-complete drop-down is triggered when you type the { character.

When you start typing, the auto-complete searches the display name and description fields to populate the list. The list shows the matching display name and descriptions, and the matching text is also bolded in the list. You can also see the icons in the list, to help distinguish between multiple entries with the same display name.

 

Comments are closed