Replace items wrap bug?

2019-10-11%2013_59_24-Window (8.0 KB)

Hi all!
The trick of using -1 index to “select” the last item of a list… doesn’t work with Replace items component.
Is this a bug?
Am I doing something wrong?


Use ListLength-1 instead?

Using “-1” index is simple and precise.
Having to pick list length would be using one additional input, which is not convenient.

A single “-1” index with a single item for replacing, works.
It doesn’t with many indexes/items. (9.6 KB)

Seems like there are more problems…

Hello ; how this wrong and the other correct? both of them look wrong and i don’t think replace items worked like that, items must replaced with precise indices and length of list to modify >= length of lists of items to replace with, or you have a different point?

Green is correct because the index used are just “1”, so only the second element of the original list is modified.
“CC” is the last of the “I” input, to that’s the one remaining.
Totally expected result, for me.

Red is wrong because the value “2” of the original list, which is the third element (index=2), is replaced! … even when i never used an i=2 index for replacing.
Even worse, original list length was 3, the output have a length of 4 … replacing should not increase or decrease the length of the list it is working on…

Hi Riccardo when you use a list of items with Replace i you must use -2 to replace the last item. This method just works only with this component.
On the other hand, when is a single value this work as expected :man_shrugging:.


Emm but why?

1 Like