Hello all, I’m writing a C# node that outputs some spreads and I cannot find a way to easily dump a collection of values in one of those spread outputs.
Let’s say I have a char[] somewhere, and I’d like to have all its items in an output pin of type Spread<string>. Here’s what I’d like to do in pseudo-code :
public static void Foo(int bar, out Spread<string> MyOutputSpread)
{
[...]
char[] baz = {'a', 'b', 'c'};
for(var item in baz)
{
MyOutputSpread.Add(item.ToString());
}
}
Workaround I’ve found is to create a “temporary” List<string>, add all my stuff inside and then do
Yes, in VL I’d use a SpreadBuilder for such a thing, I tried some things with Intellisense in that direction but could not achieve anything.
I did
MyOutputSpread.ToBuilder().Add(baz);
But then it complains about Use of unassigned out parameter MyOutputSpread, but I could not find a constructor for Spread<T> (so that I could do MyOutputSpread = new Spread<T> before the loop)