Check Boxes

A check box is a choice with associated text that requires a true/false, yes/no, on/off answer.

        BEGIN_LOOP

          REQUEST    FIELDS(#SCREEN)

          IF         COND('#CBOX01 *EQ *CHECKBOXSELECTED')

            MESSAGE  MSGTXT('Check box 1 is selected')

          ENDIF

          IF         COND('#CBOX02 *NE *CHECKBOXSELECTED')

            MESSAGE  MSGTXT('Check box 2 is not selected')

          ENDIF

        END_LOOP

 

the correct way to initialize check boxes:

 

     CHANGE     FIELD(#CHECKBOX1 #CHECKBOX2 #CHECKBOX3

                      #CHECKBOX4) TO(*NULL)

 

     IF        COND('#ACTIVE *EQ ''Y''')

       CHANGE  FIELD(#CHECKBOX2) TO(*CHECKBOXSELECTED)

     ENDIF

 

    CHANGE     FIELD(#CHECKBOX4) TO(*CHECKBOXSELECTED)