10-24-2012 01:36 PM
I am creating a new VI with an array of strings using VI scripting. Now, I want to populate that array from a constant array of strings. What is the best way of doing that?
Below is a screenshot of the code that I have so far. What I have populates the first element of the array, but I can't figure out how to access the other elements. Any suggestions?
Thanks,
Emily
Solved! Go to Solution.
10-24-2012 01:44 PM
After you put the string in the array (part of the creation), you should just close out that reference. You should be setting the value of the Array.
02-24-2015 09:58 AM - edited 02-24-2015 10:18 AM
Hi Crossrulz
I couldn't understand the solution you mentioned. I have to add values in the higher indices of array (which I create in another VI through VI scripting). For this, I am running a loop to populate an array, but all the values are overwritten on index 0 of array. Screen shot is attached.
Regards
HB
02-24-2015 12:02 PM
If you are populating an array, you need to write the entire array to the array control. You can't just write a single element with a property node. So read the current value, change/add whatever values you need to, and then write the new array back into the control.