Lookup Strings
- Updated2025-07-23
- 2 minute(s) read
To specify the dynamic property on which a method operates, pass a string that defines a complete path from the object on which you call the method to the specific property you want to access. This string is called a lookup string. Use the following techniques to specify different objects:
- To specify the object itself, pass an empty string ("").
- To specify a subproperty, pass the name of the subproperty.
- To specify a subproperty of a subproperty, pass a string that contains both names separated by a period (.).
For example, you can specify the error code property in a step object using the following lookup string:
"Result.Error.Code"
TestStand expressions require PropertyObject names to be strings that contain only letters, numbers, and underscores. PropertyObject names cannot contain spaces, start with a number, or be empty. For example, MyVariableName_2000 is a valid PropertyObject name. Names of elements in a PropertyObject array, such as sequence and step names, can contain any character. Instead of using lookup strings that contain array element names that might not be unique, such as step names, with methods that have a lookupString parameter, use a string that specifies the array index instead.
You can specify an attribute or type attribute using a lookup string. Use Attributes in a lookup string to specify the attributes of the property object and use TypeAttributes to specify the type attributes of the property object. For example, the following lookup string accesses an attribute of a local variable from a sequence:
"Locals.Foo.Attributes.MyAttributeNamespace.Attribute1"
When you specify a named array element using a lookup string, such as myarray["myelementname"], use the standard C-style backslash escaping technique to escape special characters in the string. For example, for a single backslash in the actual name, use two backslashes in the escaped name. Use the Utility.Escape method to escape a string as needed.