Expressions
- Updated2025-03-28
- 1 minute(s) read
You can use the values of variables and properties in numerous ways, such as passing a variable to a code module or using a property value to determine whether to execute a step. For these same purposes, you can use an expression, which is a formula that calculates a new value from the values of multiple variables or properties. In expressions, you can access all variables and properties active in the sequence context when TestStand evaluates the expression.
You can use an expression wherever you would use a simple variable or property value. TestStand supports all applicable expression operators and syntax you can use in C, C++, Java, and Visual Basic .NET. You can also call the TestStand API directly from within expressions.
The following is an example of an expression:
Locals.MidBandFrequency = (Step.HighFrequency +Step.LowFrequency) / 2
All TestStand controls that accept expressions provide context-sensitive editing features, such as drop-down lists, syntax checking, and expression coloring to help you create expressions. At any point while editing an expression, you can press <Ctrl-Space> to show a drop-down list of valid expression elements.
The expression editor includes visual assistance for finding and manipulating nested delimiters such as parenthesis, brackets, and braces.
- Place your cursor to the left of a delimiter and the expression editor makes the matching pair bold.
- Type <Ctrl + ]> to toggle the cursor between the matching delimiters.
- Type <Ctrl + Shift + ]> to select the matching delimiters and everything between them.