Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

labs:explicithistory:expressionlanguage [2016/04/22]
labs:explicithistory:expressionlanguage [2020/08/14] (current)
Line 1: Line 1:
 +====== Explicit History Expressions ======
 +
 +| {{:legacy:en:ExplicitHistoryBanner.png}} |  //**Explicit History Plug-in Wiki Pages**// |
 +
 +----
 +
 +> **Summary:** //A description of expression language in Explicit History//
 +
 +\\
 +
 +===== Expressions=====
 +
 +The Explicit History plug-in features its own brand of expression syntax, since the available scripting languages rarely support vector and point operators. The syntax of the Explicit History Expression language is similar to VBScript, but with several additions.
 +
 +First, expression parsing is important when defining logical relationships between parameters. And the language outlined on this page is used both in the math components that deal with scriptable expressions and in some parameter types directly. All numeric and vectorial parameters expose a simple, one-line expression for post-processing any data that comes in.
 +
 +For example, let's look at the Line SDL (Start, Direction, Length) component which takes a point, a vector, and a double. All these parameter types support inline expressions, but we'll start with the simplest one: the Double parameter that indicates the line segment length. If you browse through the context menu of the **L** parameter you'll find the **Expression F(x)** item at the bottom. This menu item expands to give you two alternate interfaces to the expression script:
 +
 +\\
 +
 +{{:legacy:en:DefaultUI_InlineExpression.png}}
 +
 +\\
 +
 +You can either type in an expression in the menu textbox, or you can open the Expression Editor. If you are familiar with the syntax you can use the shortcut way of using the menu, but in the beginning it's better to use the editor since it informs you about errors in the syntax:
 +
 +\\
 +
 +{{:legacy:en:DefaultUI_ExpressionEditor.png}}
 +
 +\\
 +
 +The editor displays a list of all the variables you can use (only "x" in this case) and all the operators that are available (the buttons along the top).
 +
 +If you change the expression, a red error message on the dialog box informs you what kind of syntax error was made. There is also a Preview button for testing your new expression.
 +
 +The language comes with a bunch of predefined mathematical functions similar but more extensive than VBScript.
 +
 +If you want to know more about the Expression language, you can run the hidden **_TestExplicitHistoryExpressionParser** command which features more information about syntax, available functions, and vector notation.
 +
 +