ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Step Description Expression

Solved!
Go to solution

Hi

 

I am adding some features to a custom step type. One of the features is showing some step's data in the description field.

But some data are in an array of dynamic size.

Is there a way to iterate through the arrays in the expression field ?

 

This question is not limited to Step Description Expression. You can use it in every Expression.

 

Regards

 

Juergen

 

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 1 of 4
(3,370 Views)

Juergen -

The expression language does not have "for loop" iterator syntax, so the only option that you have is to process the step description string as in the post-step and store it in a step property during run-time. If you want to display the data in the array in a simple list, then you could use Str to format all the elements of the array, for example the folloiwng expression:

    Str({1,2,3,4}, "%d", 1, False, " - ")

would output

1 - 2 - 3 - 4

Scott Richardson
0 Kudos
Message 2 of 4
(3,362 Views)
Solution
Accepted by topic author j_dodek

Hi Scott,

 

Thanks for the anwser.  

For the iteration, i have switched back to an old solution which used the Evaluate().

http://forums.ni.com/t5/NI-TestStand/Loop-in-a-Pre-Expression/m-p/838888

 

Regards

Juergen

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 4
(3,344 Views)

That's pretty cool, I had not seen anyone suggest that before. Thanks.

Scott Richardson
0 Kudos
Message 4 of 4
(3,337 Views)