X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Wed, 13 Feb 2002 12:18:02 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Warren Simmons cc: djgpp AT delorie DOT com Subject: Re: ansi escape codes do not work using DJGPP gpp command In-Reply-To: <000801c1b447$16bf5480$b95b560c@ws1> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 12 Feb 2002, Warren Simmons wrote: > This is a post for the djgpp forum or a question that perhaps one of you = > could answer. > I use the ansi escape codes for various screen functions. To clear the = > screen I #include and include the line: printf("\33[2J"); = > wherever I want the screen to clear. It works on GNU g++ (Linux) but = > when I use it with DJGPP (gpp -Wall somefile.cpp) the outpu of the .exe = > at that point will print to the screen the following: --[2Jthen the = > cout from the next line. The ANSI escape sequences are implemented by the terminal device driver. Unix and GNU/Linux systems have that enabled by default, while MS-DOS terminal by default doesn't support that. You should be able to turn on support for that by loading the ANSI.SYS device driver. However, I'm not sure this will work inside the Windows DOS box. In general, use of such escape sequences is inherently non-portable. You should not expect it to work on every system. > I use this to clear = > the screen. I have a locate x,y function the uses ansi escape code. Its = > very useful. If you don't want to load ANSI.SYS, you could replace that code with calls to conio functions such as clearscr or ScreenClear. > Also...can djgpp print out the acsii extended character set = > (128 to 256 symbols)? Yes. But keep in mind that the font used by MS-DOS and MS-Windows for these codes is different from what Unix and GNU/Linux systems use. So don't expect to see the same glyphs on the screen in every case.