lawman_actual 24 Posted December 13, 2016 I'm trying to set a checkbox as unchecked, but I get the error stating "type, number. Expected, control" I've checked the control idc and it matches what i've typed in the script...so I don't know how to get that "number" recognised as an idc. {_x ctrlSetChecked false;} forEach [2801,2802,2803]; I've also had a similar thing before where I was storing group names in an array, but was later unable to issue a command using that recalled group name because it was a "string" as opposed to a "group", even though tests showed that the group name matched the string exactly. Thanks, Law Share this post Link to post Share on other sites
lawman_actual 24 Posted December 13, 2016 Note: error in title fixed as of 16:22 Share this post Link to post Share on other sites
R3vo 2652 Posted December 13, 2016 You probably need to get the display first: { ((findDisplay IDD) displayCtrl_x) ctrlSetChecked false; } forEach [2801,2802,2803]; or disableSerialization; private _display = findDisplay IDD; { (_display displayCtrl _x) ctrlSetChecked false; } forEach [2801,2802,2803]; Share this post Link to post Share on other sites
killzone_kid 1326 Posted December 13, 2016 Always check syntax https://community.bistudio.com/wiki/ctrlSetChecked For example 2801 is Number while command wants Control Share this post Link to post Share on other sites
lawman_actual 24 Posted December 14, 2016 10 hours ago, killzone_kid said: Always check syntax https://community.bistudio.com/wiki/ctrlSetChecked For example 2801 is Number while command wants Control I think this is what i failed to grasp thus far. As an example, I have used these in the same file and they seem to work fine...which I think led me to be confused between idc and control: ctrlSetText [1002,(format ["%1",_providerMunition])]; //Set Munition ctrlSetText [1004,(format ["%1",_providerSize])]; //Set Battery Size ctrlSetText [1007,(format ["%1",_providerMin])]; //Set Min Dist ctrlSetText [1008,(format ["%1",_providerMax])]; //Set Max Dist ctrlSetText [1010,(format ["%1",_providerPos])]; //Set POS Now i see that in the syntax it asks for idc in the setText example, rather than control. Anywho, I'll go back and try out the suggestion. Thanks (Sub-note: massive thank you to KK for your GUI tutorials, among your other work. I'd have really struggled without it) Share this post Link to post Share on other sites
lawman_actual 24 Posted December 16, 2016 Well i'm not getting an error anymore, but the desire outcome still isn't ocurring. //If HE ranging selected: if (_IdcAsNumber == 2800) then { hint "Marker check"; ((findDisplay 0002) displayCtrl 2801) ctrlSetChecked false; ((findDisplay 0002) displayCtrl 2802) ctrlSetChecked false; ((findDisplay 0002) displayCtrl 2803) ctrlSetChecked false; //{((findDisplay 0002) displayCtrl _x ) ctrlSetChecked false;} forEach [2801,2802,2803]; }; The aim is that only one of four boxes can be checked. So i figured when any one is checked, it can set the other 3 to unchecked. However, when I run a test and check 2801, then 2800 - nothing happens. Both boxes remain checked even though the "Marker check" correctly trips. I've tried both with and without the foreach Share this post Link to post Share on other sites
lawman_actual 24 Posted December 16, 2016 Apologies; probably should have given that a bit longer before asking. Once i remembered there was also cbSetChecked it worked. Thanks for your help guys Share this post Link to post Share on other sites