# Expression Builder Language Elements

Note:

- The syntax is not case sensitive, however, it is highly recommended to use the casing presented in the auto-complete lists.
- For common usage of Arithmetic and functions and Constants reference MS .NET / C# online documentation.

Language Element | Notes | Supported formats/values/examples
--- | --- | ---
Arithmetic operators | (in order of precedence) |
| Exponentiation | ^
Unary negation | –
Multiplication and floating-point division | *, /
Integer division | \
Modulus arithmetic (Returns the remainder after a number is divided by a divisor. The result always has the same sign as the divisor.) | MOD
Addition (string concatenation) and subtraction | +, –
Comparison operators |  |
| Equals (this works when comparing strings) | =
Not Equal (this works when comparing strings) | <>
Less Than | <
Less Than or Equal | <=
Greater Than | >
Greater Than or Equal | >=
Logical and bitwise operators |  |
| Negation Note: The Negation (NOT) operator only supports logical operations, and does not support bitwise operations. | NOT
Conjunction | AND
Inclusive disjunction | OR
Exclusive disjunction | XOR
Comment |  |
| Note: Since only syntactically valid expressions can be saved, there is the possibility to comment out sections for editing them later. If you want to comment out an expression, some dummy value can be provided before the comment, for example: "1 // Math.Max(Math.Sin($myTag)*1, 12)" | // Comment
Constants |  |
Note: For a list of all Constants, and a description of each, use the Constant button in Expression Builder and see the relevant tooltip.
| Epsilon |
False |
NaN |
NegativeInfinity |
Null |
PositiveInfinity |
Pi |
True |
Functions |  |
| Note: For a list of all functions with descriptions, use the Function button in Expression Builder and see the relevant tooltip. | Math.Sin(pi) String.Concat("a","b","c")
Parentheses |  |
| Note: [ ] and { } are not supported | 2*(3+4)
Arrays |  |
| Arrays can be constructed using the ArrayOf and ListOf functions can be used to access elements of an array. | The following example illustrates how to access elements of an array, using simple syntax: ItemAt function: ItemAt($tag_testInt, 0, 10, 20, 30, 40, 50) // Place in the binding for the value of a Label // Then by changing the value of the tag from 0 to 5, the value of the label will change from 0 to 50.
ArrayAt and ListOf function: ArrayOf(„one”, „two”, „three”) ListOf(0, 10, 20, 30, 40, 50)
String Literals |  |
| Supported escape sequence for strings: | "sample Bob's name"
"Bell (alert): \a" "Backspace: \b" "Formfeed: \f" "New line: \n" "Carriage return: \r" "Horizontal tab: \t" "Vertical tab: \v" "Single quotation mark: \'" "Double quotation mark: \"" "Backslash: \\" "Unicode char in hexadecimal notation: \u0020"
Tag Reference |  |
|  | $myTagName $System.Users.CurrentUsername
White Space |  |
| Extra white space, if not part of a string, is ignored. Operators do not need white space, but it may be useful for readability. You may press <enter> and continue an equation on the next line. You may not press <enter> and continue a string onto a second line. | The example below illustrates the valid use of multiple lines:
    if($tag4,
    "evaluated as true",
    "evaluated as false")

    //example:  invalid use of multiple lines
    " this
    string  cannot  be on two lines"