using String with form

richjo100 wrote on 10/28/2004, 10:16 AM
Hello all,

I have produced a windows form to appear when a script is run from Vegas,. It will have various option on it from which the user can choose. I want to include a combo box with about 5-6 different options. The options differ accordig to the computer the script is run on so I do not want to hard code it.

I can add a combo box and hard code info as follows:

private var comboBox : System.Windows.Forms.ComboBox;
this.comboBox = new System.Windows.Forms.ComboBox();
comboBox.items.add("boo");
comboBox.items.add("boo1");
comboBox.items.add("boo2");

However I want to use the addRange option.

In otherwords pass the combo box an array of string

ie
mystr = new String[] {"boo","boo1","boo2"};
comobBox.items.AddRange(mystr);

I havent got to the population of mystr but I just want to get this working first.
I gets errrors when I try and run the script from Vegas because it expects a semi-colon. Can you not have an array of String in JScript? If you can where am i going wrong?

Thanks in advance

Richard

Comments

richjo100 wrote on 10/28/2004, 10:25 AM
As is the way with these things I had a flash of inspiration after posting. It is a bit of a hack but it does work

*************

myarray = new Array();
this.str1 = new String();
str1 = "boo2";
this.str2 = new String();
str2 = "boo3";
myarray .push(str1);
myarray .push(str2);
comboBox.Items.AddRange(myarray );

*************

So by adding individual strings to an Array I produce the kind of output I want. Does anyone know about the String array (instead of array of strings)......just out of interest

Richard