04-15-2010 12:44 PM
Hello everyone,
I've spent the last few hours thinking about how I want to do this, and could use some help. I have a case structure nested inside two for loops. After analyzing some data in the inner for loop, every time the case structure is true, it writes to a 2D array. Now the problem is when the outer for loop goes to the next iteration, it overwrites the previous 2D array that was written. I'd like that every time the inner for loop is finished, it appends the data to a 2D array. Hopefully that makes sense. Seems like it should be simple, but I can't figure out what I'm doing wrong.
Thanks!
Alex
04-15-2010 12:49 PM
04-15-2010 12:52 PM
Hi Alex,
Since you want to keep your array for each iteration, you need a shift register for the outer loop as well. You may want to have another shot. Btw, replacing a initialized array is always more efficient than just appending to the previous array, but you can ignore it for now. Just when your data set grows you need to do some changes.
Regards,
Bo
04-15-2010 01:01 PM
You had the basic idea for your code. You just needed to expand it slightly to provide a varaible to store all the iteration's data.
04-15-2010 01:06 PM
Aaaaaaaaah! Concatenate inputs! Not sure how I forgot to do that. I tried what you had there, but forgot to select that option. Thanks alot!
Foolooo: Not sure what you meant by your post. How do I make this code more efficient?
Thanks!
04-15-2010 01:12 PM
Hi, Alex
Sorry to confuse you. I think you solved the problem already. What I meant is initialize an array first, and then replace the subset instead of 'appending to the array'. Thats just a thought, a way to use the memory more efficiently. If your data set is *big*, you may want to concern about it, or else just forget it. Hope this answers your question.
Cheers,
Bo