Hi reto
It seems as if you want to code some kind of generic property writer. There are several ways to do something like this. One way is what you are trying to do and there are others.
For instance you could write the flattened string directly to the file, you could define the type using lable prefixes instead of using the type descriptor to determine what type of value it is and there are others.
It depends on what exactly you want to do. If I want to store settings, I always create a cluster containing all the elements I want to store and use this cluster to write an xml-file. This works quite good for my purposes, maybe it won't for yours.
To answer your question - the only function to convert a variant to a specific data type is already used in your vi (variant to data). But there is no generic conversion function.
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------