gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Screen section under htcobol vs. cobc.


From: john Culleton
Subject: [open-cobol-list] Screen section under htcobol vs. cobc.
Date: Wed, 8 Feb 2012 12:15:16 -0500

The program below is taken from the test.prog/test23 subdirectory of the
tiny-cobol 66 files. It compiles and runs under htcobol with no
problems (to be expected.) It compiles and runs via Open Cobol
only with modifications:
1. I put 6 spaces on the left of each line and compiled it as fixed,
which is apparently the original format (note comment line
format).
2. On line 35 an error occurred. When I changed the word " color "
to " background-color " it compiles OK. That is the version I show
below.
3. When the listing below is compiled and run under cobc the screen 
format is jumbled. It is correct when compiled under htcobol.

It is possible that the code is incorrect. It is also possible
that cobc is less advanced in this area than htcobol. The Open
Source Cobol manual is a bit sketchy in this area. 
---------------------------------------

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    test23b.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION. 
       SPECIAL-NAMES.
          DECIMAL-POINT IS COMMA
          crt status is status-field.
      * INPUT-OUTPUT SECTION.
      * FILE-CONTROL.
       DATA DIVISION.
       FILE SECTION.
       WORKING-STORAGE SECTION.
       
       01 campo   pic x(5) value spaces.
       01 line-wor       pic s9(4) comp value 14.
       01 col-wor        pic s9(4) comp value 14.
       01 foreground-wor pic s9(4) comp value 7.
       01 background-wor pic s9(4) comp value 1.
       01 color-wor      pic s9(7) comp value 15.
       01 status-field   pic xxxx value all '0'.
       SCREEN SECTION.
      
        01 screen-scr
                 foreground-color foreground-wor
                 background-color background-wor.
          02 line line-wor. 
           04 col col-wor value "|". 
           04 value "  Test lin/col  ". 
           04 value "|". 
          02 line - 1. 
           04 col col-wor value "+----------------+". 
          02 line + 2. 
           04 col col-wor value "+----------------+". 
        
000035 01   input-scr background-color color-wor.
           02 line 1.
             04 col 1 value "Line :".
             04 col + 1 pic 999 using line-wor.
           02 line + 1.
             04 col 1 value "Col. :".
             04 col + 1 pic 999 using col-wor.
          02 line + 1.
           04 col 1 value "Fore.:".
           04 col + 1 pic 999 using foreground-wor.
          02 line + 1.
           04 col 1 value "Back.:".
           04 col + 1 pic 999 using background-wor.
          02 line + 1.
           04 col 1 value "Color:".
           04 col + 1 pic 999 using color-wor.
          02 line + 2.
           04 col 1 value "Press F3 to exit.".
       PROCEDURE DIVISION.
       INI.
           display screen-scr.
           display input-scr.
           accept input-scr.
           if status-field = "0267"
                 stop run
           end-if.
           go to ini.
           STOP RUN.
-----------------------------------------------      
Linux Slackware 13.32.
-- 
John Culleton
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html

"Create Book Covers with Scribus"
http://www.booklocker.com/books/4055.html


reply via email to

[Prev in Thread] Current Thread [Next in Thread]