0

I am using OpenCobolIDE and just trying to play around with the external terminal to know how to use it for a later project but I am having a bit of trouble with trying to clear the terminal screen.

What I am trying to do is:

  • display anything
  • ask for an input
  • clear the screen
  • display something else
  • and ask for another input

Here is the code I am struggling with:

   WORKING-STORAGE                 SECTION.
   01 WG300-NUMBER                 PICTURE 9.

   PROCEDURE                       DIVISION.
   MAIN-PROCEDURE                  SECTION.
       DISPLAY "GIVE NUMBER".
       ACCEPT WG300-NUMBER.
       DISPLAY " " ERASE SCREEN.
       DISPLAY "ADDED".
       ACCEPT WG300-NUMBER.
       STOP RUN.

The output is

C:\Users\Cyberman\bin
GIVE NUMBER
_

After giving a value then the next screen is

_DDED

This is overwriting what was displayed. I'm just not sure how to fix it. I have tried using

SCREEN                             SECTION.
01 CLEAR-SCREEN.
    02 BLANK SCREEN.

With no luck.

  • Note: OCIDE is unmaintained and that looks like a terminal problem. Does it work if you execute the compiled program from the terminal instead of from OCIDE? If you see a problem then please update the question, possibly removing OCIDE as that would then be unrelated, and add the information about GnuCOBOL's version number (`cobc -V`). – Simon Sobisch Mar 12 '21 at 22:02
  • 1
    I can understand that it probably is a problem with the unmaintained terminal code, but I can not run the compiled exe file, says I am missing (libcob-4.dll). I have no way of adding that file as that requires access that I don't have. Do you know of any other ways I can maybe find a work around because of this terminal problem? Also maybe there is a way to clear the output of the logs section instead of using terminal, I had a look but couldn't find anything. – Matthew West Mar 12 '21 at 22:23
  • I _guess_ you already have a `set_env.cmd` in OCIDE-installation\gnucobol, in this case you should be able to double-click that. If that just closes the version of GnuCOBOL inside OCIDE is also quite old and I suggest an update there, to still go on open `cmd.exe`, then drop the `set_env.cmd` there. After that you can execute GnuCOBOL and its programs in the cmd without a message of missing dlls. – Simon Sobisch Mar 13 '21 at 19:54

0 Answers0