delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/15/14:30:06

From: "A. Sinan Unur" <asu1 AT c-o-r-n-e-l-l DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DOS cursor/screen commands?
Date: 15 Nov 2002 19:16:33 GMT
Organization: Cornell University
Lines: 45
Sender: asu1 AT cornell DOT invalid (on pool-141-149-206-9.syr.east.verizon.net)
Message-ID: <Xns92C79139FBDB5asu1cornelledu@132.236.56.8>
References: <1037380690 DOT 391305 AT cswreg DOT cos DOT agilent DOT com>
NNTP-Posting-Host: pool-141-149-206-9.syr.east.verizon.net
X-Trace: news01.cit.cornell.edu 1037387793 20310 141.149.206.9 (15 Nov 2002 19:16:33 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 15 Nov 2002 19:16:33 GMT
User-Agent: Xnews/5.04.25
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

rrd AT ftc DOT agilent DOT com (Ray Depew) wrote in
news:1037380690 DOT 391305 AT cswreg DOT cos DOT agilent DOT com: 

> I'm trying to do the equivalent of DOS "cls" in a C program.  When I
> run the following program, all I get on stdout is the following three
> lines. 
> 
>      Hello
>      *[2J
>      Goodbye
> 
> What I've shown as an asterisk is a "left-arrow" character
> representing the escape character.  What am I doing wrong?  And is
> there a better way to do it? 
> 
> 
> /* file 'clrscrn.c' */
> /* Ray Depew 14 Nov 2002 11:00 */
> /* An attempt to clear the screen under program command. */
> 
> /* 'Clear screen' for MSDOS is defined as ESC[2J, 
>  * where ESC is the escape character, ASCII 27,
>  * and 2 can be any integer or omitted completely, 
>  * according to
>  * <http://www3.sympatico.ca/rhwatson/dos7/v-ansi-commands.html>
>  */

did you actually read what it says on that page:

"Once Ansi.sys has been loaded, it's various functions can be accessed at 
any time by sending one or more "Escape Sequences" to the screen. An Escape 
Sequence comprises three parts: "

and it is right there toward the top of the page. note the key phrase "Once 
Ansi.sys has been loaded".

so, decide if you want to use ansi.sys. if you do, then load it.

otherwise, look at the documentation for conio functions.

-- 
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019