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>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
IDENTIFICATIONDIVISION.PROGRAM-ID.TESTCOB.DATADIVISION.FILESECTION.WORKING-STORAGESECTION.PROCEDUREDIVISION.MAIN-PROCEDURE.DISPLAY" "ATLINE1COLUMN1ERASETOENDOFSCREEN.DISPLAY"Hello world.".DISPLAY"POSITIONED WITH AT"ATLINE10COLUMN10.DISPLAY"NOW JUST DISPLAY."STOPRUN.ENDPROGRAMTESTCOB.[Endoffile]
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.
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.
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.
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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<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>
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.
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:
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
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
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:
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
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.
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