LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D variant it to 2D string

Solved!
Go to solution

hi  everybody ,

 

i am facing a trouble of changing the datatype of variant and string

Is there any method or example to convert the 2D variant to 2D string ?

i have already tried to use "variant to data " many times but fail.

is there any other method or example ?

 

Thank You !!!

0 Kudos
Message 1 of 9
(4,119 Views)

What is a 2D variant??? A 2D array of variants? A 2D array of strings converted to a variant??

 

Can you attach a small Vi containing your variant so we can see what you actually have? Where does the variant come from?

 

What did you wire to the type input of varant to data? A 2D array of strings? What kind of error do you get when it "fails"?

0 Kudos
Message 2 of 9
(4,116 Views)

HI altenbach 

 

     i am using Database toolset and i select the data from database with 2D variant datatype

after that , i have some 2D string data type data , and i want to insert one of the row of this 2D string data into the 2D variant

and update it to the database.

but the result of my porgram can show the combination of the two information.

i have attached a small program for your reference

 

Thank You

0 Kudos
Message 3 of 9
(4,108 Views)

but the result of my porgram can't show the combination of the two information.

 

sorry , i type wrongly before.

0 Kudos
Message 4 of 9
(4,107 Views)

You don't have a Varaint of a 2D array of strings, but a 2D array of variants. Since your VI does not contain any default data, we can only guess what's actually inside the variant. If each variant is a simple string, you could use 2 FOR loops as follows. Try if this works.

 

 

If this does not work, please make sure the VI you attach contains data (make current values default before saving). We currently really don't have enough information to solve the problem.

 

 

 

Message Edited by altenbach on 03-02-2009 01:45 AM
Message 5 of 9
(4,098 Views)

...or this.  BTW, I've given up on using the Database Variant To Data function because it won't accept an array at the 'type' terminal.

 

 

Message Edited by jcarmody on 03-02-2009 05:24 AM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 9
(4,076 Views)

Jim's code works (at least in 8.2):

 

But I guess you don't have a variant with string contents.

You could use the 'Variant probe' to see what kind of data is inside the variant. Place the probe on a 1D or scalar element of your 2D array see what datatypes are returned.

 

 

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 9
(4,058 Views)
Solution
Accepted by topic author shingy

Those information are very useful and help me a lots

Thank you very much !!

 

Now i can use it to convect ...

0 Kudos
Message 8 of 9
(4,048 Views)
That's one way to have your posts selected as the solution, not the intended way, but a way...
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 9 of 9
(4,044 Views)