Expression Syntax
- Last UpdatedJan 16, 2026
- 4 minute read
This section explains the expression syntax available in the Configuration Explorer when defining rules.
Operators
Arithmetic expressions can be built using the usual conventions:
-
Operators + and - add and subtract numerical values
-
Operators * and / multiply and divide numerical values
-
Brackets (…) are used to group sub-expressions particularly to build nested expressions.
Boolean expressions can be built using the following conventions:
-
Operators eq, ne, lt, le, gt, ge, test for equality, inequality, less than, less than or equals, greater than, greater than or equals, and apply to a pair of numerical expressions or a pair of alphanumeric expressions or a pair of Boolean expressions. (The result will be unpredictable if expressions of different type are compared.)
-
Operators and and or test for Boolean "and" and Boolean "or" between two Boolean expressions.
-
Operator not is used to negate the Boolean expression that follows it.
Attributes
Attributes can generally be included in rules using the of syntax, for example, NAME of source, but the dot notation can also be used, for example, source.NAME. The dot notation is useful for array attributes, for example, source.BOREAR[3] < 100.
Functions
The following functions are available (minimum abbreviation shown in bold):
|
double Sine (double angle) |
// angle in degrees |
|
double Cosine (double angle) |
// angle in degrees |
|
double Tangent (double angle) |
// angle in degrees |
|
double Acosine (double value) |
// result in degrees |
|
double Atangent (double value) |
// result in degrees |
|
double Sqrt (double value) |
// square root |
|
double Log10 (double value) |
// base 10 logarithm |
|
double Logarithm (double value) |
// natural logarithm |
|
double Alog10 (double value) |
// base 10 antilogarithm |
|
double Alogarithm (double value) |
// natural antilogarithm |
|
double Absolute (double value) |
// absolute value |
|
integer Fix (double value) |
// rounded towards zero |
|
integer Ceiling (double value) |
// rounded up |
|
integer Round (double value) |
// nearest integer |
|
double Atant (double x, double y) |
// atan of x/y (degrees) |
|
double Minimum (double a, double b, …) |
// minimum value |
|
double Maximum (double a, double b, …) |
// maximum value |
|
integer Length (string text) |
// number of characters |
|
integer Occurs (string text, string sub) |
// number of occurrences of sub in text |
|
integer Instring (string text, string sub) |
// Position of first occurrence of sub in text |
|
string Asstring (object value) |
// convert numeric or Boolean value to a string |
|
double Asreal (object value) |
// convert string value to a double |
|
boolean Asboolean (object value) |
// convert string or number value to a Boolean |
|
string Substring (string text, integer start [, integer length]) |
// substring from the start position of given length (or to end of text) |
|
string Left (string text, integer length) |
// left part of text |
|
string Right (string text, integer length) |
// right part of text |
|
string Before (string text, string sub) |
// left part of text before given substring |
|
string After (string text, string sub) |
// right part of text after given substring |
|
string Uppercase (string text) |
// convert to upper case |
|
string Lowercase (string text) |
// convert to lower case |
|
string Replace (string text, string seek, string sub) |
// replace all occurrences in text of substring seek with substring sub |
|
string Trim (string text) |
// remove leading and trailing white space from text |
|
string Format (string pattern, object arg1, …) |
// substitute the values of the arguments into the pattern string |
|
- details of this are given below |
|
|
string Lookup (string dictName, string key) |
// return the value associated with the key in the given Dictionary |
|
(see Dictionaries section) |
|
|
boolean Like (string pattern, string text) |
// test if the text conforms to the wildcard pattern. Wild characters are: |
|
* - matches any number of characters |
|
|
? - matches any single character |
|
|
boolean Between (object test, object lower, object upper) |
// determine if the test object lies between the given lower and upper values. |
|
Arguments may be all numerical or all alphanumeric. |
|
|
boolean Inlist (object test, object value1, …) |
// determine if the test equals one of the given list of values. |
|
Arguments may be all numerical or all alphanumeric. |
|
|
Integer Listposition |
// the list order position of the current target element. |
|
in the members list of its owner. |
Format Function Details
string Format (string pattern, object arg1, …)
The first argument is a pattern string into which the remaining arguments are substituted according to the format specifications included in the pattern string. This function follows the conventions defined for the .NET System.String.Format function.
The pattern string contains normal text with the argument formatting elements embedded within curly braces. For example:
Format('/{0}-{1}-{2:D3}', PREFIX of source, LETTER of source, NUMBER of source)
This example generates a name from the values of three attributes on the source object. The first two values are straightforward substitutions. The third value is substituted as an integer value with a minimum of 3 digits, padded with leading zeros if necessary, for example, "45" -> "045".
Another example of a format specifier is {3:F2}. In this example the fourth value is substituted as a number with two decimal digits, for example, "3456" is output as "3456.00".
For further information about format specifiers please refer to http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx.