Clearscreen 
Author Message
 Clearscreen

Hi,

I am new to Pascal. May I ask if Pascal has a simple method to clear the
screen (like CLS in dos)? I have searched the web and read the online help
with no success.

Please help. Thanks very much!

Orange.



Thu, 17 Apr 2003 18:12:21 GMT  
 Clearscreen
Hi!

Quote:

> I am new to Pascal. May I ask if Pascal has a simple method to clear the
> screen (like CLS in dos)? I have searched the web and read the online help
> with no success.

Use 'clrscrn'. To set the backgroundcolor and textcolor you can use 'TextColor()'
and 'TextBackground()' or the variable 'TextAttr' for both before.

hth

                        ciao, Dominik



Fri, 18 Apr 2003 04:46:14 GMT  
 Clearscreen

Quote:
> I am new to Pascal. May I ask if Pascal has a simple method to clear the
> screen (like CLS in dos)? I have searched the web and read the online help
> with no success.

You may use ClrScr (but you must declare unit CRT). Sample program:

 uses CRT;
 begin
  ClrScr;
 end.

or using assembly:

begin
 asm mov ax , $03; int $10; end;
end.

--
greetings

 ukasz Nowicki

 Queen, Taekwondo, Pascal, Lyrics, FreeDOS PL mirror
 http://www.jagoda.kki.pl/
 want to see some action? www.jagoda.kki.pl/luke.mpg



Fri, 18 Apr 2003 04:24:47 GMT  
 Clearscreen


Quote:

>I am new to Pascal. May I ask if Pascal has a simple method to clear the
>screen (like CLS in dos)? I have searched the web and read the online help
>with no success.

The two earlier answers are not safe; they assume a dialect of Pascal
equivalent to Turbo Pascal.  But this is c.l.p.misc, which by definition
is not for TP, so you must be using some other compiler; for TP, use

A method which works in most languages is illustrated by
        for J := 0 to 50 do <writeln> ;
but it leaves the cursor at the bottom.

A Web search, if comprehensive, would have found <URL: http://www.merlyn.
demon.co.uk/pas-extn.htm>

Beware of methods which clear the screen by setting a specific screen
mode with Int 10; the mode in use may be different.

--

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



Fri, 18 Apr 2003 06:29:10 GMT  
 Clearscreen

Quote:
> Beware of methods which clear the screen by setting a specific screen
> mode with Int 10; the mode in use may be different.

Yes, I know, but it was just an example.

--
pozdrawiam

 Lukasz Nowicki

 Queen, Taekwondo, Pascal, Wiersze, Opowiadania, FreeDOS PL mirror
 http://www.jagoda.kki.pl/
 want to see some action? www.jagoda.kki.pl/luke.mpg



Fri, 18 Apr 2003 15:15:56 GMT  
 Clearscreen

Quote:

>>screen (like CLS in dos)? I have searched the web and read the online help
>>with no success.

>The two earlier answers are not safe; they assume a dialect of Pascal
>equivalent to Turbo Pascal.  But this is c.l.p.misc, which by definition
>is not for TP, so you must be using some other compiler; for TP, use

>A method which works in most languages is illustrated by
>        for J := 0 to 50 do <writeln> ;
>but it leaves the cursor at the bottom.

Most modern cards support 132x60, so it might be wise to update this to "0 to
60" (and maybe Framebuffer consoles can even get higher line counts)


Fri, 18 Apr 2003 17:14:35 GMT  
 Clearscreen
Rephrasing a bit what John said, the language "Pascal" has no command to "clear the
screen", as this action is not defined in the language, it being highly
implementation-specific.  Since it IS implementation-specific, you must first find
out what your implementation requires.  Most probably (but not certainly!) you are
on a PC platform.  Most PCs can support the ANSI screen escape command (you may
need to load ANSI.SYS in Config.sys), and if so, you can generate the appropriate
escape sequence within Pascal (I believe the correct ANSI sequence is "<Esc>[2J",
no quotes).
Quote:




> >I am new to Pascal. May I ask if Pascal has a simple method to clear the
> >screen (like CLS in dos)? I have searched the web and read the online help
> >with no success.

> The two earlier answers are not safe; they assume a dialect of Pascal
> equivalent to Turbo Pascal.  But this is c.l.p.misc, which by definition
> is not for TP, so you must be using some other compiler; for TP, use

> A method which works in most languages is illustrated by
>         for J := 0 to 50 do <writeln> ;
> but it leaves the cursor at the bottom.

> A Web search, if comprehensive, would have found <URL: http://www.merlyn.
> demon.co.uk/pas-extn.htm>

> Beware of methods which clear the screen by setting a specific screen
> mode with Int 10; the mode in use may be different.

> --




Sat, 19 Apr 2003 03:41:42 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Clearscreen?

2. ClearScreen in Codewarrior

 

 
Powered by phpBB® Forum Software