Page 1 of 1

ComboBox

Posted: Wed Sep 07, 2005 12:51 pm
by jimo
How do I populate a dropdown box with runtime values?

Posted: Wed Sep 07, 2005 1:53 pm
by sinan
Is the number of items known at compile time?

Posted: Wed Sep 07, 2005 1:53 pm
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?

Posted: Wed Sep 07, 2005 3:27 pm
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.

Posted: Wed Sep 07, 2005 3:28 pm
by jimo
Gotcha!

Thanks!

Posted: Wed Oct 07, 2009 4:57 pm
by Tiago
Thanks a lot, mr. Sinan!
That was very helpful! :D