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
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...
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.
But I define my NT console as 90 bytes wide and 40 lines deep :-}
Thanks
Ken Foskey
http://www.zipworld.com.au/~waratah/
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
>
> 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).
>
> 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
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.
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.
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: