How to clear Radiomenu selections
Posted: Sun Oct 23, 2011 7:00 am
Hi all,
I want to be able to clear a previous selection for a Radio button control. At start up, the following code initialises with no option highlighted. Correct. After the first button press, it is also correct, but fails with an array bound problem after the nValue is reset to zero.
So how can I clear any previous selections off the screen? I need to do this based upon some previous logical combinations.
Thanks,
Ross
I want to be able to clear a previous selection for a Radio button control. At start up, the following code initialises with no option highlighted. Correct. After the first button press, it is also correct, but fails with an array bound problem after the nValue is reset to zero.
Code: Select all
#include "FWCE.ch"
function Main()
local oDlg, oRad, nValue := 0
DEFINE DIALOG oDlg SIZE 230, 100
@ 0.2, 2 RADIO oRad VAR nValue ITEMS "One" OF oDlg SIZE 25, 20
@ 0.2, 6 RADIOITEM "Two" RADIOMENU oRad OF oDlg SIZE 25, 20
@ 0.2, 10 RADIOITEM "Three" RADIOMENU oRad OF oDlg SIZE 25, 20
@ 1.7, 7 BUTTON "Value" OF oDlg ACTION ( MsgInfo( nValue ), oRad:Refresh(), ++nValue, IIF( nValue == 4, nValue := 0, ) )
ACTIVATE DIALOG oDlg CENTERED
return nil
Thanks,
Ross