LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid row constraint using insert into array?

Hi All,
 
I'm very new to labview, but so far so good. I am running into some issues with insert into array. Basically, I extract data based on a customer name and place it into a listbox. The recursion works well as it goes thru the list and grabs the data of each customer, however, the # of rows of data it grabs seems to be constrained by the # of rows from the first customer.
 
For example, if I grabbed 10 rows for customer 1-> insert into array places 10 rows-> grab 15 rows for customer 2 -> insert into array places ONLY 10 rows (at the second column, whereas i want it to actually place the 15 rows)
 
Is there a workaround or some property that can help me unconstrain the # of rows? I kept thinking maybe I can specify the # of rows at the start to be something really large(which I'll never use), but I wasn't sure how to do that.  Any help would be much obliged.
 
(attached file)
 
Thank You!
0 Kudos
Message 1 of 3
(2,494 Views)
At the beginning, you could use the array size function and then use that for the Initialize Array to create a 2D array with empty string constants for the data. In your loop, instead of the Insert Array, use the Replace Array function. As an alternative, you could use the Build Array function in the loop. This will work if you always want to append at the end of the existing array. When using the Build Array, it appends new elements as rows so if you want to append columns, you could use the Transpose 2D array before the Build Array and another Transpose 2D Array after the Build Array.
Message 2 of 3
(2,477 Views)

thank you so very much for your help!

That trick with the transpose - build array - transpose worked like a charm!

0 Kudos
Message 3 of 3
(2,458 Views)