NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Populating an array with Property Loader using array literal {single assignment}

Solved!
Go to solution

Hi,

I was wandering whether is it possible to load a whole array from a .CSV file in a single line, and what is the correct syntax?

 

Instead of something like:

<Locals>,Variable Value

myArray[0], 1

myArray[1], 2

myArray[2], 3

 

Use this: (as you can do in any statement)

<Locals>,Variable Value

myArray,{1,2,3}

 

 

Regards,

Israel

0 Kudos
Message 1 of 3
(1,652 Views)

Meant "wondering" of course, even though I actually wandered through the forum quite a few, seeking for an answer 🙂

0 Kudos
Message 2 of 3
(1,621 Views)
Solution
Accepted by topic author israel.gold

Update:

 

Looks like there is a workaround, as I found in these posts:

 

CSV-with-comma-in-string 
Using-the-property-loader-to-load-strings-into-an-array 

 

In brief:

Use a .TXT (tab-delimited) file instead of .CSV (comma-delimited) to load an array definition into a string variable,

then use the Evaluate() function to assign it to the array variable. Voila!

0 Kudos
Message 3 of 3
(1,573 Views)