HOME  NEWS  FORUM  DOWNLOAD  LINK
OpenCOBOL - an open-source COBOL compiler
Main Menu
Download
Documentation
Development
Who's Online
18 user(s) are online (3 user(s) are browsing Forum)

Members: 0
Guests: 18

more...
Powered by
SourceForge

Xoops

Creative Commons

OpenCOBOL Forum Index
   OpenCOBOL
     Screen section, don't work as it should
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
giacomo
Posted on: 2010/9/8 11:24
Just popping in
Joined: 2010/9/7
From: Verona
Posts: 2
Screen section, don't work as it should
Hello everyone, I'm new. I have a problem with the screen section. I compile this file without problems. When I run, I see a blue background, white text (or gray), but when I write data on the first line and go to the second, the text of the first line disappears. Also does not display the field labels. This is a file that I found on the book by Hubbell Tane "COBOL in 24 hours." On Windows works fine. I have version 1.1 of the OC. What is the problem? Thanks
000020 Identification Division.
000030 Program-Id.  Chapt04c.
000031* Data Entry Screen 
000040 Environment Division.
000050 Configuration Section.
000051 Special-Names.
000052       Crt Status Is Keyboard-Status
000053       Cursor Is Cursor-Position.
000054 Source-Computer.  IBM-PC.
000055 Object-Computer.  IBM-PC.
000056 Data Division.
000057 Working-Storage Section.
000058 01  Keyboard-Status.
000059     03  Accept-Status Pic 9.
000060     03  Function-Key  Pic X.
000061     03  System-Use    Pic X.
000063     03  Bobo          Pic X.
000065 01  Cursor-Position.
000067     03  Cursor-Row    Pic 9(2) Value 1.
000069     03  Cursor-Column Pic 9(2) Value 1.
000071 01  Screen-Items.
000080     03  Last-Name           Pic X(25)   Value Spaces.
000090     03  First-Name          Pic X(15)   Value Spaces.
000097     03  Middle-Name         Pic X(10)   Value Spaces.
000105     03  Address-Line-1      Pic X(50)   Value Spaces.
000115     03  Address-Line-2      Pic X(50)   Value Spaces.
000140     03  City                Pic X(40)   Value Spaces.
000150     03  State-Or-Country    Pic X(20)   Value Spaces.
000160     03  Postal-Code         Pic X(15)   Value Spaces.
000170     03  Home-Phone          Pic X(20)   Value Spaces.
000180     03  Work-Phone          Pic X(20)   Value Spaces.
000190     03  Other-Phone         Pic X(20)   Value Spaces.
000200     03  Start-Date          Pic 9(8)    Value Zeros.
000210     03  Last-Rent-Paid      Pic 9(8)    Value Zeros.
000220     03  Next-Rent-Due-Date  Pic 9(8)    Value Zeros.
000230     03  Rent-Amount         Pic 9(4)v99 Value 50.00.
000240     03  Consignment-Percent Pic 9(3)    Value 40.
000254 Screen Section.
000255 01  Data-Entry-Screen
000256     Blank Screen, Auto
000257     Foreground-Color Is 7,
000258     Background-Color Is 1.
000259     03  Line 01 Column 30 Value "Darlene's Treasures"
000260         Highlight Foreground-Color 4 Background-Color 1.
000261     03  Line 03 Column 30 Value "Tenant Entry Program"
000262         Highlight.
000263*
000264     03  Line 5 Column 01  Value "Name, Last: ".
000265     03  Line 5 Column 13  Pic X(25) Using Last-Name
000266         Reverse-Video Required.
000268     03  Line 5 Column 39  Value "First: ".
000269     03  Line 5 Column 46  Pic X(15) Using First-Name
000270         Reverse-Video Required.
000272     03  Line 5 Column 62  Value "Middle: ".
000273     03  Line 5 Column 70  Pic X(10) Using Middle-Name
000274         Reverse-Video.
000275*
000276     03  Line 6 Column 01 Value "Address 1: ".
000277     03  Line 6 Column 15 Pic X(50) Using Address-Line-1
000278         Reverse-Video.
000279*
000280     03  Line 7 Column 01 Value "Address 2: ".
000281     03  Line 7 Column 15 Pic X(50) Using Address-Line-2
000282         Reverse-Video.
000283*
000284     03  Line 8 Column 01 Value "City: ".
000285     03  Line 8 Column 15 Pic X(40) Using City
000286         Reverse-Video.
000287*
000288     03  Line 9 Column 01 Value "Country/State: ".
000289     03  Line 9 Column 15 Pic X(20) Using State-Or-Country
000290         Reverse-Video.
000291     03  Line 9 Column 36 Value "Postal Code: ".
000292     03  Line 9 Column 50 Pic X(15) Using Postal-Code
000293         Reverse-Video.
000294*
000295     03  Line 11 Column 01 Value "Phone/Home: ".
000296     03  Line 11 Column 13 Pic X(20) Using Home-Phone
000297         Reverse-Video.
000298     03  Line 11 Column 34 Value "Work: ".
000299     03  Line 11 Column 41 Pic X(20) Using Work-Phone
000300         Reverse-Video.
000301*
000302     03  Line 12 Column 06 Value "Other: ".
000303     03  Line 12 Column 13 Pic X(20) Using Other-Phone
000304         Reverse-Video.
000305*
000306     03  Line 14 Column 01 Value "Start Date: ".
000307     03  Line 14 Column 13 Pic 99/99/9999 Using Start-Date
000308         Reverse-Video.
000309     03  Line 14 Column 24 Value "Last Paid Date: ".
000310     03  Line 14 Column 40 Pic 99/99/9999 Using Last-Rent-Paid
000311         Reverse-Video.
000312     03  Line 14 Column 50 Value "Next Rent Due on: ".
000313     03  Line 14 Column 68 Pic 99/99/9999 Using Next-Rent-Due-Date
000314         Reverse-Video.
000315     03  Line 15 Column 01 Value "Rent Amount: ".
000316     03  Line 15 Column 14 Pic Z,ZZZ.99 Using Rent-Amount
000317         Reverse-Video.
000318     03  Line 16 Column 01 Value "Consignment Percent: ".
000319     03  Line 16 Column 22 Pic ZZ9 Using Consignment-Percent
000320         Reverse-Video.
000322 Procedure Division.
000323 Chapt04c-Start.
000324     Display Data-Entry-Screen.
000325     Accept Data-Entry-Screen.
000326     Stop Run.
human
Posted on: 2010/9/8 15:12
Home away from home
Joined: 2007/5/15
From: GERMANY
Posts: 1416
Re: Screen section, don't work as it should
Please give us the exact version of cobc you're using (cobc --version) and tell us what system you use (Unix/MinGW/Cygwin/...)

At least for many Windows-builds colours are broken and fixed for the next pre-release.

I'll check the program with next version this week, maybe tomorow.

human
CutlerGL
Posted on: 2010/9/9 2:31
Just can't stay away
Joined: 2009/6/17
From: Schenectady, NY
Posts: 74
Re: Screen section, don't work as it should
Colors work well in the MinGW build available through the "Wiki" / "Assorted Documents" link to the left.
chaat
Posted on: 2010/9/9 6:16
Just popping in
Joined: 2010/2/12
From: St.Cloud, MN USA
Posts: 7
Re: Screen section, don't work as it should
Gary,

would it be possible for you to get a copy of the most current source (the next pre-release that human spoke of) ?

If so perhaps you could rebuild your MinGW installation zip file and I could do some more testing to see if some of the runtime errors that I found would be fixed.

It will be nice once we can get the latest / greatest source code available for building the binaries which are to be located on the new server which aoirthoir is working on getting setup.

I'm not sure if we have a repository where we can upload files. Or perhaps I could use the same file sharing site where you've loaded the MinGW files.

Thanks



----------------

Chuck Haatvedt

Mainframe Programmer

human
Posted on: 2010/9/9 8:46
Home away from home
Joined: 2007/5/15
From: GERMANY
Posts: 1416
Re: Screen section, don't work as it should
In this program there are some extensions (stuff that isn't part of any standard.
The problem for the invisible labels roots in the BLANK SCREEN attribute which is not only used for DISPLAY, but for ACCEPT, too [this is a bug in current OC versions because X/Open says it should be ignored here - fix will be submitted to Roger]. Another problem is that the BLANK SCREEN attribute seems to be passed to every sub-item [I will tell Roger about that parser-problem and hope he fixes].

You can work around these problems by removing the BLANK SCREEN attribute there and insert
           display space 
           with Blank Screen, 
           Background-Color Is 1
           end-display
before your original DISPLAY.

A quite different problem that's not so easy solved is the use of numeric edited entries in screen section. DISPLAY works fine, but there are no routines handling the ACCEPT.
I suggest to not ACCEPT them.

If somebody is willing to submit a patch it's likely Roger integrates it.

human
giacomo
Posted on: 2010/9/9 11:42
Just popping in
Joined: 2010/9/7
From: Verona
Posts: 2
Re: Screen section, don't work as it should
Thank you very much for the answers. I removed "Blank Screen" and now I see the screen should look like. The version of my cobc is:
COBC (OpenCOBOL) 1.1.0
Copyright (C) 2001-2009 Keisuke Nishida / Roger While
Built         Sep 06 2010 20:15:52
Packaged      Feb 06 2009 10:30:55 CET


I am a beginner with COBOL and not even see what I want it to appear on the screen is very unrewarding. Thanks again for your help!
giorgik
Posted on: 2010/9/28 12:21
Not too shy to talk
Joined: 2010/9/28
From:
Posts: 36
Re: Screen section, don't work as it should
Ciao Giacomo,
sai dirmi come includere anche i colori alla tua maschera che hai postato ?
erstazi
Posted on: 2010/10/6 15:10
Just popping in
Joined: 2009/5/20
From: Erie, Pennsylvania
Posts: 15
Re: Screen section, don't work as it should
@giacomo, For classes that the396 and aoirthoir will be teaching, I am wondering what book that you got this information from.

Do you mind if you share what book or learning instruction this is?


----------------
Thank you for your time,
erstazi

COBOL Chat: irc.mibbit.com #add1.to
Access from the web: http://bit.ly/add1toChat

reinhardPR
Posted on: 2012/8/6 18:33
Just popping in
Joined: 2011/3/24
From:
Posts: 3
Re: Screen section, don't work as it should

If you change the first lines of your Screen Section to the following definitions, it works fine with OpenCobol 1.1
You dont need to define the constants -just for better readability.




78 black value 0.
78 blue value 1.
78 green value 2.
78 cyan value 3.
78 red value 4.
78 magenta value 5.
78 yellow value 6.
78 white value 7.

*> use a label for defining the blank-screen settings

Screen Section.
01 Data-Entry-Screen.
03 settings blank screen background-color blue.
*> ... the rest needs not to be changed
Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 
Copyright (C) 2005 The OpenCOBOL Project. All rights reserved.
Powered by Xoops2 | PHP | MySQL | Apache
ocean-net