Mail Archives: djgpp/2002/11/15/14:30:06
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 -