GUI ScreenIO for Windows

 ScreenIO.com


A Generated Program

This image shows the result of compiling and running a program created by the GUI ScreenIO program generator.  It was compiled and executed just as it was generated.  No changes were made to the generated program.

Notice that it has a menu, edit controls, a pushbutton, and a status bar.  You can tab from field to field, enter data, and exercise the menu.  Everything works; after all, this is running under control of a real program.

The generated program comments out statements that you'll need to modify to suit your application, but it includes the shell of all of the necessary logic to make it easier for you. 

For example, the panel display loop, the event handling, and the logic needed to load and unload data from the fields is all there; it's just commented out. 

Modifying the program

Lines that need to be modified contain the string    FIX-->*-->    in columns 1-10, and are usually commented out with an asterisk (*) character in column 7.  For example, here are two lines that you'll probably want to modify.

FIX-->*--> MOVE ????? TO KEY-MINIMUM.
FIX-->           CONTINUE

The complete generated program is shown below.  In particular, note the hard-coded COPY statement that specifies the MAIN panel.  You may want to modify the template to include your own standard MAIN panel.

All you need to do to finish this program is to modify several MOVE statements to load your data, and to add your processing logic beneath the appropriate events, in place of the default CONTINUE statements.

As you can see, much of the work has been done for you.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. 'DEMO001'.
       DATE-COMPILED.
      *     This shell program was generated by the GS2000 program
      *     generator utility for use with GUI ScreenIO.
      *     For.........: Norcom
      *     By..........: Donald Duck
      *     Date Started:
      *
FIX-->*-->  Description.: (description of this program goes here)
FIX-->*-->              :
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER. IBM-PC.
       OBJECT-COMPUTER. IBM-PC.
      *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  V--VERSION-LEVEL PIC 9(3) VALUE 1.
       01  PROGRAM-NAME              PIC X(8) VALUE 'DEMO001'.
      *
      * ------------------------: Copybooks for GUI ScreenIO panels.
      *
           COPY "C:\Program Files\GUI ScreenIO\template\TESTMAIN.COB".
           COPY DEMO-01.
      *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       PROCEDURE DIVISION.
       0100-MAIN-LINE-LOGIC SECTION.
      * -====-
       0101-INITIALIZATION.
      * ------------------------: Initialize; create the main window.
      *
           PERFORM DISPLAY-MAIN.
      *
      * ------------------------: PERFORM paragraph to handle the panel.
      *
           PERFORM DISPLAY-DEMO-01.
      *
      * ------------------------: Finished; close the main window.
      *
           SET TESTMAIN-DO-CLOSE TO TRUE.
           PERFORM DISPLAY-MAIN.
           STOP RUN.

      *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       0200-DISPLAY-PANELS SECTION.
      * -====-
       DISPLAY-MAIN.
      *                         :---------------------------------------
      * ------------------------: Display main panel to open/close
      *                         : the main window.
      *                         :---------------------------------------
      *
           CALL 'GS' USING TESTMAIN-1
                           TESTMAIN-2
                           TESTMAIN-3
                           TESTMAIN-4.
      * -====-
       DISPLAY-DEMO-01.
      *                         :---------------------------------------
      * ------------------------: Loop to display panel DEMO-01 and
      *                         : handle events until the end-of-loop
      *                         : condition is encountered.
      *                         :---------------------------------------
      *
           PERFORM WITH TEST AFTER
                 UNTIL DEMO-01-EVENT-CLOSE-WINDOW
                    OR DEMO-01-EVENT-CLOSE-AND-STOP
FIX-->*-->          OR other-termination-condition (if you have any)
      *
      * ------------------------: Perform a paragraph to move your data
      *                         : to the panel so it will be displayed.
      *                         :
      *                         : In reality, you will most likely NOT
      *                         : do it this way, but will only move
      *                         : data when appropriate.  Present only
      *                         : for completeness.
      *
FIX-->       PERFORM MOVE-DATA-TO-DEMO-01
      *
FIX-->*--> Protect/unprotect/change colors, etc. here before
FIX-->*--> the panel is displayed (using the -O attribute).
FIX-->*-->
FIX-->*-->   IF some-external-condition
FIX-->*-->     MOVE 'P' TO fieldname-O
FIX-->*-->   ELSE
FIX-->*-->     MOVE LOW-VALUE TO fieldname-O
FIX-->*-->   END-IF
      *
      * ------------------------: Call GUI ScreenIO to display DEMO-01
      *
      *      Key-to-Percentage Calculator
      *
             CALL 'GS' USING DEMO-01-1
                             DEMO-01-2
                             DEMO-01-3
                             DEMO-01-4
      *
      * ------------------------: Perform a paragraph to move panel
      *                         : data to your fields.
      *                         :
      *                         : In reality, you will most likely NOT
      *                         : do it this way, but will only move
      *                         : data when appropriate.  Present only
      *                         : for completeness.
      *
FIX-->       PERFORM MOVE-DATA-FROM-DEMO-01
      *
      *                         : Examine why GUI ScreenIO returned
      *                         : to your program using the EVALUATE
      *                         : verb and the 88-level event names.
      *
             EVALUATE TRUE
      *
      * ------------------------: Menu/Button event: Compute
      *
               WHEN DEMO-01-TEST
FIX-->           CONTINUE
      *
      * ------------------------: Menu/Button event: &Exit
      *
               WHEN DEMO-01-EXIT
FIX-->           CONTINUE
      *
      * ------------------------: DEMO-01-EVENT-CLOSE-AND-STOP is a
      *                         : request to close the application,
      *                         : returned when the user:
      *                         :
      *                         : - Clicks the "X" box on the MAIN panel
      *                         :
      *                         : - Selects Close from the window system
      *                         :   menu (by clicking the small icon at
      *                         :   the left edge of the MAIN title bar)
      *                         :
      *                         : - Presses Alt+F4
      *
               WHEN DEMO-01-EVENT-CLOSE-AND-STOP
FIX-->           CONTINUE
      *
      * ------------------------: All other events will be ignored by
      *                         : this WHEN OTHER clause.
      *
               WHEN OTHER
FIX-->           CONTINUE

             END-EVALUATE
           END-PERFORM.
      * -====-
       MOVE-DATA-TO-DEMO-01.
      *                         :---------------------------------------
      * ------------------------: Moves data to be displayed from user
      *                         : fields to controls on DEMO-01.
      *                         :
      *                         : This code is intended to show you how
      *                         : to program for each type of control;
      *                         : you will most likely move the code
      *                         : to a more appropriate location for
      *                         : your own application.
      *                         :---------------------------------------
      *
      *                         : Move data to panel fields before the
      *                         : panel is first displayed.
FIX-->*--> Insert a source field in place of the ?????? to move
FIX-->*--> your data to the panel fields.
FIX-->*--> MOVE ????? TO KEY-MINIMUM.
FIX-->*--> MOVE ????? TO KEY-MAXIMUM.
FIX-->*--> MOVE ????? TO KEY-TEST.
FIX-->*--> MOVE ????? TO KEY-PERCENT.
      * -====-
       MOVE-DATA-FROM-DEMO-01.
      *                         :---------------------------------------
      * ------------------------: Moves data from controls on panel
      *                         : DEMO-01 to user fields.
      *                         :
      *                         : This code is intended to show you how
      *                         : to program for each type of control;
      *                         : you will most likely move the code
      *                         : to a more appropriate location for
      *                         : your own application.
      *                         :---------------------------------------
      *
      *                         : Move the data from the panel fields
      *                         : to your data fields.
FIX-->*--> Insert a target field in place of the ?????? to move
FIX-->*--> the panel fields to your fields.
FIX-->*--> MOVE KEY-MINIMUM TO ?????.
FIX-->*--> MOVE KEY-MAXIMUM TO ?????.
FIX-->*--> MOVE KEY-TEST TO ?????.
FIX-->*--> MOVE KEY-PERCENT TO ?????.

You can revise the template to produce code that conforms to your own coding style.  See Generator Templates.


2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom