02-10-2020 04:39 AM
Hello All,
I have many type definitions of cluster ed i manage them by making variant.
I need a clever way to edit the element of the cluster identified by the name without cast the variant to the type def. (it is simpler to see what happens in the flat sequence structure in the image below).
I thought to pass by some proprieties of the reference but it seems impossible to convert the reference of a variant into the reference of the contained cluster and is not possible too the re-composition of the variant of cluster after its decomposition in array of variant.
Is the only way to pass throw the "OpenG LabVIEW Data" package?
Many thanks
02-10-2020 05:35 AM
You can probably do it the other way, instead of converting it to and from Variants, you do it all as variants.
You can Convert a Cluster to an Array of Variants (with Variant to data) and simply Replace Array Element, then convert back to the original cluster with Variant to data on the variant array (you might need a To Variant also, and if that doesn't work you'll have to go through Flatten to string ...)
I'll have to test it when i get home. 🙂
/Y
02-10-2020 06:22 AM
@Yamaeda ha scritto:
You can Convert a Cluster to an Array of Variants (with Variant to data) and simply Replace Array Element, then convert back to the original cluster with Variant to data on the variant array
I had tried this way (now I will check again) I cannot found a way to rebuild the variant back exactly like the original, the new variant is not the variant of my starting cluster