Page 1 of 1

Conditional Radiobutton

Posted: Wed Jul 07, 2010 12:15 pm
by Ross_ValuSoft
Hi everyone,

This should be a simple one for most of you ... I hope.

I have two radiobuttons which are both initialised to the first position.

If I change from position 1 ("Pass") to position 2 ("Fail") in the first radiobutton, how do I get position 5 ("Withdrawn from service") to be selected and displayed in the second radiobutton?

Thanks,

Ross

Code: Select all


nVis := 1
nRes := 1
@ 1.5 + nOffset, 1 GROUP oGrp to 4, 14 PROMPT "Visual"

@ 0.75, 2 RADIO oRad1 VAR nVis ;
      ITEMS "Pass","Fail" ;
      ON CHANGE {|| IIF( nVis == 2, nRes := 5 , "" ) } ;  <===== need help here
      SIZE 40, 9 of oGrp

@ 5.5 + nOffset, 1 GROUP oGrp2 to 11.5, 32 PROMPT "Results"

@ 0.75, 2 RADIO oRad3 VAR nRes ;
      ITEMS "Visual + Electrical OK","Refitted lead", "Replaced plug", ;
      "Replaced socket", "Withdrawn from service", "Visual only";
      SIZE 140, 12 of oGrp2

 

Re: Conditional Radiobutton

Posted: Wed Jul 07, 2010 1:04 pm
by Antonio Linares
Ross,

Try it this way:

Code: Select all

@ 0.75, 2 RADIO oRad1 VAR nVis ;
      ITEMS "Pass","Fail" ;
      ON CHANGE {|| IIF( nVis == 2, oRad3:SetOption( 5 ), "" ) } ;  <===== need help here
      SIZE 40, 9 of oGrp
 

Re: Conditional Radiobutton

Posted: Wed Jul 07, 2010 2:10 pm
by Ross_ValuSoft
Many thanks Antonio.

It works perfectly.

Regards,

Ross