09-12-2013 01:12 AM
Hi, Everyone!
Could someone help me ,Pls?
Query:
How can i get the executed step index of main segment of a executed sequence?
Aim:
I want to let Teststand reveal the executed step index no matter when it running in main segment, setup segment or cleanup segment when i terminate executing sequence.
My action:
I add a Statement step in SequenceFilePostStep , the content is FileGlobals.GetArrayOffset1= RunState.Sequence.Main.GetArrayOffset("Pass/Fail Test1",0,"0").
but it cann't work, and it is error.
09-12-2013 09:11 AM
I'm not sure exactly what you are trying to do, but your expression is wrong. Try:
FileGlobals.GetArrayOffset1= RunState.Sequence.Main.GetArrayOffset("", 0, "[\"Pass/Fail Test1\"]")
-Doug
09-13-2013 02:47 AM
Dear Doug,
Thank you for your answer!
It works ! But what is the meaning of the sign "[\"\"]"?
Thank you!
09-13-2013 09:12 AM
The backslashs are escape characters which tell the expression to interpret the " " as actual quotes. Since the expression Doug posted had other quote marks in it here: ("", 0, "[\"Pass/Fail Test1\"]") we have to escape the inner quotation marks so that the expression will be interpreted correctly. The backslash does this.
09-13-2013 09:12 AM
the [] are because it's array index notiation (see the API help for the API you are trying to call for more details), the inner \"\" are because in order to put the " character inside of a string constant, you need to escape the " character with a \. This is needed so that the parser can tell the difference between a " which means the end of the string constant and a " which is supposed to be part of the string. In many programming languages such as C, C#, and C++ the \ character escapes the character immediately following it.
Hope this helps,
-Doug