ID:1027094
 
Code:
if(!winget(src, "maleRadio", "is-checked") && !winget(src, "femaleRadio", "is-checked"))


Problem description:
I'm trying to make sure a radio button in a group is selected before proceeding, but things are getting messy with my method of manually checking every radio input for that mechanic, to see if it's checked. I know there's the group thing thats set, but I can't think of any way to put that to use here.

Basically what I'm asking for, is some insight on how to best gather information for radio buttons, or button controls in general for that matter.

You can set all the radio's you want in a specific group group's value to anything and that allows only one of that group to be selected & then you can also check "selected" for the one you wish to be the default.
Ah, so by having a default I don't need to worry about making sure -something- is selected.
Yes.
Is there also a way to determine which of the buttons in a group is selected? I don't want to have a conditional statement for every control, as for things like a races layout it can get quite extensive.
In response to Kitsueki
Kitsueki wrote:
Is there also a way to determine which of the buttons in a group is selected? I don't want to have a conditional statement for every control, as for things like a races layout it can get quite extensive.

I don't believe so other than.
if(winget(src,"______","is-checked"))
Damn, thats what I wanted to avoid. Well, thanks anyway Kozuma3.
You could go here and support the feature requesting this: id:94612
In response to Kitsueki
The more efficient way to use winget() would be to use winget() only once, to get a parameter list with the is-checked value of every control in a window.

Another option would be to give each radio button a command.
client
var gender_choice = ""
verb/choose_gender(choice as text)
if(choice == "male" || choice == "female")
gender_choice = choice

verb/finish_gender_choice()
if(gender_choice == "male" || gender_choice == "female")
src << "You choose to be [gender_choice]!"

// The radios' commands would be
choose-gender "male"
choose-gender "female"

That seems almost as lengthy as just using a script of conditions to check each control, unless I'm missing something?

As far as your efficiency suggestion on using winget() only once, I agree with you. I've stored the values in a variable for the ones I need to check on more than one time.

As far as using it to get a list of all the is-checked values for controls, I'm not really sure how to handle that.. (It could be due to the fact that I'm really tired though, lol)

I made a reply SSX, thanks for the link.