Clear screen in TP 5.5 
Author Message
 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.


Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5

Quote:

> 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.


Wed, 18 Jun 1902 08:00:00 GMT  
 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)


Quote:

> > 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.



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5

Quote:

>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.


Wed, 18 Jun 1902 08:00:00 GMT  
 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



Quote:

> >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.



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5

Quote:

>>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

______________________________|_______________________________________



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5
Hi,

Quote:

> 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



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5


<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.

--

 <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.



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5

Quote:



>>>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 !


Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5
try "clrscr;"


Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5


Quote:


>> 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.

--

 <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.



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5
Hi,

Quote:

>>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



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5

Quote:

>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



Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5

Quote:

>Hi,


>>>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 ?


Wed, 18 Jun 1902 08:00:00 GMT  
 Clear screen in TP 5.5

Quote:

>Hi,


>> 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 ?


Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 25 post ]  Go to page: [1] [2]

 Relevant Pages 

1. PRINT GRAPH SCREEN in TURBO PASCAL 5.5

2. TP 5.5 Runtime-Library

3. TP 5.5 Upgrade??

4. TP 5.5 and WIN 98 ?

5. TP 5.5 or 7?

6. Borland TP 5.5 Install

7. Uptime in TP 5.5

8. Simple migration from TP 5.5???

9. Write an assert for TP 5.5

10. Will buy TP 5.5 docs

11. i mean get not steal tp 5.5,sorry.

12. Loading Images (bmp, gif, jpg) in TP 5.5

 

 
Powered by phpBB® Forum Software