Menu

GnuCOBOL 3.2-rc2.0 DISPLAY question

2023-04-25
2023-05-02
  • Scott Johnson

    Scott Johnson - 2023-04-25
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; font-size:11.0pt; font-family:"Calibri",sans-serif;} .MsoChpDefault {mso-style-type:export-only;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style>

    <o:p> </o:p>

    <o:p> </o:p>

    I’m sure I’m missing something vital, but after spending a day researching it, I can’t seem to find the answer (or solution).<o:p></o:p>

    <o:p> </o:p>

    While working on a larger project, as a debugging tool, I used several DISPLAY statements as I cycled through reading the contents of an indexed file.<o:p></o:p>

    Rather than show each item on it’s own line, DISPLAY is acting as if NO ADVANCING is in place; although I’ve never used that clause.  This has happened <o:p></o:p>

    In other areas as well, a display with no line/column positioning often places the output at line 1, column 1.  Subsequent DISPLAYs overwrite that output at the same column 1, position 1.<o:p></o:p>

    <o:p> </o:p>

    Am I not setting a compiler switch or some other simple setting that I’m missing somewhere?<o:p></o:p>

    <o:p> </o:p>

    Thanks in advance<o:p></o:p>

    <o:p> </o:p>

    --scott<o:p></o:p>

    <o:p> </o:p>

     
  • Chuck Haatvedt

    Chuck Haatvedt - 2023-04-25

    do any of your display statements include extended display statements with line and column ?

    i would check the manual and see if it mentions mixing extended and non extended display statements in a program.

     
  • Scott Johnson

    Scott Johnson - 2023-04-25

    Yes, there are mixed extended and traditional DISPLAY statements in use. On the other hand, the other COBOL compiler I use (VSI Cobol under VMS) and HP/Compaq COBOL on a VAX behave predictably with the same code.

    For example:

    IDENTIFICATION DIVISION.
    PROGRAM-ID. TESTCOB.
    DATA DIVISION.
    FILE SECTION.
    WORKING-STORAGE SECTION.
    PROCEDURE DIVISION.
    MAIN-PROCEDURE.
        DISPLAY " " AT LINE 1 COLUMN 1 ERASE TO END OF SCREEN.
        DISPLAY "Hello world.".
        DISPLAY "POSITIONED WITH AT" AT LINE 10 COLUMN 10.
        DISPLAY "NOW JUST DISPLAY."
        STOP RUN.
    END PROGRAM TESTCOB.
    [End of file]
    

    That code compiled under VSI Cobol produces the attached screenshot. (VSI-COBOL.PNG)

    Under GNU-Cobol it produces the other screenshot.

    I was just hoping there was a simple way to achieve the same output as I'm trying to port code from the Alpha/VMS environment to windows using GNUCobol.

    Thanks again.
    -scott

     
  • Chuck Haatvedt

    Chuck Haatvedt - 2023-04-26

    Scott,

    Simon would be the better person to respond to questions about the support for the VSI COBOL compiler dialect (OpenVMS) in GNUCOBOL.

    I did find this website that talks about converting VSI COBOL to MicroFocus COBOL. I suspect that the resulting MF COBOL source code could be compiled by GNUCOBOL. I am not sure if any manual changes would be required...

    it appears that for GNUCOBOL if any DISPLAY statements contain an "AT" phrase then all of the DISPLAY statements write to the implied console. When DISPLAY statements do not contain an AT phrase in a mixed DISPLAY context, then it appears that it defaults to using a default screen location of line 1 column 1.

    https://sector7.com/s7/Vxtools/3gl/vxcobol.html

    Chuck Haatvedt

     
    • Scott Johnson

      Scott Johnson - 2023-04-26

      Very well. Thank you for your time. I wish you all the best.

      On Tue, Apr 25, 2023, 8:05 PM Chuck H. chaat@users.sourceforge.net wrote:

      Scott,

      Simon would be the better person to respond to questions about the support
      for the VSI COBOL compiler dialect (OpenVMS) in GNUCOBOL.

      I did find this website that talks about converting VSI COBOL to
      MicroFocus COBOL. I suspect that the resulting MF COBOL source code could
      be compiled by GNUCOBOL. I am not sure if any manual changes would be
      required...

      it appears that for GNUCOBOL if any DISPLAY statements contain an "AT"
      phrase then all of the DISPLAY statements write to the implied console.
      When DISPLAY statements do not contain an AT phrase in a mixed DISPLAY
      context, then it appears that it defaults to using a default screen
      location of line 1 column 1.

      https://sector7.com/s7/Vxtools/3gl/vxcobol.html

      Chuck Haatvedt

      GnuCOBOL 3.2-rc2.0 DISPLAY question
      https://sourceforge.net/p/gnucobol/discussion/help/thread/6b63df1c27/?limit=25#bad4


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnucobol/discussion/help/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Scott Johnson

    Scott Johnson - 2023-04-26

    I just compiled that same code under Visual COBOL (Microfocus). As you can see by the output, I got the same results as VSI et al.

    So I have some sort of base to start on, what standard is GnuCOBOL DISPLAY handling based on? It's probably I may have to become familiar with another dialect.

    -scott

     
  • Ralph Linkletter

    Chuck correct me if I am wrong.
    Upon encountering a DISPLAY with an @ parameter, curses / pdcurses becomes the basis of any further display.
    The curses interface will default to line 1, column 1 if no explicit line or column is provided.

    I think that this is the behavior that Scott is observing.

     
  • Chuck Haatvedt

    Chuck Haatvedt - 2023-05-02

    Scott,

    try with the following compiler option as per Simon...

    -fline-col-zero-default
    assume a field DISPLAY starts at LINE 0 COL 0 (i.e. at the
    cursor), not LINE 1 COL 1

     

Anonymous
Anonymous

Add attachments
Cancel