Radio Buttons

A choice with text beside it. Radio buttons are combined to show a user a fixed set of choices from which only one can be selected.

BEGIN_LOOP

  REQUEST    FIELDS(#SCREEN)

      IF         COND('#RADIO01 *EQ *RADBUTTONSELECTED')

  MESSAGE    MSGTXT('Radio button 1 is selected')

      ENDIF

      IF         COND('#RADIO02 *NE *RADBUTTONSELECTED')

  MESSAGE    MSGTXT('Radio Button 2 is not selected')

      ENDIF

END_LOOP

 

    CHANGE     FIELD(#RADIO1 #RADIO2 #RADIO3

                 #RADIO4) TO(*NULL)

 

        CASE       OF_FIELD(#TAXRATE)

        WHEN       VALUE_IS('= 0')

        CHANGE     FIELD(#RADIO1) TO(*RADBUTTONSELECTED)

        WHEN       VALUE_IS('= 10')

        CHANGE     FIELD(#RADIO2) TO(*RADBUTTONSELECTED)

        WHEN       VALUE_IS('= 20')

        CHANGE     FIELD(#RADIO3) TO(*RADBUTTONSELECTED)

        WHEN       VALUE_IS('= 30')

        CHANGE     FIELD(#RADIO4) TO(*RADBUTTONSELECTED)

        ENDCASE