Conditional Radiobutton

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

Conditional Radiobutton

Post 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

 
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Conditional Radiobutton

Post 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
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Ross_ValuSoft
Posts: 87
Joined: Thu Dec 18, 2008 11:27 am
Location: Melbourne, Australia

Re: Conditional Radiobutton

Post by Ross_ValuSoft »

Many thanks Antonio.

It works perfectly.

Regards,

Ross
Post Reply