NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Use enums to index an array?

Hi,

 

I have a teststand enumerated type (locals.myEnum) and a string array (locals.myArray). I'd like to retreive the "locals.myEnum"-th value of the array, but the following expression doesnt work:

 

locals.myArray[locals.myEnum]

 

What is the right way to index an array with an enum in teststand?

 

thx!

 

0 Kudos
Message 1 of 2
(2,402 Views)

Ah OK, so its the Val function:

 

locals.myArray[Val(locals.myEnum)]

Message 2 of 2
(2,392 Views)