05-31-2001 03:56 PM
05-31-2001 03:57 PM
05-31-2001 04:35 PM
06-01-2001 12:48 AM
01-31-2007 01:48 PM
Hi,
I was reviewing a post that you replied to. This post dates back to 2001 so bear with me.
I was also wanting to create a dynamic array. I downloaded the example from previous post to this original message. The example worked great in my application but I still don't understand.
If the Insert Into Array has an Index terminal, how does adding shift registers make the array grow. Why not wire the shift registers to the index terminal. I see that it doesn't work but I don't know why.
01-31-2007 03:24 PM
01-31-2007 03:27 PM
01-31-2007 03:51 PM - edited 01-31-2007 03:51 PM
@Jim P wrote:
If the Insert Into Array has an Index terminal, how does adding shift registers make the array grow. Why not wire the shift registers to the index terminal. I see that it doesn't work but I don't know why.
You are absolutely right that proper code should have a shift register that keeps track of the insert point and gets incremented every time the array grows. However "Insert into array" has a special meaning if the index is NOT wired: it appends the new element to the end of the array.
Quote from the online help:
This defined behavior is unfortunately rather arbitrary and not very intuitive. Fortunately, you never need to use it! (and I never do!) 🙂 The same operation can be done with a simple "build array" node, giving code that is much more obvious by simply looking at the diagram (see image). There is no difference in the result.
Message Edited by altenbach on 01-31-2007 01:52 PM