how to use setexpression with radiobuttons
Posted: 05 Feb 2013 14:51
hello,
I am trying to set a radiobutton to a certain state with another button, but it does not work.
what i tried:
1. to use a normal "button" to change the state of another button called CustomButton2, this script works;
"button" sets ' CustomButton2.x to "on" or to "1'..
script used in the "button":
setexpression(CustomButton2,' x', 1);
2. to convert this script so it will be usable for radioswitches, normaly you adress a radioswitch like this: 'x[0]' for the first button, 'x[1]' for the second button and so on.
so I expect the script for a radiobutton called "Switches" with 3 buttons ( 'x[0]', 'x[1]', and 'x[2]') to be;
setexpression(Switches, 'x[1]', 1);
to set the radioswitch to the "second button" so to speak.
this does not work..
I also tried:
decl ind=firstof(Switches.x);
setexpression(Switches, 'x[1]', 1);
and tried if adding the state of all the other buttons in the radiobutton would make a difference:
setexpression(Switches, 'x[0]', 0);
setexpression(Switches, 'x[1]', 1);
setexpression(Switches, 'x[2]', 0);
none of this works.
Odley enough the script:
setexpression(Switches, 'x', 1);
works, this sets ALL the radioswitches buttons to on (or off when you use '0' instead of '1').
Does anybody know what I am doing wrong here?
thanks,
Jurgen
I am trying to set a radiobutton to a certain state with another button, but it does not work.
what i tried:
1. to use a normal "button" to change the state of another button called CustomButton2, this script works;
"button" sets ' CustomButton2.x to "on" or to "1'..
script used in the "button":
setexpression(CustomButton2,' x', 1);
2. to convert this script so it will be usable for radioswitches, normaly you adress a radioswitch like this: 'x[0]' for the first button, 'x[1]' for the second button and so on.
so I expect the script for a radiobutton called "Switches" with 3 buttons ( 'x[0]', 'x[1]', and 'x[2]') to be;
setexpression(Switches, 'x[1]', 1);
to set the radioswitch to the "second button" so to speak.
this does not work..
I also tried:
decl ind=firstof(Switches.x);
setexpression(Switches, 'x[1]', 1);
and tried if adding the state of all the other buttons in the radiobutton would make a difference:
setexpression(Switches, 'x[0]', 0);
setexpression(Switches, 'x[1]', 1);
setexpression(Switches, 'x[2]', 0);
none of this works.
Odley enough the script:
setexpression(Switches, 'x', 1);
works, this sets ALL the radioswitches buttons to on (or off when you use '0' instead of '1').
Does anybody know what I am doing wrong here?
thanks,
Jurgen