Expression Operators
- Updated2025-03-28
- 3 minute(s) read
Operator Class | Operators in Symbol Form |
---|---|
Arithmetic | The arithmetic symbols include the following items: +, -, *, /, MOD, %, ++, and --. |
Assignment | The assignment symbols include the following items: =, +=, -=, *=, /=, %=, ^=, &=, and |=. The equal operator evaluates the expression on the right side of the operator and sets the operand on the left side of the operator to the result. When operating on container properties, the hierarchy of subproperty names on the left and right side must match. For each property value, the assignment converts between different data types whenever possible, for example, numeric to string. |
Bitwise | The bitwise symbols include the following items: AND, OR, NOT, XOR, &, |, ~, ^ , >>, and <<. |
Comparison | The comparison symbols include the following items: ==, !=, <>, >, >=, <, and <=. Floating-point comparisons use 14 digits of precision.Comparison operators work on string, numeric, and Boolean values. If one operand is a string and another is a numeric, the operator converts the string to a numeric value. If both operands are strings, the comparison is case-insensitive. If both operands are non-zero floating-point numeric values, the comparison uses 14 digits of precision. TestStand treats NAN and IND as equivalent in expression comparisons. |
Logical | The logical symbols include the following items: &&, ||, and !. |
Other | Some additional operators include the following items: () Parentheses—Alter evaluation order. . Dot—Property field separator. .. Double Dot—Specify a range of indexes in array subscripts. This operator indexes multiple elements in the array and returns a subarray. The operand on each side of the range operator must evaluate to a numeric value, such as array[1..3]. [] Brackets—Array subscript Note
The operand for an array subscript must evaluate to a
numeric value, unless the array contains step or sequence
elements. For arrays of step or sequence elements, the
subscript can evaluate to a string value that contains the
name of a step or sequence element in the array, such as
RunState.Sequence.Main["MyGoto"]. You
can use the double dot operator (..) within
the [] operator to index multiple elements
in the array and return a subarray. For example, the
expression array[1..3][2] returns the
elements at indexes [1][2],
[2][2], and [3][2] in
a new subarray. , Comma—Expression separator or terminator. ?: Conditional—Given a Boolean value, chooses one of two other expressions to evaluate Usage: booleanValue ? expr1 : expr2 {} Array constant. // Single line comment (C++). ’ Single line comment (Basic). /* */ Comment (C/C++). & Get Reference—Returns a Reference that refers to the operand. * Dereference—Returns the object to which the Reference operand refers. The Reference must refer to an object that supports the TestStand PropertyObject interface. -> Dereference and access field—Returns the specified subproperty of the object to which the Reference operand refers. The Reference must refer to an object that supports the TestStand PropertyObject interface. |
Constants | The formats for the different types of constants include the
following items: 1.23e-4 Floating point 1234 Integer 0x1234efa9 Hexadecimal integer 0b11011011 Binary number 1234i64 64-bit integer constant 1234ui64 64-bit unsigned integer constant True Boolean False Boolean "1234wxyz" String @"file path" Unescaped string, such as @"C:\Windows\temp" Nothing Empty ActiveX reference NAN Not a number IND Indeterminate number INF Infinite number PI PI constant (3.141592...) tsRed Color constant Note TestStand declares some special constant values that
are similar to values used in other environments or used
infrequently. |