ComboBox

Got a problem you cannot solve? Try here.
Post Reply
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

ComboBox

Post by jimo »

How do I populate a dropdown box with runtime values?
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

Is the number of items known at compile time?
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

No, it is variable. Also, if the read from text file reads one line in, how do I loop from through the file until I reach the end?
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

Edit the items property of the combo box and assign it to a variable, say $ITEMS$. Set the ITEMS variable to contain all the values, each value delimited by the $NEWLINE$ variable, like item 1$NEWLINE$item2.

You may also want to set the text property of the combo box to, say, $SELECTION$, and also tell it to write to the SELECTION variable, and later read that variable to see what has been selected. Finally, you may want to initialize the SELECTION variable to the default value you want to populate the combo box with.

Of course, all variable names above are just examples. Any resemblance to real variable names is purely coincidental ;)

For reading from the text file and looping, use the GoTo, Label, and Read from Text File commands.
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

Gotcha!

Thanks!
Tiago
Posts: 129
Joined: Thu Jun 18, 2009 9:08 am

Post by Tiago »

Thanks a lot, mr. Sinan!
That was very helpful! :D
[b]Tiago Rocha[/b]
[i]Product Technology[/i]
www.ppi-multitask.com.br
Post Reply