Board index » delphi » Clear screen in TP 5.5

Clear screen in TP 5.5

I was wondering if I could get some info on a simple procedure to clear the
previous screen so I can include it at the beginning of my procedures in a
simple program...
 any help would be great
Thank you.
 

Re:Clear screen in TP 5.5


Quote
Brad Ives wrote:

> I was wondering if I could get some info on a simple procedure to clear the
> previous screen so I can include it at the beginning of my procedures in a
> simple program...
>  any help would be great
> Thank you.

uses Crt;
begin
  ClrScr;
end.

Re:Clear screen in TP 5.5


i have had some trouble geting that to work so what i do is this

{--------------------------------------------------}
procedure ClearScreen;

var
Counter :Integer;

begin
    for Counter := 1 to 25 do
        WriteLn;
end;
{-------------------------------------------------}

{main}

ClearScreen;

Justin Behr (Mavric)
be...@tznet.com

Quote
Wolf Behrenhoff <wolf.behrenh...@gmx.net> wrote in message

news:3908273E.4005BEC6@gmx.net...
Quote
> Brad Ives wrote:

> > I was wondering if I could get some info on a simple procedure to clear
the
> > previous screen so I can include it at the beginning of my procedures in
a
> > simple program...
> >  any help would be great
> > Thank you.

> uses Crt;
> begin
>   ClrScr;
> end.

Re:Clear screen in TP 5.5


Quote
On Thu, 27 Apr 2000 18:17:09 -0500, "Mavric" <be...@tznet.com> wrote:
>i have had some trouble geting that to work so what i do is this

What kind of trouble. CRT is one of the standard units of TP since
v4.0. Can zou be a bit more specific ? Your "workaround" code btw. is
only working in a 25 row screen mode and doesn't take windows into
consideration.
Quote

Re:Clear screen in TP 5.5


I tryed that at school and it didnt work ( i got it streight out of the TP 7
book)   but at home it does and both times i was using TP 7.  At school it
says unknow comand or somthing like that

Ralf A. Quint <ralf_qu...@hotmail.com> wrote in message
news:1puhgs8anno7rjehpnq0ru5j42pvr4js28@4ax.com...

Quote
> On Thu, 27 Apr 2000 18:17:09 -0500, "Mavric" <be...@tznet.com> wrote:

> >i have had some trouble geting that to work so what i do is this

> What kind of trouble. CRT is one of the standard units of TP since
> v4.0. Can zou be a bit more specific ? Your "workaround" code btw. is
> only working in a 25 row screen mode and doesn't take windows into
> consideration.

Re:Clear screen in TP 5.5


Ralf A. Quint <ralf_qu...@hotmail.com> wrote:

Quote
> On Thu, 27 Apr 2000 18:17:09 -0500, "Mavric" <be...@tznet.com> wrote:
>>i have had some trouble geting that to work so what i do is this

> What kind of trouble. CRT is one of the standard units of TP since

RTE 200, I'd guess.

--
______________________________________________________________________
     The Scarlet Manuka,      |        Nitpickers' Party motto:
  Pratchett Quoter At Large,  |  "He who guards his lips guards his
 First Prophet of Bonni, is:  |  soul, but he who speaks rashly will
   sa...@maths.uwa.edu.au     |    come to ruin." -- Proverbs 13:3
______________________________|_______________________________________

Re:Clear screen in TP 5.5


Hi,

Quote
Ralf A. Quint wrote:
> Your "workaround" code btw. is
> only working in a 25 row screen mode and doesn't take windows into
> consideration.

I don't want to be a nitpicker, but even then the behaviour is not
identical, as ClrScr carries you to line 1, column 1.

 - Sebastian

Re:Clear screen in TP 5.5


JRS:  In article <qY3O4.1229$F.32...@news4.giganews.com> of Thu, 27 Apr
2000 18:17:09 seen in news:comp.lang.pascal.borland, Mavric

Quote
<be...@tznet.com> wrote:

<to clear screen>

Quote
>begin
>    for Counter := 1 to 25 do
>        WriteLn;

Unless you can make sure that the screen is in a 25-line mode, NO! - use
a larger number.

On this machine, I run DOS programs in an 80*50 DOS box;  most DOS
programs (including TP7/BP7 themselves), but not all, adapt to that
correctly.  The largest I recall seeing is 132*60; but the process will
be so fast that you might as well be generous.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.

Re:Clear screen in TP 5.5


On 28 Apr 2000 06:15:34 GMT, sa...@maths.uwa.edu.au (The Scarlet

Quote
Manuka) wrote:
>Ralf A. Quint <ralf_qu...@hotmail.com> wrote:
>> On Thu, 27 Apr 2000 18:17:09 -0500, "Mavric" <be...@tznet.com> wrote:

>>>i have had some trouble geting that to work so what i do is this

>> What kind of trouble. CRT is one of the standard units of TP since

>RTE 200, I'd guess.

Not with TP 5.5. That's a problem with BP/TP 7 only !

Re:Clear screen in TP 5.5


try "clrscr;"

Re:Clear screen in TP 5.5


JRS:  In article <489ce8.bb...@bastisoft.de> of Fri, 28 Apr 2000
17:03:32 seen in news:comp.lang.pascal.borland, Sebastian Koppehel

Quote
<un0...@bastisoft.de> wrote:
>Ralf A. Quint wrote:

>> Your "workaround" code btw. is
>> only working in a 25 row screen mode and doesn't take windows into
>> consideration.

>I don't want to be a nitpicker, but even then the behaviour is not
>identical, as ClrScr carries you to line 1, column 1.

The request was to clear the screen, not to emulate ClrScr.

However, IMHO it's a bad thing to do, if one is not using GoToXY or
equivalent but just operating in "typewriter" mode; the user is not
harmed by the presence of previous material above the old, and may wish
to refer to it.  A clear line or two suffices for me.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.

Re:Clear screen in TP 5.5


Hi,

Quote
Dr John Stockton wrote:
>>I don't want to be a nitpicker, but even then the behaviour is not
>>identical, as ClrScr carries you to line 1, column 1.

> The request was to clear the screen, not to emulate ClrScr.

It is a different behaviour nonetheless, which should be taken into
account.

Quote
> However, IMHO it's a bad thing to do, if one is not using GoToXY or
> equivalent but just operating in "typewriter" mode; the user is not
> harmed by the presence of previous material above the old, and may wish
> to refer to it.  A clear line or two suffices for me.

Fully argreed. Programs that work on line-oriented data should use the
operating system's special I/O file handles anyway, and even if they
produce human readable output, the user might want to redirect it to a
file to use it later. Unless one is very sure that the user wants a
graphical user interface, one should not clear the screen.

 - Sebastian

Re:Clear screen in TP 5.5


In article <ufree8.rc...@bastisoft.de>,

Quote
Sebastian Koppehel <un0...@bastisoft.de> wrote:

>Fully argreed. Programs that work on line-oriented data should use the
>operating system's special I/O file handles anyway, and even if they
>produce human readable output, the user might want to redirect it to a
>file to use it later. Unless one is very sure that the user wants a
>graphical user interface, one should not clear the screen.

If one wants to use DOS services, then the following can be uses to
clear screen:

procedure ClrScr;
Begin
 Write(#27'[H'#27'[2J');
end;

This requires that ANSI.SYS is loaded. If it is not, them nothing
catastrophic happens, the string is just printed on screen.

If one wants to move the cursor then one can use:

procedure GotoXY(X,Y: Byte);
var m1,m2:string[3];
begin
  str(X,m1);
  str(Y,m2);
  Write(#27'['+m2+';'+m1+'H');
end;

Again with Ansi.sys.

Osmo

Re:Clear screen in TP 5.5


On Sat, 29 Apr 2000 16:27:10 +0200, un0...@bastisoft.de (Sebastian

Quote
Koppehel) wrote:
>Hi,

>Dr John Stockton wrote:

>>>I don't want to be a nitpicker, but even then the behaviour is not
>>>identical, as ClrScr carries you to line 1, column 1.

>> The request was to clear the screen, not to emulate ClrScr.

>It is a different behaviour nonetheless, which should be taken into
>account.

>> However, IMHO it's a bad thing to do, if one is not using GoToXY or
>> equivalent but just operating in "typewriter" mode; the user is not
>> harmed by the presence of previous material above the old, and may wish
>> to refer to it.  A clear line or two suffices for me.

>Fully argreed. Programs that work on line-oriented data should use the
>operating system's special I/O file handles anyway, and even if they
>produce human readable output, the user might want to redirect it to a
>file to use it later. Unless one is very sure that the user wants a
>graphical user interface, one should not clear the screen.

> - Sebastian

But wouldn't it make more sense why  the original poster has problems
with a piece of code that SHOULD operate properly in the first place ?

Re:Clear screen in TP 5.5


On Sun, 30 Apr 2000 00:16:36 +0200, un0...@bastisoft.de (Sebastian

Quote
Koppehel) wrote:
>Hi,

>Ralf A. Quint wrote:

>> But wouldn't it make more sense why  the original poster has problems
>> with a piece of code that SHOULD operate properly in the first place ?

>What would make more sense than what?

Oops, should read:
But wouldn't it make more send to find out why the original poster has
problems with a piece of code that SHOULD compile and operate properly
in the first place ?
Go to page: [1] [2]

Other Threads