NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically get the type of a container’s field

Solved!
Go to solution

I am able getting container’s field names through GetNthSubPropertyName at runtime

I would also like to get their types (String, Number, Boolean…). Does someone has an idea on how proceeding?

0 Kudos
Message 1 of 5
(3,129 Views)

Not completely sure what you need. It's a bit quick and dirty but does this help?

 

Capture.PNG

Message 2 of 5
(3,102 Views)
Solution
Accepted by topic author jjd

Or from TestStand as an expression:

 

Locals.GetNthSubProperty("StevesLocal",1,0).Type.DisplayString

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

Message 3 of 5
(3,097 Views)

Thank you Steve, that is absoluteley what I needed.

As I have to do it within a TestStand statement, the equivalent to your example is:

Locals.TypeName = RunState.Sequence.Parameters.GetNthSubProperty("StevesLocal",1,0).Type.DisplayString

Perfectly works!

0 Kudos
Message 4 of 5
(3,095 Views)

Thanks to you too, Charlie!

0 Kudos
Message 5 of 5
(3,092 Views)