Resetting an Option so no Radio is selected

I have a window that includes an option box with four radio buttons. When I complete the form, I blank all the fields and go back to the first input field. My problem is the radio buttons are not resetting. The last choice is still selected. Can someone help me with the process to reset the option and radio buttons? I am using Clarion 9.1

You could post your window code showing your OPTION and RADIO’s to help us.

If the OPTION( Variable ) does not match any RADIO Value then no Radio should be selected.

Are you sure you cleared then Option Variable? Did you do a DISPLAY?

How to clear the Option Variable is what I am looking for. Yes I did do a Display.

I am not sure which code you want

 OPTION('Condition Notes'),AT(94,149,77,71),USE(?OPTION5),BOXED
     RADIO('No Power'),AT(102,162),USE(?OPTION5:RADIO1)
     RADIO('Broken Wires'),AT(102,175),USE(?OPTION5:RADIO2)
     RADIO('Not Working'),AT(102,187),USE(?OPTION5:RADIO3)
     RADIO('Clear Choices'),AT(102,207),USE(?OPTION5:RADIO4)
 END

When one of the radio buttons are selected I embed setting a local value when accepted:
Loc:check = ‘1’

I am not sure what the value is of ?Option5 is or ?Option5:Radio4 is when it is selected or how to set it back to not selected.

Thank you that is exactly the code we needed and identifies why you are having a problem.

If you changed your Option(variable) from ?OPTION5 to Loc:Check then the selected Radio number would go into the variable Loc:Check without any embed code. Also no embed code is required when the window opens to select the Radio. Then when you reset Loc:Check=0 you will have no Radio selected.

Since your RADIO controls do not have a VALUE() attribute they will be numbered 1,2,3,4. I.e. picking the 3rd choice RADIO('Not Working') will put 3 into Loc:Check. If you would like different numbers you must specify a VALUE(). See the Help on OPTION and RADIO.

If you wanted to keep it as USE(?OPTION5) to clear the selected Radio try CHANGE(?OPTION5,0). If that does not work try ?OPTION5{PROP:ChoiceFEQ}=0

Those are what is called an FEQ, read the Help about “Field Equate Labels”.

Each Field is identified by a LONG Number, the FEQ is for writing code without using those numbers. In your case if we assume this OPTION was the first field on the Window then ?OPTION5 = 1, and ?Option5:Radio4 = 5 because its the 5th field. You’ll see a lot of Generated code using these FEQ’s. It’s best to not think about what exactl number they get assigned, you just know its a number and they are normally sequential.

1 Like

Thank you so much for that help! I changed the use of ?Option5 to loc:check and everything is working now.