LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert variant to string

can someone tell me how to convert a variant to a string?
in my case variant can be a string or any kind of number, how to convert that to a string like
"abcd" or "12.4" (as well a string)
0 Kudos
Message 1 of 5
(5,004 Views)
You can use the Variant to Data function under Advanced>>Data Manipulation>>Variant palette. This will allow you to pass a variant type into the function and specify what type you want out.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
Message 2 of 5
(5,004 Views)
nice to know, but there another problem:
I don't know it's type. If I just link a string constant there, I doesn't work.

I'm using an event (value change) and I would like to get a value (converted to string) and I want to know which control was modified

I tried to use a ring control and a numerical control, but always seems only one or no one to work

Can you help me?
0 Kudos
Message 3 of 5
(5,004 Views)
Try the flatten to string function under Advanced>>Data Manipulation. This might help you. You can use some of the variant functions and the flatten functions. Also you can try the type cast function and type cast the variant to a string and you will see some identifiers that might be able to help you determine what type it would be. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 4 of 5
(5,004 Views)
www.openg.org has a nifty variant toolkit that might help you.

Chris_Mitchell
Product Development Engineer
Certified LabVIEW Architect

Message 5 of 5
(5,004 Views)