I just started to use TestStand and I have got the following question:
I have 2 fileglobals:
FileGlobals.Limit1 and FileGlobals.Limit2
The User will define the fileglobals in an INI File and the names and values from the files will first be stored in 2 Arrays.
Array of string: FileGlobals.ArrayNames (Element 0 is "Limit1" and Element 1 is "Limit2")
Array of number: FileGlobals.ArrayValue (Element 0 contains value of "Limit1" and Element 1 contains value of "Limit2")
In one step I check if the name in the array is a fileglobals: In other words: Does FileGlobals.Limit1 and FileGlobals.Limit2 really exist.
PropertyExists("FileGlobals.ArrayNames") and PropertyExists("FileGlobals.ArrayNames")
Now I know that the Globals exist. the next step is saving the values of the Array (FileGlobals.ArrayValue) in the FileGlobals Limit1 and Limit2.
Is there a possibility to avoid the following:
Fileglobals.Limit1 = FileGlobals.ArrayValue
I would like to use something like this:
FileGlobals."FileGlobals.ArrayNames" = FileGlobals.ArrayValue
I know that the Fileglobal really exists and I know the name of it. This would make later changes in variable names more easier in this case...
I hope you know what I mean and you can help me.
Thanks a lot!
That is possible. Just use following Expression:
You can also use the Evaluate() function to get the reference of your variable.
This function is a little bit magic because if write some thing like this : "Evaluate(FileGlobals.ArrayNames) = FileGlobals.ArrayValue" it will directly write ArrayValue into the variable described by FileGlobals.ArrayNames.
To have this working you just have to ensure that 'FileGlobals.ArrayNames' contains the whole variable name (lookup string): for example "Locals.MyValue" is correct ; "MyValue" alone is not !
thanks for your answer.
Could you save the example for TestStand 2010?
Here you are