By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,960 Members | 990 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,960 IT Pros & Developers. It's quick & easy.

text color

P: n/a
Hi all,

what is the name of the function to change the text color when programming
in C under msdos?

thanks
ivan
Sep 20 '06 #1
Share this Question
Share on Google+
12 Replies


P: n/a
ivan schrieb:
what is the name of the function to change the text color when programming
in C under msdos?
That's depends on your compiler (RTL).

--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!
Sep 20 '06 #2

P: n/a

"Robert Riebisch" <Ro*************@arcor.deha scritto nel messaggio
news:45***********************@newsspool3.arcor-online.net...
ivan schrieb:
what is the name of the function to change the text color when
programming
in C under msdos?

That's depends on your compiler (RTL).
VC++ Express..
--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!

Sep 20 '06 #3

P: n/a
ivan schrieb:
VC++ Express..
You can't do DOS in Visual C++ Express!

You are probably talking about a command line window. That's not DOS!
You are off-topic here.

--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!
Sep 20 '06 #4

P: n/a
"ivan" writes:
"Robert Riebisch" <Ro*************@arcor.deha scritto nel messaggio
news:45***********************@newsspool3.arcor-online.net...
>ivan schrieb:
what is the name of the function to change the text color when
programming
in C under msdos?

That's depends on your compiler (RTL).

VC++ Express..
Then post your question to a newsgroup that discusses that compiler. Read
the FAQ for this newsgroup.
Sep 20 '06 #5

P: n/a
ivan wrote:
"Robert Riebisch" <Ro*************@arcor.deha scritto nel messaggio
what is the name of the function to change the text color when programming
in C under msdos?
That's depends on your compiler (RTL).

VC++ Express..
http://msdn.microsoft.com/library/de...tattribute.asp

Sep 20 '06 #6

P: n/a
Robert Riebisch said:
ivan schrieb:
>VC++ Express..

You can't do DOS in Visual C++ Express!
Yes, you can. You can use Visual C++ Express to write a DOS clone, no
problem.

What you can't do is Visual C++ Express in DOS. And Visual C++ Express does
not allow you to target DOS directly. (Obviously, you could use it to write
a *program* that generates a 16-bit executable! But Visual C++ won't do it
itself.)
You are probably talking about a command line window.
Ah, now you have me. Yes, probably he is...
That's not DOS!
....and probably it isn't. (It might be - he could be running a DOS
emulator...)
You are off-topic here.
....and here!

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 20 '06 #7

P: n/a
On Wed, 20 Sep 2006 15:02:41 +0200, in comp.lang.c , "ivan"
<wo********@wolfsafety.itwrote:
>Hi all,

what is the name of the function to change the text color when programming
in C under msdos?
This is a FAQ.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Sep 20 '06 #8

P: n/a

ivan wrote:
Hi all,

what is the name of the function to change the text color when programming
in C under msdos?

thanks
ivan
You can use ANSI escape sequence codes

http://en.wikipedia.org/wiki/ANSI_escape_code

-kondal

Sep 21 '06 #9

P: n/a
"kondal" <ko******@gmail.comwrites:
ivan wrote:
>what is the name of the function to change the text color when programming
in C under msdos?

You can use ANSI escape sequence codes

http://en.wikipedia.org/wiki/ANSI_escape_code
Only if you're using an ANSI-compatible terminal or emulator.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 21 '06 #10

P: n/a
ok thanks everyone...
"Keith Thompson" <ks***@mib.orgha scritto nel messaggio
news:ln************@nuthaus.mib.org...
"kondal" <ko******@gmail.comwrites:
ivan wrote:
what is the name of the function to change the text color when
programming
in C under msdos?
You can use ANSI escape sequence codes

http://en.wikipedia.org/wiki/ANSI_escape_code

Only if you're using an ANSI-compatible terminal or emulator.

--
Keith Thompson (The_Other_Keith) ks***@mib.org
<http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*>
<http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.

Sep 22 '06 #11

P: n/a
>what is the name of the function to change the text color when programming
>in C under msdos?
You can use ANSI escape sequence codes
That's the way I do it, and it's programming-language independent.
If the "escape" characters make it -- the FIRST line should be
^[ (as one character) followed by [2J and so on -- you can TYPE
the following stuff (between the "cut here" lines) to see what
ANSI can do for you. (And if the escape characters do NOT make
it, let me know and I'll substitute some character that WILL
make it through and you can re-substitute back to the escapes.)

---------- cut here ---------- cut here ---------- cut here ----------

Normal Red on black Normal Green on black
High Red on black High Green on black
 Grey on black Normal Blue on black is not very readable
 White on black High Blue on black
 Orange on black Normal Magenta on black
 Yellow on black High Magenta on black
Normal Cyan on black High Cyan on black High Cyan on grey

+-0 = White on black ("Normal") [same as Low]
| 1 = High-intensity text
ESC[xm Screen INTENSITY: x=+ 2 = Low -intensity text [same as "Normal"
+-0 = Black | 5 = Blink or high-intensity background [bright!]
| 1 = Red | 7 = Inverse (black on white) [nope]
| 2 = Green +-8 = Invisible text (fore- & back-ground same)
ESC[3x;4ym COLOR:+ 3 = Orange [nope]
| 4 = Blue These can be combined:
x=foreground | 5 = Magenta ESC[1;5m = hi-intensity blinking foreground
y=background | 6 = Cyan ESC[1;2;31;42m etc.
+-7 = White
---------- cut here ---------- cut here ---------- cut here ----------

--Myron.
--
--Myron A. Calhoun.
Five boxes preserve our freedoms: soap, ballot, witness, jury, and cartridge
NRA Life Member and Rifle, Pistol, & Home Firearm Safety Certified Instructor
Certified Instructor for the Kansas Concealed-Carry Handgun license
Sep 23 '06 #12

P: n/a

mc******@ksu.edu wrote:
what is the name of the function to change the text color when programming
in C under msdos?
You can use ANSI escape sequence codes

That's the way I do it, and it's programming-language independent.
If the "escape" characters make it -- the FIRST line should be
^[ (as one character) followed by [2J and so on -- you can TYPE
the following stuff (between the "cut here" lines) to see what
ANSI can do for you. (And if the escape characters do NOT make
it, let me know and I'll substitute some character that WILL
make it through and you can re-substitute back to the escapes.)

---------- cut here ---------- cut here ---------- cut here ----------

Normal Red on black Normal Green on black
High Red on black High Green on black
 Grey on black Normal Blue on black isnot very readable
 White on black High Blue on black
 Orange on black Normal Magenta on black
 Yellow on black High Magenta on black
Normal Cyan on black High Cyan on black High Cyan on grey

+-0 = White on black ("Normal") [same as Low]
| 1 = High-intensity text
ESC[xm Screen INTENSITY: x=+ 2 = Low -intensity text [same as "Normal"
+-0 = Black | 5 = Blink or high-intensity background [bright!]
| 1 = Red | 7 = Inverse (black on white) [nope]
| 2 = Green +-8 = Invisible text (fore- & back-ground same)
ESC[3x;4ym COLOR:+ 3 = Orange [nope]
| 4 = Blue These can be combined:
x=foreground | 5 = Magenta ESC[1;5m = hi-intensity blinking foreground
y=background | 6 = Cyan ESC[1;2;31;42m etc.
+-7 = White
---------- cut here ---------- cut here ---------- cut here ----------

--Myron.
--
--Myron A. Calhoun.
Five boxes preserve our freedoms: soap, ballot, witness, jury, and cartridge
NRA Life Member and Rifle, Pistol, & Home Firearm Safety Certified Instructor
Certified Instructor for the Kansas Concealed-Carry Handgun license
Please don't snip attribution lines. I learnt the meaning/reason from
Keith Thompson once.

-kondal

Sep 24 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.