GUI ScreenIO for Windows

 ScreenIO.com


How to Use Checkbox Controls in Your Program

The field definition of a checkbox consists of a simple PIC 9 area, and an 88-level for its two possible values: ON or OFF:

 01 panel-4.
      .    
      .
     05   MY-CHECKBOX-A PIC 9   VALUE 0.
       88 MY-CHECKBOX-A-ON      VALUE 1.
       88 MY-CHECKBOX-A-OFF     VALUE 0.

It's very simple to set the state of a checkbox using the 88-level values:

To set the state of a checkbox, to ON (checked):

     SET MY-CHECKBOX-A-ON TO TRUE.

To set the state of a checkbox, to OFF (not checked):

     SET MY-CHECKBOX-A-OFF TO TRUE.

The next time you call GUI ScreenIO to display your panel, the checkbox will show the value that you set in your program.  

When control returns from GUI ScreenIO, you test the state of the checkbox using the 88-level items, like this:

     EVALUATE TRUE

       WHEN MY-CHECKBOX-A-OFF
         PERFORM MY-CHECKBOX-OFF-ROUTINE

       WHEN MY-CHECKBOX-A-ON
         PERFORM MY-CHECKBOX-ON-ROUTINE

     END-EVALUATE

Or, if you prefer using IF statements:

     IF MY-CHECKBOX-A-OFF
       PERFORM MY-CHECKBOX-OFF-ROUTINE
     ELSE
       IF MY-CHECKBOX-A-ON
         PERFORM MY-CHECKBOX-ON-ROUTINE
       END-IF
     END-IF

Related topics:


2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom