Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie: How to clear the Screen?

875 views
Skip to first unread message

Lars Fischer

unread,
Jan 17, 2000, 3:00:00 AM1/17/00
to
Hello *.* !

I have a stupid question:
How can I clear a CRT-console?
I create a little menu and after a selection (accept of a ) the screen
has to be be clear.
I would not use the Scree Section!

Thanks.
Lars

PS. Dont laugh about my English - it's sad

Jerry P

unread,
Jan 17, 2000, 3:00:00 AM1/17/00
to
01 BLANK80 PIC X(80) VALUE SPACE.
01 MYLINE PIC 99.


PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 25
DISPLAY(1:80) MYLINE
END-PERFORM.

Lars Fischer <Lars.F...@wi.stud.tu-ilmenau.de> wrote in message
news:38838CBC...@wi.stud.tu-ilmenau.de...

Jerry P

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to

Ken Foskey <war...@zip.com.au> wrote in message
news:38846526...@zip.com.au...

> Jerry P wrote:
> >
> > 01 BLANK80 PIC X(80) VALUE SPACE.
> > 01 MYLINE PIC 99.
> >
> > PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 25
> > DISPLAY(1:80) MYLINE
> > END-PERFORM.
> >
>
> But I define my NT console as 90 bytes wide and 40 lines deep :-}
>

Try:
01 BLANK90 PIC X(90) VALUE SPACE.
01 MYLINE PIC 99.

PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 40
DISPLAY(1:90) MYLINE
END-PERFORM.

Report results.

Next week we will make the above more robust by providing VARIABLE row
and line capability.

Ken Foskey

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to
Jerry P wrote:
>
> 01 BLANK80 PIC X(80) VALUE SPACE.
> 01 MYLINE PIC 99.
>
> PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 25
> DISPLAY(1:80) MYLINE
> END-PERFORM.
>

But I define my NT console as 90 bytes wide and 40 lines deep :-}

Thanks
Ken Foskey
http://www.zipworld.com.au/~waratah/

Michael Mattias

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to
Jerry P wrote in message <_06h4.55$Zl....@nnrp3.rcsntx.swbell.net>...

>
>Ken Foskey <war...@zip.com.au> wrote in message
>news:38846526...@zip.com.au...
>> Jerry P wrote:
>> >
>> > 01 BLANK80 PIC X(80) VALUE SPACE.
>> > 01 MYLINE PIC 99.
>> >
>> > PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 25
>> > DISPLAY(1:80) MYLINE
>> > END-PERFORM.
>> >
>>
>> But I define my NT console as 90 bytes wide and 40 lines deep :-}
>>
>
>Try:
> 01 BLANK90 PIC X(90) VALUE SPACE.
> 01 MYLINE PIC 99.
>

> PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 40
> DISPLAY(1:90) MYLINE
> END-PERFORM.
>
>Report results.
>
>Next week we will make the above more robust by providing VARIABLE row
>and line capability.
>
>

Um, Jerry, that dog don't hunt..er, code don't work.

Maybe you meant...

PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 40
DISPLAY BLANK90
END-PERFORM.


But wouldn't it be easier to use...

SCREEN SECTION.

01 CLEAR-THE-SCREEN.
05 BLANK SCREEN.
...
DISPLAY CLEAR-THE-SCREEN.

MCM


Jerry P

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to

Michael Mattias <michael...@gte.net

>
> Um, Jerry, that dog don't hunt..er, code don't work.
>
> Maybe you meant...
>
> PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 40
> DISPLAY BLANK90
> END-PERFORM.
>
>

Of course. I was thinking of DISPLAY(MYLINE 1) BLANK90

For me, I like to use a random number generator to create row and
column numbers and blank a single byte at a time. Another trick is to
drop the random byte to the last line of the screen while blanking its
original position. Let the characters stack up in a pile. Make a
'whoop' noise for every one. Another trick is to display a box in the
center of the monitor reading 'Standby, encrypting screen,' as the
screen is blanked character-by-character.
Or do half the screen, display 'Standby, program resting' for a second
or two and continue.

There is no end to the fun one can have with just a simple screen
clear. Strange thing is, we put the following message in our program
update set:

"The installation program has done everything
it can think of to your system and grown bored."

"Press [Enter] to return to the operating system."

Not a single one of our users has commented on the message in two
years.

> But wouldn't it be easier to use...
>
> SCREEN SECTION.
>
> 01 CLEAR-THE-SCREEN.
> 05 BLANK SCREEN.
> ...
> DISPLAY CLEAR-THE-SCREEN.
>
> MCM

Probably not for the original poster (newbie).


RKRayhawk

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Concerning the evolved code for screen clearing

>
> PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 40
> DISPLAY BLANK90
> END-PERFORM.

Is there not one small (admittedly rare) issue here. On 24 line screens, is
the screen not really twenty-five lines, in true CGA emulation? On 4x line
screens, is the screen not really forty-three lines, in true EGA emulation?

(I note one poster indicated NT, but what graphics mode should we presume).

The point is if the compiler run-time is well behaved and goes thru high level
DOS rather than BIOS, looping forever will not clear the last line!

This kind of thing was built into the graphics device to keep PFK annotations
present on the screen even while the command line interface scrolled (or user
displays scrolled). I am fairly confident that it survived into EGA.

I know that the modern VGA and SVGA (and even the Hercules stuff) emulated this
behavior.

So, ... even though it is not especially common, someone could be executing in
an emulation mode and get either text onto the 25th (43rd) line or even
graphics artifacts; scrolling does not clear it.

((Also as an aside, sometimes when folks say that they want to clear a screen,
they may mean that they want to set up a different background color as well:
Unless you do the full job with specific functions, the last line can be left
in a different background color)).

So the easy routines may not solve all problems. You really need a clear screen
function to be sure. Well behaved programs (including well behaved compilers)
did have a DOS interface that could do that, atleast available theoretically;
that does not mean that there was any convenient syntax in the COBOL language
the compiler provided. There was a special code that you sent as text (it was
an ascii control character, perhaps Form Feed, ascii 12). In DOS you might
have needed ANSI.SYS loaded as a device driver from CONFIG.SYS processing.

The PC hardware has 25 lines and 43 lines available in CGA and EGA emulation
modes, so even in non-DOS environments universality may require either a higher
max on the loops, or a special write to line(25) or line(43). (BASICs have line
positioning. Infact there was early weakness in the hardware that allowed a
BASIC program to position on line 25, and write excessive text and get it to
scroll up! That weakness depended upon ROM unfortunately, so behavior could
vary - that was a test of compatibility in some suites).

I am not familiar enough with VGA to know if any of this legacy was spec'ed in.
I vaguely recall that you could do split screens in some VGA 'text' modes, so
scrolling was even more involved, screen clearing was too.

(It might be hard to get into these VGA modes unintentionally in COBOL. But the
EGA and CGA last line behavior is built in).

In all cases it would be better to actually find a function that cleared the
screen, especially if any graphics presentation is interleaved with the text
presentation.

Best Wishes,


Robert Rayhawk
RKRa...@aol.com


SLarsen22

unread,
Jan 29, 2000, 3:00:00 AM1/29/00
to
I don't know what language you are using, but if it is CICS then send the next
screen with "ERASE". That will clear out the information that is not supposed
to appear.
.Pray to God but row the boat for shore....
>http://members.aol.com/SLarsen22>


krgudim

unread,
Feb 4, 2000, 3:00:00 AM2/4/00
to
what about.....

DISPLAY " " AT LINE 1 COL 1 WITH BLANK SCREEN

???
works for me, i am using NetExpress tho, and am not sure if its standard
cobol or not...

-- krgudim, aka: just another cobol newbie.

Foodman

unread,
Feb 4, 2000, 3:00:00 AM2/4/00
to
Hi:

I didn't read the other posts so this may have been said already.

DISPLAY (1, 1) " " ERASE.

This works fine in MF COBOL.

TOny Dilworth

> How can I clear a CRT-console?
> I create a little menu and after a selection (accept of a ) the screen
> has to be be clear.
> I would not use the Scree Section!
>
> Thanks.
> Lars
>
> PS. Dont laugh about my English - it's sad
>

--
what is a signature?


Sent via Deja.com http://www.deja.com/
Before you buy.

Andrea Jerrom

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
How about display space upon crt

krgudim wrote:

> what about.....
>
> DISPLAY " " AT LINE 1 COL 1 WITH BLANK SCREEN
>
> ???
> works for me, i am using NetExpress tho, and am not sure if its standard
> cobol or not...
>
> -- krgudim, aka: just another cobol newbie.
>
> Lars Fischer <Lars.F...@wi.stud.tu-ilmenau.de> wrote in message
> news:38838CBC...@wi.stud.tu-ilmenau.de...
> > Hello *.* !
> >
> > I have a stupid question:

Message has been deleted

Vince Coen

unread,
Dec 15, 2014, 10:34:30 AM12/15/14
to
Hello kbi!

Monday December 15 2014 12:44, you wrote to All:

> IDENTIFICATION DIVISION.
> PROGRAM-ID. HELLO-WORLD.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 MYLINE PIC 9999.
> 01 BLANK90 PIC X(80) VALUE SPACE.
> PROCEDURE DIVISION.
> PERFORM VARYING MYLINE FROM 1 BY 1 UNTIL MYLINE > 40
> DISPLAY BLANK90.
> END-PERFORM..
> DISPLAY '*************************************************'.

..... cut ....


> this program is working fine under COMPILEONLINE-CODING-GROUND


IT is amazing considering you have a period after tge display blank90 and
before the end-perform but there again I would have just done a display
"what ever" at 0101 with erase eos.

But everyone to their own I guess.


Vince


docd...@panix.com

unread,
Dec 15, 2014, 12:34:31 PM12/15/14
to
In article <ad7a8a91-52fa-4083...@googlegroups.com>,
<kbi....@gmail.com> wrote:
>IDENTIFICATION DIVISION.
>PROGRAM-ID. HELLO-WORLD.

[snip]

>STOP RUN.
>
>
>this program is working fine under COMPILEONLINE-CODING-GROUND

What needs changing if 'this program is working fine'?

DD

pjvanz...@gmail.com

unread,
Dec 16, 2014, 2:52:24 AM12/16/14
to
Op maandag 15 december 2014 18:34:31 UTC+1 schreef docd...@panix.com:
I think you ought to be shot for "01 BLANK90 PIC X(80) VALUE SPACE."
This is exactly the thing that turns your co-workers into detectives.

PvZ

Doc Trins O'Grace

unread,
Dec 16, 2014, 2:16:01 PM12/16/14
to
I'm curious... don't most implementations of COBOL have something like...

DISPLAY ERASE TO END OF SCREEN.

(I use OpenVMS COBOL, which has this construct available in it.)

docd...@panix.com

unread,
Dec 17, 2014, 11:27:13 AM12/17/14
to
In article <18c49f44-0176-46b1...@googlegroups.com>,
That's something that might be addressed after 'what needs changing'; my
guess is that six weeks ago the original poster couldn't spell COBOL and
today someone is collecting billing for his doing so.

DD

0 new messages