NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Indexing an array with string instead of number

Solved!
Go to solution

In TestStand, there is 2 way of indexing some special types of arrays. (Seems to be arrays of containers)

 

For example, in a Sequence containing a single step called Statement, you may address this step in two ways:

RunState.Sequence.Main[0]

and

RunState.Sequence.Main["Statement"]

(in fact, I may also use the step id, but let's keep in simpler with those 2 methods)

 

Is there a way to create such type of array myself, in order for me to use string indexing? (or is it only possible on some NI Types)

Message Edited by Mathieu.Daigle on 05-17-2010 01:57 PM
0 Kudos
Message 1 of 4
(3,205 Views)
Solution
Accepted by topic author Mathieu.Daigle

As you surmised, that works for any array of containers.

 

You just need to assign names to the elements. You can do this in the sequence editor by selecting an element and hitting F2, or by programmatically setting PropertyObject.Name.

 

 

0 Kudos
Message 2 of 4
(3,199 Views)

Hi James,

 

I tried to check this out.

But it does not work.

Using TS4.0, creating a local  array of strings, selecting an element, but on right click F2 is dimmed !

 

Regards

 

Juergen

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

Hi James !

 

Sometimes it is important to read the hole stuff !!

before writing into a thread .

You worte ...that works for any array of containers

 

I tried it with array of strings !

 

Sorry

 

Juergen

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