NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning values to all Elements of Container in one step

Hi All

 

I have a container which has certain numeric and string elements.

I want to assign values to all these numeric and string elements at once through one step.

Something similar to array.

For eg: if I have numeric array A1 defined in TS , I can assign multiple elements to it by syntax: 

A1 = {1,2,3,4,5}

 

Is there a similar syntax/way to assign to values to all elements of containers at once?

 

Thanks in advance

 

0 Kudos
Message 1 of 3
(2,607 Views)

Unfortunately this doesn't exist.

 

The problem is with containers you can have different types and depths of hierarchy.  How would you depict the different levels of hierarchy in a single command like that?

 

You can assign all elements in a single statement by separating with a comma.

Example:

Locals.Foo.MyString =  "Hello",
Locals.Foo.MyNumber = 5,

Locals.Foo.MyBoolean = True,

Etc...

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 3
(2,452 Views)

Thanks for the reply.

 

Yup the option which you suggested is what I have currently implemented.

But i was just wondering if I am missing out on something..

In some cases , containers can have same datatype(but still it wont be an array since you need to access individual elements also later seperated based on names etc.) and thought this could be useful in that case.

 

0 Kudos
Message 3 of 3
(2,256 Views)