Types of Variable References - Smart Rename Dialog Box

Types of Variable References

The Smart Rename feature can find and process the following types of variable references:

  • Auto-Resolved References —These are references to the variable in a TestStand expression, where the full name of the variable is specified and there is no ambiguity in identifying the expression as a reference.
  • Possible References —These are TestStand expressions which may or may not refer to the variable being renamed and user intervention would be required to decide whether they need to be updated. Types of possible references include:
    • Look-up strings within a TestStand API method —Look-up strings within a TestStand API method can refer to the variable being renamed. For example, Locals.ObjReference.SetValString(“name”, PropOption_NoOptions, Locals.Value) can be a reference to Locals.name and will result in a runtime error if the look-up string isn’t updated.
      Note A look-up string need not contain the fully qualified name of the variable to be identified as a possible reference.
    • An expression for an array subscript —If a TestStand expression refers to the elements of an array and the array subscript is specified as an expression instead of a numeric or string literal, then this results in a possible reference. The ambiguity here is because only elements inside an array of containers can be renamed and since array elements of type container need not have the same fields, TestStand can’t be certain whether the expression has to be updated. For example, if Locals.ArrayofContainer[0].Field1 is the variable being renamed, where ArrayofContainer is an array of type unstructured container, then a TestStand expression like Locals.ArrayofContainer[Locals.index].Field1 = Locals.Prefix+Locals.ValueRead results in a possible reference.
    • An expression that indirectly references Locals, Parameters, or FileGlobals —An expression can refer to the Locals or Parameters in the same sequence or a different sequence by using a reference to the sequence. For example, Runstate.SequenceFile.GetSequenceByName(“SubSequence1”).Locals.name . Since the sequence is derived by expression, the variable name matched, Locals.name, is considered a possible reference.
  • String Literals —Any string constants that contain only the fully qualified name of the variable being renamed will be identified as a string literal.
    Note Look-up strings are also string literals but will be processed separately as mentioned above.
  • Comments —If the fully qualified name of the variable being renamed is matched within a comment string, it will be identified as a comment reference.