LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

map with LabVIEW

Solved!
Go to solution

hello all,

I wish to know, if it is possible to use map like in C++?

I have 2 arrays, one of string and one of dbl. The user need to write a name of parameter in string control, and after i need to find the value of this parameter by a searching in the string array. It's a long solution. And i need to do it many times. It's for that i have thinking of map in c++

If someone can hlep me ^^

thanks

0 Kudos
Message 1 of 8
(4,840 Views)

Hi mioumiou,

this should work for you.

 

 

Mike

Message Edited by MikeS81 on 02-10-2009 11:52 AM
Message 2 of 8
(4,837 Views)

thanks a lot for your quick answer.

I thought about this solution, but the problem, it's that i will have a array of 500 or more parameters, and this solution, will take a little bit of time to find just one parameter. And for each iteration of while loop, i need to make this research 500 times. This will take a very long time.

I think about map in c++ but if you are a better idea, i take  Smiley Happy

 

0 Kudos
Message 3 of 8
(4,831 Views)

Youn might want to look at variant attributes. 

 

You can learn more in this Community Nugget called "Implementing sets with variant attributesin this Community Nugget called "Implementing sets with variant attributes"


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 4 of 8
(4,813 Views)
Solution
Accepted by topic author mioumiou
Another place to read about using variant attributes (LAVA Forums)

Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 5 of 8
(4,795 Views)

thanks a lot,

variants seems to be the solution.

thanks thanks thanks Smiley Happy

0 Kudos
Message 6 of 8
(4,785 Views)

Many thanks, Phillip for point to these links. I was pretty skeptic about attributes before. But it just incredible!

Just done quick test - searching 25000 lines in 80000 strings dictionary taking approx. 22 seconds with search array, or 6 seconds with small improvement or just 20 milliseconds with Variant attributes.

1000 times faster... Still can't believe...

 

Andrey.

Message Edited by Andrey Dmitriev on 02-10-2009 04:01 PM
Message 7 of 8
(4,761 Views)
For a while we had a prototype of a generic map container on NI Labs.  It is listed now as a "graduate" which I think means that it should find its way in the product at some point.  You can follow the discussion and ask questions here.
Travis M
LabVIEW R&D
National Instruments
Message 8 of 8
(4,754 Views)