Edit: I meant radio control
Just a quick question (I'm just learning Jscript, so be nice), here's what I have:
1 Window with 4 radio controls defined in my XML file (Resp0, Resp1, Resp2, Resp3)
1 array (thecapt) with 10 strings called ("Blah 1", "Blah 2", "Blah 3", "Blah 4", "Blah 5" etc...)
What I need is to be able to load 4 strings from this array into the 4 radio controls at runtime - at the moment I can load the first 4 strings, however for the script to work the strings from the array need to be randomly selected (and not repeated in another radio control). I don't know how to explain really so heres a kinda example..
Run 1:
O Blah 1
O Blah 3
O Blah 4
O Blah 2
Run 2:
O Blah 3
O Blah 4
O Blah 2
O Blah 1
Etc... (each
O is supposed to represent a radio control btw)
At the moment the code to fill the radio controls (in order) is as follows:
code:
iwnd = MsgPlus.CreateWnd("Interface.xml","WndReply")
var i
for (i=0; i< 4; i++)
{
iwnd.SetControlText ("Resp"+[i], thecapt[i])
}
Any help on how to do this is appreciated, I'm NOT asking you to write the code for me (unless you really want to
) but any pointers in the right direction as to how to go about this would be appreciated
Ps:
I also have this code in the script to generate a random number between 0 and a user defined highest number. Dunno if this is of any use in my problem, but I'll include it here anyway:
code:
function RandNo(TopNo)
{
return Math.floor(Math.random() * TopNo);
}