How to clear Radiomenu selections

Post Reply
User avatar
Ross_ValuSoft
Posts: 87
Joined: Thu Dec 18, 2008 11:27 am
Location: Melbourne, Australia

How to clear Radiomenu selections

Post by Ross_ValuSoft »

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.

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
 
So how can I clear any previous selections off the screen? I need to do this based upon some previous logical combinations.

Thanks,

Ross
Post Reply