
Behavior:
When decomposing a variant containing an array of variants into an array of variants with the function "Array to Array of VData", the elements are automatically unwrapped from their variant, so instead of having an array of variants containing each a variant, I have an array of variants with the contained type directly.
Problem:
Now I have an array of variants with heterogeneous contained types, so I cannot apply the reverse operation with function "Array of VData to Array". I have to wrap each element back in a variant first, then use the reverse function.
This behavior differs from the similar function for clusters, which, when decomposing a cluster of variants into an array of variants, effectively gives the correct "Variant" type (the elements are not unwrapped from their variant).
Explanation:
This is because "Array to Array of VData" internally uses the native function "Variant to Data", which naturally unwraps variants, while "Cluster to Array of VData" implements its own parsing method, which strictly preserves data types.
Proposed solutions:
Align the behavior of "Array to Array of VData" with the function "Cluster to Array of VData", meaning strictly preserve data types of the elements.
If modifying the current behavior is too dangerous for applications relying on the current behavior, could we imagine adding an option on the function to choose to not unwrap the variants?
See attached the VI created with LV2020-32bit:
[LV2020] OpenG Array to Array of VData Unwraps Variants.zip
Regards,
Raphaël.
Behavior:
When decomposing a variant containing an array of variants into an array of variants with the function "Array to Array of VData", the elements are automatically unwrapped from their variant, so instead of having an array of variants containing each a variant, I have an array of variants with the contained type directly.
Problem:
Now I have an array of variants with heterogeneous contained types, so I cannot apply the reverse operation with function "Array of VData to Array". I have to wrap each element back in a variant first, then use the reverse function.
This behavior differs from the similar function for clusters, which, when decomposing a cluster of variants into an array of variants, effectively gives the correct "Variant" type (the elements are not unwrapped from their variant).
Explanation:
This is because "Array to Array of VData" internally uses the native function "Variant to Data", which naturally unwraps variants, while "Cluster to Array of VData" implements its own parsing method, which strictly preserves data types.
Proposed solutions:
Align the behavior of "Array to Array of VData" with the function "Cluster to Array of VData", meaning strictly preserve data types of the elements.
If modifying the current behavior is too dangerous for applications relying on the current behavior, could we imagine adding an option on the function to choose to not unwrap the variants?
See attached the VI created with LV2020-32bit:
[LV2020] OpenG Array to Array of VData Unwraps Variants.zip
Regards,
Raphaël.