08-31-2018 12:43 PM
Is there an easy way to take a variant that might contain anything and output a variant that contains an array of that thing?
Build array won't work because it will yield {Array{Variant{Thing}}} and what I need is {Variant{Array{Thing}}}.
Solved! Go to Solution.
08-31-2018 12:49 PM
What kinds of "things" are you talking about?
The key point of arrays is that every element must be of the same type. So if you want an Array{Thing}, then every Thing in that array must be the same type of Thing.
08-31-2018 12:50 PM
What about using variant attributes? They allow you to create arbitrary lists of anything.
08-31-2018 12:57 PM
Not "things", "thing". The "thing" could be anything. I have an incoming variant that might contain anything (I don't have any control over it). I want to build an array of that "thing" and put it into a variant.
08-31-2018 01:13 PM
Since the thing is a variant, and you want to put an array of those "things" into a variant, it sounds like you want a Variant{Array{Variant}}.
09-01-2018 10:36 PM
@RavensFan wrote:
Since the thing is a variant, and you want to put an array of those "things" into a variant, it sounds like you want a Variant{Array{Variant}}.
Not quite. The "thing" is not a variant, it is what is inside a variant.
Your code produces a variant of an array of variants of things.
I want a variant of an array of things.
09-01-2018 10:39 PM
As happens not infrequently, the solution came to me as I was laying in bed waiting to fall asleep.
09-05-2018 08:02 AM
That usually works, but it gags if the "thing" is an array (because it tries to put an array in an array).
It should act like "Build Array", and if it gets an array as an input, just add another dimension.
Here's the fixed version:
Note: This doesn't pass any data along, it always outputs an empty array (for my I app, I only need the variant to contain type info).