Highlighted
Absent Member.
Absent Member.
1584 views

Eclipse: console displays

I am coding in Eclipse for the first time and running into NEWBIE problems.

I have several DISPLAY lines throughout my code and probably should mention that I have "CONSOLE IS CRT" coded in the "SPECIAL-NAMES."  portion of the "CONFIGURATION SECTION." 

The DISPLAY lines result in a "DOS like" window opening with only the results of the last DISPLAY command and a "Press Enter to Continue..." message.  Pressing Enter results in the "DOS like" window closing. 

Commenting out the last DISPLAY results in only the previous DISPLAY results in the "DOS like" window with the same "Press Enter to Continue..." and the same behavior.

I would like to see the results of all the DISPLAY commands somewhere (perhaps in the "Console" tab?)

I suspect I have an Eclipse issue rather than a COBOL issue, but, of course, am open to all coaching...

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Eclipse: console displays

Specifying CONSOLE IS CRT in SPECIAL-NAMES causes DISPLAY statements to be regarded as Format 3 DISPLAY statements.  Format 3 is full-screen formatting, including possible specification of AT LINE or AT [COLUMN, POSITION], ERASE, COLOR, etc.  

Using this test program:

      program-id. D2.

      environment division.

      configuration section.

      special-names.

      console is crt.

      data division.

      working-storage section.

      procedure division.

      display "hello 1".

      display "hello 2".

      display "hello 3".

The symptoms are as you describe: the Windows output console shows only the last "hello 3", because the previous 2 were overwritten at line 1 column 1.  Each Format 3 DISPLAY statement might contain more than one item to be displayed, but if the first item in each Format 3 DISPLAY has no AT phrase, it begins at line 1, column 1.

The following program:

      program-id. D1.

      environment division.

      configuration section.

      special-names.

      console is crt.

      data division.

      working-storage section.

      procedure division.

      display "hello 1" at 0101 with erase screen.

      display "hello 2" at 0201.

      display "hello 3" at 0301.

Shows a console such as this:

hello 1

hello 2

hello 3Press any key to continue . . .

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Eclipse: console displays

If, for purposes of debugging, you are inserting DISPLAY statements without AT clauses into a program that relies on CONSOLE IS CRT, that is, a program that was developed to use full-screen DISPLAYs, consider instead using the Eclipse debugger to debug such programs.  For programs that do not actually contain any true Format 3 DISPLAYs, consider removing the CONSOLE IS CRT clause.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.