Replace multi sublists with multi sublist at index

Could try this too …


repMul.dyn (6.3 KB)

def RepMul (lst:var[]..[],ind:var[]..[],itm:var[]..[])
{
	return [Imperative]
	{
		a = [];
		c = -1;
		for (i in ind)
		{
			c = c + 1;
			a = List.ReplaceItemAtIndex(lst,i,itm[c]);
			lst = a;
		}
		return a;
	}
};

RepMul (lst,ind,itm);
1 Like