LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown list from max and min value

Solved!
Go to solution

Hi,

I want to create a dropdown menu of natural numbers; I want to input maximum and minimum value and it should show me the list of all natural numbers between these two numbers. My idea was to create an array with for loop and connect it with drop down list. But it seems like my MATLAB logic is useless here and couldn't figure out how even create an array. Any suggestion? Thanks.

0 Kudos
Message 1 of 9
(312 Views)

So you have three controls:

 

Two integer controls to enter lower and upper limit

A ring that will fill with items containing all integers in-between. (within reason, you don't want a million entries!). The terms "between" is a bit fuzzy, but I assume you also want to include the limits in the ring.

 

Should be trivial. Code will fit on a postage stamp. What have you tried?

0 Kudos
Message 2 of 9
(296 Views)
Solution
Accepted by mub.re

Try this:

 

altenbach_0-1653157925883.png

 

Don't forget the learning resources listed at the top of the forum.

 

 

 

 

0 Kudos
Message 3 of 9
(291 Views)

Thanks! I was trying with for loop and array to connect with combo-box

0 Kudos
Message 4 of 9
(266 Views)

@mub.re wrote:

I was trying with for loop and array to connect with combo-box


That sentence has absolutely no information content. 😄

0 Kudos
Message 5 of 9
(251 Views)

I had no idea, what I was doing😂. Thank you again for uploading the solution

0 Kudos
Message 6 of 9
(245 Views)

Hi,

one more question. How can I get the selected number? When I try to extract, it gives me only values(0,1,2..). 

0 Kudos
Message 7 of 9
(223 Views)
Solution
Accepted by mub.re

@mub.re wrote:

Hi,

one more question. How can I get the selected number? When I try to extract, it gives me only values(0,1,2..). 


You can us the value to index into the blue array to get the number or you could write the strings&values property instead.

 

Here are two possibilities:

 

altenbach_0-1653230020166.png

 

 

altenbach_1-1653230174869.png

 

 

0 Kudos
Message 8 of 9
(215 Views)

You are a lifesaver, thanks!

0 Kudos
Message 9 of 9
(202 Views)