Combo box, fill from file

Recommended Posts

In chapter 9.10.2 of the users guide, it outlines how to populate a channel from a text file.  My question is, using a script that first clears the contents of combo boxes, would I be able to repopulate these combo boxes from a text file. Instead of passing the strings to a channel, I just pass them to a combo box, using object naming. 

So if StrIn is the value read from the file, instead of:

mychannel = strtodouble(parse(StrIn,1,",") 

I use


Repeated for every value in list

Link to comment
Share on other sites

 Certainly.  But AddChoice is a function, not a variable so you don't use =.  It would be:

Component.myComboBox.AddChoice(strIn, strIn)

Note that the function requires two parameters, the first is what is displayed in the combo box.  The second is what is set when the particular item is selected.  If you want them to be the same, you just pass the same thing as I did.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.