NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Create new property if doesn't exist

Solved!
Go to solution

Hi,

 

I'd like to populate my container with some oher containers unless they exist.

 

So I've created:

 

 

Locals.Exists("TestCont.A",0)?
(
Locals.TestCont.NewSubProperty("A",PropValType_Container,False,"Container",0), Locals.TestCont.A=Locals.B ):(True)

 

 

Container B contains two subproperties one string and second number.

 

However, I'm getting the error: Variable or property types do not match or are not compatible

 

How to do it correctly?

 

K.

0 Kudos
Message 1 of 3
(4,574 Views)
Solution
Accepted by MimiKLM

Maybe try this:

 

PropertyExists("Locals.TestCont.A") ? True : Locals.TestCont.SetPropertyObject("A", 1, Locals.B.Clone("", 0))

 

Hope this helps,

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

Thank ~jiggawax~ for rapid help!

 

You answer made me thinking further, so I have some additional scenario.

 

I posted it here

0 Kudos
Message 3 of 3
(4,554 Views)