NI TestStand Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
MimiKLM

Feature request: extend the Evaluate command to deal with the indexes within the brackets.

Hi,

 

Now the Evaluate() command cannot resolve names when the name to evaluate is within the square brackets []. In other words if the name to resolve is a part of the index.

 

It would be demanded the Evaluate() doesn't have this limitation.  

4 Comments
dug9000
NI Employee (retired)

Evaluate should work just like evaluating an expression. I'm not sure what you are saying that doesn't work. Can you give an example?

Elaine_R.
Active Participant

if your evaluation is failing it may be due to nested quotemarks inside your strings. consider using the \" escape symbol and it should resolve just fine.

 

i.e. "Runstate.Sequence.Main[\"MyStep\"].Result.Status"

 

 

MimiKLM
Active Participant

OK,

 

Now, I think the Evaluate command works OK. I didn't realise that I had the not explicitly casted type to string.

 

Evaluate("FileGlobals.Settings."+FileGlobals.UUTDetails.TypeCode+".TxFrequencies["+Locals.Index+"].Name")

 Locals.Index is the number type. That's why Evaluate has returned error. When I did explicit convertion:

 

Evaluate("FileGlobals.Settings."+FileGlobals.UUTDetails.TypeCode+".TxFrequencies["+Str(Locals.Index)+"].Name")

 it works.

WireWeaver
Active Participant
Status changed to: Already Implemented
 
https://www.linkedin.com/in/trentweaver