12-18-2021 12:55 PM
Hi,
I have a numeric 1D array in TestStand without an upper bound. The array is called FileGlobals.Pressure_Values. I would like to initialize this array and add elements to the end of the array with a post expression. How do you initialize an array when you don't know the total number of elements that will be in the array? How do you add an element to that array, without specifying the exact index? I want to add an element after the last element that was inserted into the array.
I was thinking something like this, but this only works when I know the index. I will not know which
FileGlobals.Pressure_Values = {10}, //Initialize the array
FileGlobals.Pressure_Values [0] = 15 //Set index 0 to 15
Thanks for your help!
12-30-2021 10:56 AM
FileGlobals.Pressure_Values += {13} will append a 13 to the end of the array.
You can also use the set array bounds function.
Hope this helps.
01-03-2022 10:32 AM
That worked.
Thank you!