Article View: alt.msdos.programmer
Article #1065Re: ANSI escape sequences
From: Jochen "Joscho" Schoof
Date: Thu, 28 Jan 1993 13:46
Date: Thu, 28 Jan 1993 13:46
48 lines
2360 bytes
2360 bytes
Carl Dichter (dichter@chdasic.sps.mot.com) wrote:
: Does anyone have an a list of the ANSI (terminal) escape sequences?
: I'm especially interested in the ones to change
: color or attributes.
Voila, I think the following lines in C (to be exact C-Preprocessor)
show the abilities quite well. I think the macros are described by their
names, so no further comments are needed. BTW: There are much more
features available. They are described in the documentation to some of
those ANSI.SYS substitutes (I strongly recommend NNANSI Version 09/92).
Have fun with these...
-Jochen
------------------ C program starts here -------------------------------
/* XANSI.H - Screen Control Routines for Color Machines */
#define GotoXY(x,y) printf("\033[%d;%dH",(y),(x))
#define ClrScr() printf("\033[2J")
#define Color(f,b) printf("\033[%d;%d;%dm",(f)>8,30+(f)%8,40+(b)%8)
#define ClrEol() printf("\033[K")
/* ...and finally the available colors with their ANSI-values */
#define BLACK 0
#define RED 1
#define GREEN 2
#define BROWN 3
#define BLUE 4
#define MAGENTA 5
#define CYAN 6
#define WHITE 7
#define GREY 8
#define LIGHT_RED 9
#define LIGHT_GREEN 10
#define YELLOW 11
#define LIGHT_BLUE 12
#define LIGHT_MAGENTA 13
#define LIGHT_CYAN 14
#define LIGHT_WHITE 15
---------------------------------------------------------------------------
Jochen Schoof schoof@dec5.informatik.uni-wuerzburg.de
Lehrstuhl f. Informatik II +-----------------------------------------------
Universitaet Wuerzburg | It's worse than that: he's dead, Jim! -Bones
---------------------------+-----------------------------------------------
Technical Details
Message-ID:
<1993Jan28.134648.24382@informatik.uni-wuerzburg.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!fauern!dec16!dec8!schoofReferences:
<1993Jan22.180945.452@newsgate.sps.mot.com>Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!fauern!dec16!dec8!schoof From: schoof@informatik.uni-wuerzburg.de (Jochen "Joscho" Schoof) Subject: Re: ANSI escape sequences Message-ID: <1993Jan28.134648.24382@informatik.uni-wuerzburg.de> Followup-To: alt.msdos.programmer,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer Sender: news@informatik.uni-wuerzburg.de (USENET News account) Organization: University of Wuerzburg, Germany X-Newsreader: TIN [version 1.1 PL8] References: <1993Jan22.180945.452@newsgate.sps.mot.com> Date: Thu, 28 Jan 1993 13:46:48 GMT Lines: 48