Lookup Strings

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

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.

Note  TestStand does not generate an error if you programmatically set an invalid name for a PropertyObject.

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"

Note Note  If a property object defines a subproperty named Attributes or TypeAttributes, the subproperty takes precedence over the attributes or type attributes in a lookup string.

When you specify a named array element using a lookup string, such as myarray["myelementname"], use the standard C-style blackslash escaping technique to escape special characters in the string. For example, for a single backslash in the actual name, use two blackslashes in the escaped name. Use the Utility.Escape method to escape a string as needed.

WAS THIS ARTICLE HELPFUL?

Not Helpful