Discussion:
numeric drop down menu
(too old to reply)
Manc Pablo
2008-08-12 15:10:09 UTC
Permalink
Dear Gurus,I am clearly being simple and missing something here, despite a trawl of the help pages.I have a 1 D array of numeric values. I want to create and update a drop down menu so a user can select a numeric value, a bit like a combo box, but with numeric data in there. No labels, just numbers. The array has a variable length.Is there any way to do this without converting the numbers to strings and shoving it into a combo box? I've been struggling and failing with the Menu RingPaulMessage Edited by Manc Pablo on 08-12-2008 10:02 AM
tst
2008-08-12 15:10:13 UTC
Permalink
Manc Pablo wrote:
Is there any way to do this without converting the numbers to strings and shoving it into a combo box?


What's the problem with this method? It only requires a single function (decimal number to string) which can handle the entire array.
 
The same will work for a ring (which I usually prefer to combo boxes).
smercurio_fc
2008-08-12 15:10:13 UTC
Permalink
You're confusing the value of the ring with the string being displayed. The string is what the user sees in the dropdown. The value is what gets returned to the program. Thus, you need to convert the array of numbers to a string so you can set the strings that are displayed to the user. All rings work this way. Note: You can wire the array of numerics to the "Values[]" property node. This will generate a list of items with "<>" characters around your numbers. Normally this indicates a value that has no corresponding display string. The "Values[]" property node is also considered a private property, not generally intended for normal use.
Manc Pablo
2008-08-12 15:40:21 UTC
Permalink
Thanks guys, looks like I need to convert the numeric data to strings! as for the value[ ] property node, I cannot see that when I right click..create..property node etc, only strings[ ] and strings and values[ ]P
smercurio_fc
2008-08-12 15:40:22 UTC
Permalink
That's because it's super secret private stuff and you need to add a couple of keys to the LabVIEW.ini file for them to appear. Stick with the regular "Strings[]" property. I don't think you want to make life harder for yourself by testing uncharted waters, especially if you're just starting out. :smileywink:
Manc Pablo
2008-08-12 15:40:24 UTC
Permalink
oh no, I've been using Labview since 1995, but up until now all I've every needed to do was to read/write to serial ports, set and read voltages using pre-written drivers and then some funky maths and a save. until now........:smileyvery-happy:
Continue reading on narkive:
Loading...