gnucobol-users
[Top][All Lists]
Advanced

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

[open-cobol-list] OpenCOBOL and cygwin running on Windows Vista.


From: Larry Cullen
Subject: [open-cobol-list] OpenCOBOL and cygwin running on Windows Vista.
Date: Sun, 13 Jul 2008 10:25:35 -0500
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

I was pleasantly surprised when I was able to install Cygwin on my laptop (running MS Windows Vista) and then build and run OpenCOBOL version 1.1 on top of that. I did have to download a number of additional modules in order to get everything that I needed to make a fully functional OpenCOBOL. The bare bones Cygwin install won't support the OpenCOBOL build process by itself. So, you need to include "gcc", "ncurses", "libiconv", "gmp", "oracledb" and of course your favorite editor.

The installation of Cygwin needs to be done as the administrator. That is done by right clicking on the "setup.exe" file in your download directory and then clicking on "run as administrator" in the resulting pop-up menu.

I had time to compile the "Hello World!" program and a couple of programs that I had written last week when I first starting playing with OpenCOBOL on a Pentium 4 box loaded with SuSe Linux Version 10.3.

One thing that I noticed, since I've been playing with the screen handling stuff, the "DISPLAY" verb seems to have some strange behavior when used under the Cygwin console versus when used with the Linux console. The attached COBOL source will serve as an example.

If you look at the source file you'll see lines numbered 44, 45 and 51. The idea is to compile with lines 44, 45 commented out and 51 not commented out, or the other way, with lines 44, 45 not commented out and line 51 commented out. Either way when the program is run the behavior should be the same.

When I compile and run this program, with the source code commented either way, from the "Konsole" terminal on my Linux box the program's DISPLAYs are identical. When I do the same with Cygwin things aren't the same. On Cygwin when line 51 is commented out the DISPLAY behavior is identical to the results on the Linux box, which is fine. When lines 44,45 are commented out the first line DISPLAYed on the Cygwin terminal is not where it is supposed to be ???


I don't think this is an OpenCOBOL problem... Anyone got any ideas?


       identification division.
       program-id. CH6EX02.
       author. stern stern and ley.
      *        From their book "COBOL for the 21st Century"

       installation. cygwin on windows vista.
       date-written. 12 july 2008.
       date-compiled. 12 july 2008.

       environment division.
       configuration section.
       source-computer. pentium4.
       object-computer. pentium4.

      ******************************************************************
      * Program to see if a person is "old enough". In this example,   *
      * that is 21 years old. It uses extended ACCEPT and DISPLAY      *
      * statements.                                                    *
      ******************************************************************
       data division.
       working-storage section.
       01 dob-in         pic x(10).

       01 dob-ws.
          05 yr-ws       pic 9(4).
          05 mo-ws       pic 99.
          05 day-ws      pic 99.

       01 today.
          05 today-yr    pic 9(4).
          05 today-mo    pic 99.
          05 today-day   pic 99.

       01 cutoff-date.
          05 cutoff-yr   pic 9(4).
          05 cutoff-mo   pic 99.
          05 cutoff-day  pic 99.

       01 cutoff-dob     pic 9(8).

       procedure division.
       100-main.

00044      display "" at line 1 column 1 with background-color 7 
00045          blank screen foreground-color 1

           display "Enter date of birth (mm/dd/yyyy):"
               at line 13 column 1
               with foreground-color 1
                    background-color 7
00051 *              blank screen

           accept dob-in
               at line 13 col 35
               with reverse-video

           perform 200-process-dob

           perform 300-check-age

           accept dob-in line 20 col number 35

           stop run.

       200-process-dob.
           unstring dob-in delimited by "/" or "-"
               into mo-ws day-ws yr-ws.

       300-check-age.
           move function current-date to today
           subtract 21 from today-yr giving cutoff-yr
           move today-mo to cutoff-mo
           move today-day to CUTOFF-DAY
           Move CUTOFF-DATE to cutoff-dob
           if DOB-WS <= Cutoff-DOB
               display "Person is at least 21 years old."
                   at LINE number 16 COL 35
           else
               display "Person is under 21 years old."
                   at line 16 COLUMN number 35
                   with background-color 7 
      *                  bell
      *                  blink
                        foreground-color 4
      *                  highlight
      *                  reverse-video
      *                  underline
            end-if.

reply via email to

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