Dom wrote:[color=blue]
> can someone please help me display text in the console
>
> cout << "Testing";
>
> in a different colour to the default one[/color]
C++ does not support colors. Please post this question to a programming
newsgroup dedicated to your platform.
"Attila Feher" <attila.feher@l mf.ericsson.se> wrote in message
news:bkenlb$h89 $1@newstree.wis e.edt.ericsson. se...[color=blue]
> Dom wrote:[color=green]
> > can someone please help me display text in the console
> >
> > cout << "Testing";
> >
> > in a different colour to the default one[/color]
>
> C++ does not support colors.
> [...][/color]
No, but C++ is defined by an ANSI standard, it defines
behaviour when outputting to a "C++ console", and ANSI
defines how to make a console render text in different
colors. So in a roundabout way, I don't think it's entirely
off-topic. ;)
David B. Held wrote:[color=blue]
> "Attila Feher" <attila.feher@l mf.ericsson.se> wrote in message
> news:bkenlb$h89 $1@newstree.wis e.edt.ericsson. se...
>[color=green]
>>Dom wrote:
>>[color=darkred]
>>>can someone please help me display text in the console
>>>
>>>cout << "Testing";
>>>
>>>in a different colour to the default one[/color]
>>
>>C++ does not support colors.
>>[...][/color]
>
>
> No, but C++ is defined by an ANSI standard, it defines
> behaviour when outputting to a "C++ console", and ANSI
> defines how to make a console render text in different
> colors. So in a roundabout way, I don't think it's entirely
> off-topic. ;)
>
> Here's a quickie:
>
> cout << "\x1b[31mTesting\x1b[0m\n";
>
> For more codes, Google for +ANSI +color.
>
> Dave[/color]
What about platforms that don't have consoles?
There is no requirement that a platform have a console.
If a platform _does_ have a console, there is no requirement that
the console be color. It _could_ be monochromatic and still be
compliant with ANSI C++. There is no requirement that a console
support the ANSI Escape sequences. Many Unix windowing programs,
as well as MS Windows and MacIntosh, don't support the ANSI Escape
sequences for a window.
Always search the FAQ and this newsgroup before posting:
"Thomas Matthews" <Thomas_Matthew sReallyHatesSpa m@sbcglobal.net > wrote in
message news:3F6B54F7.6 020601@sbcgloba l.net...[color=blue]
> [...]
> What about platforms that don't have consoles?[/color]
What about them? I don't see anyone asking for color
codes for platforms without consoles.
[color=blue]
> There is no requirement that a platform have a console.[/color]
Who said there was?
[color=blue]
> If a platform _does_ have a console, there is no requirement
> that the console be color.[/color]
That's all well and good. But the OP didn't ask how to set
color in a console that doesn't support it. Which is probably
a good thing.
[color=blue]
> It _could_ be monochromatic and still be compliant with
> ANSI C++.[/color]
Sure, but whose question does this fact answer?
[color=blue]
> There is no requirement that a console support the ANSI
> Escape sequences.[/color]
No, but most people who have a console that can support
color have a console that understands ANSI Escape sequences.
And giving an example of one is far more useful to the OP
than telling him that consoles are not required to support
escape sequences.
[color=blue]
> Many Unix windowing programs, as well as MS Windows
> and MacIntosh, don't support the ANSI Escape sequences
> for a window.
> [...][/color]
And I should hope that the OP either knows that or will
learn it, if in fact, that is important to him.
David B. Held wrote:[color=blue]
> "Thomas Matthews" <Thomas_Matthew sReallyHatesSpa m@sbcglobal.net > wrote in
> message news:3F6B54F7.6 020601@sbcgloba l.net...
>[color=green]
>>[...]
>>What about platforms that don't have consoles?[/color]
>
>
> What about them? I don't see anyone asking for color
> codes for platforms without consoles.[/color]
These guys are getting irratating. Must be that endless September
issue.
_You_ don't understand. I wasn't replying to the OP's post, but
to yours. One of the reasons that color is not in the ANSI C++
specification is because there isn't a standard for color. Also,
placing it into the standard would require that all platforms
support these features. Which leads to my usual rant on color
afficinados.
{Perhaps you should read my rant in Shiva's Welcome.txt below.}
The Problems Of Color
---------------------
So far, color has not been "standardiz ed". That is to say,
there isn't a standard method for representing color on a
computer (platform). There are so many fundamentals which
making a standard difficult. Listed below are some, but
not the only issues, involved with color.
1. Platforms that don't display information.
Many embedded systems do not have displays. They have
no need of displaying information. Many of these can
be found in household appliances as well as motion
controllers. A VCR display does not need to display
in more than one color, neither does a microwave oven.
Color cannot be required for those platforms that have
no need of it.
2. Displays: Vector & Raster {and others}
There is no common display. Some displays are vector
based others are raster. Color representation between
these two types are definitely different.
3. Monochrome displays.
There are many platforms out there that use a monochrome
display, such as photocopiers and DVD players. No need
to represent color on a platform that only supports
monochrome (i.e. one) color.
4. Color representation.
A pixel is a picture element. How many are required to
represent a color (such as aquamarine)? Some platforms
use one pixel per primary color, others have detailed
color information in the pixel. Which one is standard?
5. Bits per pixel.
How many bits per pixel to represent color? Some platforms
use one bit each for Red, Green, and Blue. Others use 8
bits for each color. Some also have bits for Orange and
Purple. What's the standard here? Cheap & small systems
don't have the memory for 8 bits per pixel. What are they
to do?
6. Subtractive or Additive Color?
Should the standard be based on Red, Green and Blue (such as
a display) or Cyan, Magenta and Yellow (like the printers
use)? What is the equivalence? When I was working at Adobe
with their Postscript systems, they had many tables for
conversion between RGB and CMY. They even had customers
that had printers using Orange and Purple.
7. Brilliance, Intensity, Reflection and other stuff.
Color also depends on intensity, and the transparency of
the medium. A picture printed on 20lb linen paper looks
different when printed on a high gloss stiff paper.
8. Color identification and naming.
A while back, many companies, such a Adobe Systems, Kodak,
Pantone, and others were holding joint meetings for a
proposal of color identifiers. For example, what are the
attributes of Mauve? How is Mauve represented on a: RGB
display, ink jet printer, laser jet printer, film recorder,
thermal transfer color printer and a scanner?
[color=blue][color=green]
>>There is no requirement that a platform have a console.[/color]
>
>
> Who said there was?[/color]
In order for an ANSI standard for color, it must either
require a platform to have a display/console or provide
exclusions for those that don't.
[color=blue]
>[color=green]
>>If a platform _does_ have a console, there is no requirement
>>that the console be color.[/color]
>
>
> That's all well and good. But the OP didn't ask how to set
> color in a console that doesn't support it. Which is probably
> a good thing.[/color]
I wasn't referring to the OP. I was referring your reply
which gave information about an ANSI driver. _I_ know that
color isn't standard. I asked _you_ how to set color on a
platform that doesn't support color, since you have an attitude
that Color is standardized (or at least there is an ANSI
specification for color, which there isn't. See rant above.)
[color=blue][color=green]
>>It _could_ be monochromatic and still be compliant with
>>ANSI C++.[/color]
>
>
> Sure, but whose question does this fact answer?[/color]
This is support for the argument that Color isn't in the
ANSI C++ specification. Although the easiest method is
to perform a text search on the electronic form of the
ANSI C++ specification. I'm willing to give in if you can
quote the section that describes color in the C++ standard.
[color=blue][color=green]
>>There is no requirement that a console support the ANSI
>>Escape sequences.[/color]
>
>
> No, but most people who have a console that can support
> color have a console that understands ANSI Escape sequences.
> And giving an example of one is far more useful to the OP
> than telling him that consoles are not required to support
> escape sequences.[/color]
Actually, referring the OP to a newsgroup that discusses
his/her platform is more helpful. I still haven't found
a requirement for a Window in MS Windows to support the
ANSI Escape Sequences. Last time I played with the Ansi
Escape Sequences, they required a driver be loaded. If
the driver wasn't loaded, the Escape Sequences just looked
like garbage and sometimes killed the application.
[color=blue][color=green]
>>Many Unix windowing programs, as well as MS Windows
>>and MacIntosh, don't support the ANSI Escape sequences
>>for a window.
>>[...][/color]
>
>
> And I should hope that the OP either knows that or will
> learn it, if in fact, that is important to him.
>
> Dave
>
>[/color]
In summary, color and the use of color is not discussed
in this newsgroup, news:comp.lang. c++, nor it brethren
news:comp.lang. c, because it is a platform dependent
issue. There is no mention of how to use color nor
requirements of color in the ISO specification of either
language. Color representation is difficult by itself
due to the many factors involved. Perhaps one day,
there will be a standard for color in which turquoise,
mauve and peach can be displayed on an RGB screen,
LCD display and laser printer all looking the same.
David B. Held wrote:[color=blue]
> "Attila Feher" <attila.feher@l mf.ericsson.se> wrote in message
> news:bkenlb$h89 $1@newstree.wis e.edt.ericsson. se...[color=green]
>> Dom wrote:[color=darkred]
>>> can someone please help me display text in the console
>>>
>>> cout << "Testing";
>>>
>>> in a different colour to the default one[/color]
>>
>> C++ does not support colors.
>> [...][/color]
>
> No, but C++ is defined by an ANSI standard,[/color]
No. C++ is defined by an ISO/IEC and ANSI joint standard.
[color=blue]
> it defines behaviour when outputting
> to a "C++ console",[/color]
No, it does not. It defines behavior of the standard output stream and has
*absolutely no idea* of any console.
[color=blue]
> and ANSI
> defines how to make a console render text in different
> colors.[/color]
OK. Then post to a comp.lang.c++.p lus.everything. else.ansi
Here we talk *only* C++. Platfom dependent things should be discussed where
the platform is discussed. Here we discuss the *language*.
BTW my platform has no ANSI terminal. And it has terminal. Wow.
[color=blue]
> So in a roundabout way, I don't think it's entirely
> off-topic. ;)[/color]
It is entirely off-topic *and* trolling. (Stating obviously stupid thing
just for the sake of argument.)
"WW" <wolof@freemail .hu> wrote in message
news:bkiclb$a79 $1@phys-news1.kolumbus. fi...[color=blue]
> [...]
> Here we talk *only* C++. Platfom dependent things
> should be discussed where the platform is discussed. Here
> we discuss the *language*.[/color]
I imagine you saying this part with your nose in the air.
[color=blue]
> BTW my platform has no ANSI terminal. And it has
> terminal. Wow.[/color]
That's wonderful. Or not. I'm not sure what your point is.
[color=blue][color=green]
> > So in a roundabout way, I don't think it's entirely
> > off-topic. ;)[/color]
>
> It is entirely off-topic *and* trolling. (Stating obviously
> stupid thing just for the sake of argument.)[/color]
Actually, I was being pragmatic. I would say the self-
appointed "moderators " of this *unmoderated* group are
the trolls. In fact, I would say that c.l.c++.m is better-
moderated than this group, and it's considerably more
lenient. Between you and Mr. Matthews, you have spent
about 5 times more energy saying why color is a taboo
subject in C++ than I did giving the OP a probably useful
reply while redirecting him to other resources. That tells
me that you are less interested in talking about C++ than
you are in policing talk about C++. Since the group is
not moderated, you can't prevent people from asking
questions that are in the FAQ or the newsgroup guidelines
or any other document you choose to cite. So instead
of being a bunch of self-righteous pricks, why don't you
let people who choose to be helpful be helpful, and spend
that time answering more questions?
David B. Held wrote:[color=blue]
> "WW" <wolof@freemail .hu> wrote in message
> news:bkiclb$a79 $1@phys-news1.kolumbus. fi...[color=green]
>> [...]
>> Here we talk *only* C++. Platfom dependent things
>> should be discussed where the platform is discussed. Here
>> we discuss the *language*.[/color]
>
> I imagine you saying this part with your nose in the air.[/color]
Please keep your posts on the topc of C++. if you whish to exercise your
attempted humor, go to the alt.flame newsgroup.
[color=blue][color=green]
>> BTW my platform has no ANSI terminal. And it has
>> terminal. Wow.[/color]
>
> That's wonderful. Or not. I'm not sure what your point is.[/color]
You have missed the point. it is not my point. It is yours too. As long
as you use this newsgroup.
[color=blue][color=green][color=darkred]
>>> So in a roundabout way, I don't think it's entirely
>>> off-topic. ;)[/color]
>>
>> It is entirely off-topic *and* trolling. (Stating obviously
>> stupid thing just for the sake of argument.)[/color]
>
> Actually, I was being pragmatic.[/color]
You have been off-topic and trolling...
[color=blue]
> I would say the self-
> appointed "moderators " of this *unmoderated* group are
> the trolls.[/color]
....and continue trolling.
[color=blue]
> In fact, I would say that c.l.c++.m is better-
> moderated than this group, and it's considerably more
> lenient.[/color]
Try asking there about color printing and then post an answer with
non-postable terminal characters. I'd really love seeing Francis get you.
[color=blue]
> Between you and Mr. Matthews, you have spent
> about 5 times more energy saying why color is a taboo
> subject in C++ than I did giving the OP a probably useful
> reply while redirecting him to other resources.[/color]
I have spent the time thanx to you off-topic trolling. Shitting is OK you
say - it is part of nature. All right, but then do not wonder if someone
does it in your living room.
[color=blue]
> That tells
> me that you are less interested in talking about C++ than
> you are in policing talk about C++.[/color]
Certainly. That is why I have worked my ass off for years to get into the
C++ committee, to visit all possible conferences and all the 3 of The C++
Seminar. I *am* interested in talking about C++. That is why I wish that
off-topic troll like yourself would just get out of here and leave me time
to answer/read those posts which are about C++.
You may not have a life I have one. And I would rather spend my short free
time on constructive work in here rather than trying to find on-topic posts
in all the junk.
[color=blue]
> Since the group is not moderated, you can't
> prevent people from asking questions that
> are in the FAQ or the newsgroup guidelines
> or any other document you choose to cite.[/color]
Yes. But if they are not assholes - unlike some - and if they are informed
that they should post their C++ language questions here and the rest
elsewhere they will do so. If they are asshole they keep arguing.
[color=blue]
> So instead
> of being a bunch of self-righteous pricks,[/color]
F**k you man.
[color=blue]
> why don't you
> let people who choose to be helpful be helpful, and spend
> that time answering more questions?[/color]
So why don't you crawl back to whereever you crawl out from and *leave us*
here so that we will *have time* to answer questions because we do not need
to waste it reading your fallacies? If you do not wish to participate in a
C++ language newsgroup then please do not waste thousands of people's time
by trolling.
I have no trouble with people giving redirection and giving also an
off-topic answer if they know it. If you care to look you will see I do it
myself if the answer is short. But I do have trouble with people arguing
the topicality of clearly off-topic things and I do have trouble believing
the good intentions of those. And I do count fallacies like yours that all
ANSI standards belong here.
So decide if you want to be part of the problem or part of the solution.
The problem here is that there are some days over 500 posts and many of
those is waste of time to download or look at, because they have nothing to
do with the purpose of this newsgroup. The other problem is people - like
you - who support those instead of trying to keep the volume on a managable
level.
Many C++ experts do not read this newsgroup due to the sheer volume of
off-topic messages. We can all say thanx to those people for that who are
encouraging off-topic threads. Like you.
"WW" <wolof@freemail .hu> wrote in message
news:bkik4h$o0m $1@phys-news1.kolumbus. fi...[color=blue]
> [...]
> Please keep your posts on the topc of C++.[/color]
Why don't you do the same? This thread has degenerated
from a topic that was questionably about C++ to a topic
that is completely unrelated to C++, and you and Mr.
Matthews are primarily responsible.
[color=blue][color=green]
> > [...]
> > Actually, I was being pragmatic.[/color]
>
> You have been off-topic and trolling...[/color]
I see. So it's more important to bend your will to the
newsgroup gestapo then spend a few lines of text giving
someone a useful pointer. Because being helpful makes
you a "troll". Well, I'd much rather continue this "trolling"
thread and annoy every self-appointed moderator of this
group than stop helping people when it's easy and
convenient to do so. If you don't like that, you are free
to create a moderated newsgroup where you actually
have control over the content.
[color=blue]
> [...]
> Try asking there about color printing and then post an
> answer with non-postable terminal characters. I'd really
> love seeing Francis get you.[/color]
I'm sure you would, because you seem to be sadistic like
that. But frankly, I see numerous threads there that have
little to do with the C++ language itself. Here are some
examples:
Thread safe strings? (as you know, C++ is thread-agnostic)
compiling difference b/w G++ and VC++ (platform-
specific thread)
Protecting or hiding a username and password in C++
(obviously not a C++-specific issue)
Ideas for a midterm and final projects (in C++, but
clearly not a language question)
g007: banning profane language in C++ source code
(not C++-specific)
"frame memory" malapropism? (tangentially related to
C++
IDE for C++ (about as relevant to C++ as color console
output)
Note that even on these questionable threads (which don't
annoy me in the least), even the more "conservati ve"
posters don't go off on tirades about how the topic isn't
100% related to the newsgroup. Basically, people in
c.l.c++.m have better things to worry about.
[color=blue]
> [...]
> I have spent the time thanx to you off-topic trolling.[/color]
But you make it sound like I'm the only person trolling
here. I think your posts are also troll-worthy.
[color=blue]
> Shitting is OK you say - it is part of nature. All right,
> but then do not wonder if someone does it in your living
> room.[/color]
So if I had said this instead of you, would that make me
a troll?
[color=blue]
> [...]
> You may not have a life I have one. And I would rather
> spend my short free time on constructive work in here
> rather than trying to find on-topic posts in all the junk.[/color]
Well, if you had left it alone, you would have seen exactly
two "off-topic" posts in this thread. But now there are 6
such posts, only half of which were written by me. Not
to mention that you spent all the time writing some of them.
So it seems to me that you would rather spend your "short
free time" policing the group and creating more off-topic
nonsense for *other* people to skip over than merely
dealing with the content that interests you. And if the
off-topic content bothers you so much, why don't you just
read c.l.c++.m instead?
[color=blue]
> [...]
> Yes. But if they are not assholes - unlike some - and if
> they are informed that they should post their C++
> language questions here and the rest elsewhere they will
> do so. If they are asshole they keep arguing.[/color]
Hmm...all of my posts have a reply...I wonder what that
means?
[color=blue]
> [...]
> F**k you man.[/color]
Umm...who's the troll?
[color=blue]
> [...]
> So why don't you crawl back to whereever you crawl out
> from and *leave us* here so that we will *have time* to
> answer questions because we do not need to waste it
> reading your fallacies?[/color]
In this thread, I'm the only person who answered a question.
You and Mr. Matthews spent 5 posts saying why I shouldn't
have answered it. If you have less time to answer interesting
questions, whose fault is that?
[color=blue]
> If you do not wish to participate in a C++ language
> newsgroup then please do not waste thousands of people's
> time by trolling.[/color]
I see. So answering questions constitutes "trolling", but
policing an umoderated group constitutes "participation" .
Wow, the net changes so fast I can't keep up with all the
definitions.
[color=blue]
> I have no trouble with people giving redirection and giving
> also an off-topic answer if they know it. If you care to look
> you will see I do it myself if the answer is short. But I do
> have trouble with people arguing the topicality of clearly
> off-topic things and I do have trouble believing the good
> intentions of those.[/color]
Oh, you're absolutely right. My whole intention all along was
to bring a flood of off-topic posters to c.l.c++. You caught
me. The answer I gave *was* short, you gave no redirection,
and I never said it was on-topic. Also, you apparently don't
know what a smiley is.
[color=blue]
> And I do count fallacies like yours that all ANSI standards
> belong here.[/color]
LOL!! No, that's called an "invalid inference".
[color=blue]
> So decide if you want to be part of the problem or part of
> the solution. The problem here is that there are some days
> over 500 posts and many of those is waste of time to
> download or look at, because they have nothing to do with
> the purpose of this newsgroup.[/color]
Ask yourself if any of your posts might fall into that category,
and then ask yourself if you are being "part of the problem or
part of the solution".
[color=blue]
> The other problem is people - like you - who support those
> instead of trying to keep the volume on a managable
> level.[/color]
Hey, I didn't say: "By all means continue to ask your color-
related questions here." I redirected the OP to a useful
Google search. If there's an unmanageable volume, I'd say
it's because group cops like you double the amount of off-
topic posts.
[color=blue]
> Many C++ experts do not read this newsgroup due to the
> sheer volume of off-topic messages.[/color]
They read c.l.c++.m, like you should, if you only want to
see topical messages.
[color=blue]
> We can all say thanx to those people for that who are
> encouraging off-topic threads. Like you.[/color]
I defy you to show how I "encouraged " off-topic threads.
Of all the people that have posted after me on this thread,
none of them have asked for further information about
color. And none of them have contributed to C++
discussion either.
David B. Held wrote:
[color=blue]
> "WW" <wolof@freemail .hu> wrote in message
> news:bkiclb$a79 $1@phys-news1.kolumbus. fi...
>[color=green]
>>[...]
>>Here we talk *only* C++. Platfom dependent things
>>should be discussed where the platform is discussed. Here
>>we discuss the *language*.[/color]
>
>
> I imagine you saying this part with your nose in the air.[/color]
If you don't like the topic of this group, you should go elsewhere. I
can't imagine why you'd want to stay here if you don't like the topic
being discussed.
[color=blue]
>
> Actually, I was being pragmatic. I would say the self-
> appointed "moderators " of this *unmoderated* group are
> the trolls.[/color]
Then you need to check the definition of "troll".
[color=blue]
> In fact, I would say that c.l.c++.m is better-
> moderated than this group,[/color]
Brilliant observation, seeing as how this group is not moderated.
[color=blue]
> and it's considerably more
> lenient. Between you and Mr. Matthews, you have spent
> about 5 times more energy saying why color is a taboo
> subject in C++ than I did giving the OP a probably useful
> reply while redirecting him to other resources.[/color]
This is the point. We are equipped to deal with C++ issues. We are (as a
group) pretty good at solving people's issues with C++. We are NOT good
at answering every random question some jerk who can't be bothered to
find an appropriate group feels like asking.
Off-topic posts (and people like you who seem to think we should expand
the group to deal with anything and everything) make the group less
useful *because* they take so much energy that would otherwise be spent
helping people with C++ problems.
What is the point of having a topic at all if we don't stick to it? It's
what we're good at. There are other people in other groups who are good
at other things. If we allowed every topic under the sun, we wouldn't be
able to help anyone.
[color=blue]
> That tells
> me that you are less interested in talking about C++ than
> you are in policing talk about C++.[/color]
You are wrong. We would be perfectly happy if the off-topic posts would
stop so we could discuss the topic we come here to discuss. That's
precisely why we enforce topicality rules.
[color=blue]
> Since the group is
> not moderated, you can't prevent people from asking
> questions that are in the FAQ or the newsgroup guidelines
> or any other document you choose to cite.[/color]
Why the hell should we have to? Basic Usenet etiquette covers that. And
if people want to ignore etiquette, why should we help them?
[color=blue]
> So instead
> of being a bunch of self-righteous pricks, why don't you
> let people who choose to be helpful be helpful, and spend
> that time answering more questions?[/color]
Because off-topic posting is NOT helpful. It's rude and disruptive.
You complain about people not getting helped, yet you want to open the
group up to questions that 1) we aren't well-equipped to answer and 2)
will increase the already high traffic, making it more difficult for
anyone to get a question answered? How would that help anyone?
-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.
"Thomas Matthews" <Thomas_Matthew sReallyHatesSpa m@sbcglobal.net > wrote in
message news:3F6CB327.1 020305@sbcgloba l.net...[color=blue]
> [...]
> These guys are getting irratating.[/color]
I agree. Mr. "Attila" have turned one post with questionable
topicality in to a newgroup gestapo beat-down.
[color=blue]
> [...]
> _You_ don't understand. I wasn't replying to the OP's
> post, but to yours.[/color]
Oh, I understand that. I was merely trying to imply that
your post on the relevance of color to C++ really isn't
helpful to anyone. I guess sutbtlety is lost on the internet.
[color=blue]
> One of the reasons that color is not in the ANSI C++
> specification is because there isn't a standard for color.[/color]
Well, you're answering a question that wasn't asked, but
maybe people will find that fact useful anyway.
[color=blue]
> Also, placing it into the standard would require that all
> platforms support these features.[/color]
Nonsense. As you yourself later note, some platforms
don't make provision for displaying output. The standard
does not require them to do so, even when a program
executes statements which are defined to produce output.
That's because it would be silly to say: "Platforms which
do not produce visible output cannot have a conforming
C++ implementation" . In the same manner, it would be
silly to say that color output couldn't be defined by the
standard because some platforms don't support color
output.
[color=blue]
> [...]
> {Perhaps you should read my rant in Shiva's
> Welcome.txt below.}[/color]
While that's all very interesting, I'm sure, it has even less to
do with C++ than the original post. And yet it's hundreds
of times longer.
[color=blue]
> [...]
> In order for an ANSI standard for color, it must either
> require a platform to have a display/console or provide
> exclusions for those that don't.[/color]
Well, given that that's true (and I'm not going to sit here
and challenge it, because this is already horribly off-topic),
how does that prove that I said that platforms are required
to have a console?
[color=blue]
> [...]
> I wasn't referring to the OP. I was referring your reply
> which gave information about an ANSI driver. _I_ know
> that color isn't standard. I asked _you_ how to set color
> on a platform that doesn't support color, since you have
> an attitude that Color is standardized (or at least there is
> an ANSI specification for color, which there isn't. See
> rant above.)[/color]
Well, I'm sorry I displayed that "attitude" towards you, but
here is what I SAID:
"...and ANSI defines how to make a console render
text in different colors..."
I never said how to make a *specific* color, or that it will
render color text on *all* consoles. Obviously, it was
implied that the color codes are only suitable for consoles
which support the ANSI escape sequences, and those
sequences *are* standard, regardless of whether the exact
color values rendered are or not. Since I doubt the OP is
trying to color-match his console output to a Pantone sample,
I think my answer was at least somewhat helpful. Launching
a discourse on whether or not color displays can be
standardized and whether C++ should or should not
attempt to address the issue did not seem useful to the OP,
so I didn't bother to observe every facet of pedantry available
to me.
[color=blue]
> [...]
> This is support for the argument that Color isn't in the
> ANSI C++ specification.[/color]
And that's probably a good argument, but it's also a straw
man. Congratulations , Don, I think he's dead.
[color=blue]
> [...]
> Actually, referring the OP to a newsgroup that discusses
> his/her platform is more helpful.[/color]
And would be possible if I knew what his/her platform was.
Giving an example and then referring to a relevant Google
search seems even more helpful to me.
[color=blue]
> I still haven't found a requirement for a Window in MS
> Windows to support the ANSI Escape Sequences.
> [...][/color]
Who says the OP's platform was Windows?
[color=blue]
> [...]
> In summary, color and the use of color is not discussed
> in this newsgroup, news:comp.lang. c++, nor it brethren
> news:comp.lang. c, because it is a platform dependent
> issue.[/color]
And yet you and Mr. "Attila" have managed to discuss it
at some length. You, in particular, have offered far more
information on color than anyone asked for. While it
makes for an interesting read, it hardly puts you in a position
to argue for topical posts.
"Kevin Goodsell" <usenet1.spamfr ee.fusion@never box.com> wrote in message
news:1l6bb.535$ vS.163@newsread 3.news.pas.eart hlink.net...[color=blue]
> [...][color=green]
> > In fact, I would say that c.l.c++.m is better-
> > moderated than this group,[/color]
>
> Brilliant observation, seeing as how this group is not
> moderated.[/color]
Not in the formal sense, but in practical terms, this group is
more heavily moderated than many I've seen. It's just that
the "moderators " don't have the power to block or cancel
messages.
[color=blue]
> [...]
> Off-topic posts (and people like you who seem to think
> we should expand the group to deal with anything and
> everything)[/color]
I never once said that the group should be expanded. I
answered a question and gave a half-hearted justification
for doing so. How that translates into blowing the doors
off the newsgroup and letting in the unwashed masses is
something that can only be fathomed by the minds of the
newsgroup gestapo, I suppose.
[color=blue]
> make the group less useful *because* they take so much
> energy that would otherwise be spent helping people with
> C++ problems.[/color]
In my experience, people who are not helped go away.
In my opinion, telling every off-topic poster that he's off-
topic, instead of merely failing to answer the question
doubles the amount of noise on the group.
[color=blue]
> What is the point of having a topic at all if we don't stick
> to it?[/color]
The problem is that topics are not defined with a sharp
boundary. Some topics are more relevant than others.
What people consider topical depends at least partly on
subjective values, even if the topic as a whole is fairly
clear.
[color=blue]
> It's what we're good at. There are other people in other
> groups who are good at other things. If we allowed every
> topic under the sun, we wouldn't be able to help anyone.[/color]
Yes, but you can't really "disallow" off-topic posts, so I
don't really see the utility of spending bandwith to say:
"That's off-topic". Many of the people who post off-topic
messages do so as a first question anyway (and haven't
read anything that would tell them their question is off-topic),
and thus they are unlikely to be deterred by such posts.
People who actually read other posts and would be likely to
see such "moderating " messages are already more likely to
post only relevant topics anyway. That's why I don't
understand the zeal to moderate an unmoderated group.
[color=blue]
> [...]
> You are wrong. We would be perfectly happy if the off-
> topic posts would stop so we could discuss the topic we
> come here to discuss. That's precisely why we enforce
> topicality rules.[/color]
But you don't enforce them. You only post annoying
messages about off-topic posts. Frankly, I'm more
annoyed by the large number of such messages than I
am by the off-topic posts. The people who start off-topic
threads usually only post once and go away, never
having learned their lesson and unlikely to learn it. The
ones who post topicality messages apparently have not
learned that such people are not going to be deterred,
because you can't get at them before they decide to post.
[color=blue]
> [...]
> Basic Usenet etiquette covers that. And if people want to
> ignore etiquette, why should we help them?[/color]
You shouldn't. But why should you waste so much effort
flogging people who do? Do you *really* think you are
increasing the s/n ratio by your actions?
[color=blue]
> [...]
> Because off-topic posting is NOT helpful. It's rude and
> disruptive.[/color]
Which is what I would call this meta-thread.
[color=blue]
> You complain about people not getting helped, yet you
> want to open the group up to questions that 1) we aren't
> well-equipped to answer and 2) will increase the already
> high traffic, making it more difficult for anyone to get a
> question answered? How would that help anyone?[/color]
Again, I never said that I want to "open the group up to
[off-topic] questions". When I complained abut people
not getting help, it was because the newsgroup cops were
offering information that may be technically correct, but
not useful to the person asking the question. I don't give
a rip if people don't respond to off-topic posts. In fact,
I expect that as the status quo. But if they *do* respond,
it seems it would be more useful for everyone if they
gave a *helpful* response rather than a pedantic response
with questionable practical benefit.
David B. Held wrote:
[color=blue]
>
>[color=green]
>>[...]
>>Off-topic posts (and people like you who seem to think
>>we should expand the group to deal with anything and
>>everything)[/color]
>
>
> I never once said that the group should be expanded. I
> answered a question and gave a half-hearted justification
> for doing so. How that translates into blowing the doors
> off the newsgroup and letting in the unwashed masses is
> something that can only be fathomed by the minds of the
> newsgroup gestapo, I suppose.[/color]
(I don't want to turn this into a flame war. Sorry if my previous
message was overly harsh.)
Off-topic answers are, in many ways, worse than off-topic questions. We
want to discourage off-topic questions, not encourage them. Also,
answers posted on this group are expected to be standard and portable. A
non-standard solution has a good chance of being taken for a standard
solution.
[color=blue]
>
> In my experience, people who are not helped go away.
> In my opinion, telling every off-topic poster that he's off-
> topic, instead of merely failing to answer the question
> doubles the amount of noise on the group.[/color]
In may experience, people who are not helped ask their question again.
Sometimes people who *are* helped do.
You are right that off-topic redirection messages make up too many of
the posts here. But the goal is to solve the problem of off-topic
posting. People who are scolded for being off topic aren't likely to
make the same mistake again (here or elsewhere, hopefully). People who
are about to be off-topic may even notice the scolding of someone else
and refrain from posting their off-topic message.
I don't think the solution is to ignore the messages. I definitely think
answering off-topic questions in counter-productive. I also think that
being rude is often counter-productive, but I don't blame regulars for
being frustrated with the volume of OT posts, or the lack of etiquette
of the people posting the OT messages.
A polite but firm redirection is the best solution, IMHO.
[color=blue]
>
>[color=green]
>>What is the point of having a topic at all if we don't stick
>>to it?[/color]
>
>
> The problem is that topics are not defined with a sharp
> boundary. Some topics are more relevant than others.
> What people consider topical depends at least partly on
> subjective values, even if the topic as a whole is fairly
> clear.[/color]
I find that the group is not completely inflexible, and not always in
agreement about what is topical. Messages that are borderline topical
often get ignored by the "OT police" or replied to with a, "Well, this
isn't strictly topical, but..." I don't think there's really a problem
here. The general topic is clear. Borderline topics don't usually invoke
the wrath of the pseudo-mods. I think this arrangement is OK.
[color=blue]
>
>[color=green]
>>It's what we're good at. There are other people in other
>>groups who are good at other things. If we allowed every
>>topic under the sun, we wouldn't be able to help anyone.[/color]
>
>
> Yes, but you can't really "disallow" off-topic posts, so I
> don't really see the utility of spending bandwith to say:
> "That's off-topic". Many of the people who post off-topic
> messages do so as a first question anyway (and haven't
> read anything that would tell them their question is off-topic),[/color]
This is the problem. These people need to learn some netiquette.
[color=blue]
> and thus they are unlikely to be deterred by such posts.
> People who actually read other posts and would be likely to
> see such "moderating " messages are already more likely to
> post only relevant topics anyway. That's why I don't
> understand the zeal to moderate an unmoderated group.[/color]
The goal is to keep the noise minimal, as well as maintain the topic of
the group (by preventing topic drift). I don't think there's a better
option. I don't believe "ignore it and it will go away" will work here.
[color=blue]
>
> But you don't enforce them. You only post annoying
> messages about off-topic posts. Frankly, I'm more
> annoyed by the large number of such messages than I
> am by the off-topic posts. The people who start off-topic
> threads usually only post once and go away, never
> having learned their lesson and unlikely to learn it. The
> ones who post topicality messages apparently have not
> learned that such people are not going to be deterred,
> because you can't get at them before they decide to post.[/color]
We do the best we can. Sorry if it annoys you. I don't believe leaving
people to go post off-topic messages somewhere else is the way to handle
OT posters. Another problem is that all the off-topic messages make this
group show up in Google searches for things that are completely
off-topic here. We've had people say "I thought this would be a good
place to ask because when I put [some search terms] into Google, this
group came up." Besides that, emphasizing the topic increases the
chances that people will notice that their question is not topical
before they post.
[color=blue]
>
>[color=green]
>>[...]
>>Basic Usenet etiquette covers that. And if people want to
>>ignore etiquette, why should we help them?[/color]
>
>
> You shouldn't. But why should you waste so much effort
> flogging people who do? Do you *really* think you are
> increasing the s/n ratio by your actions?[/color]
Well, I don't flog. (At least, not lately. I may have done so in the
past.) I politely redirect. I even say "please".
[color=blue]
>
>[color=green]
>>[...]
>>Because off-topic posting is NOT helpful. It's rude and
>>disruptive.[/color]
>
>
> Which is what I would call this meta-thread.[/color]
At least it's topical.
[color=blue]
> Again, I never said that I want to "open the group up to
> [off-topic] questions". When I complained abut people
> not getting help, it was because the newsgroup cops were
> offering information that may be technically correct, but
> not useful to the person asking the question.[/color]
It is useful. It helps them figure out what the scope of the language
is, and where the best place to get help for question outside that scope
is (or at least, where it is *not*).
[color=blue]
> I don't give
> a rip if people don't respond to off-topic posts. In fact,
> I expect that as the status quo. But if they *do* respond,
> it seems it would be more useful for everyone if they
> gave a *helpful* response rather than a pedantic response
> with questionable practical benefit.[/color]
Off-topic replies are part of the problem, not part of the solution.
I'm afraid the off-topic redirections come with the territory here. I'm
sorry if you don't like them, but they aren't going to go away unless
(miraculously) the OT posting stops.
-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.
ducktheresaflyi ngfish@yahoo.co m (Dom) wrote in message news:<5669b993. 0309190242.7006 0d2b@posting.go ogle.com>...[color=blue]
> can someone please help me display text in the console
>
> cout << "Testing";
>
> in a different colour to the default one[/color]
Dom........
A lot of techno going on here.......Try this
#include <iostream>
#include <conio.c> // for getch(); & clrscr();
using namespace std;
void printat(int ,int , char *);
int main()
{
clrscr();
textcolor(12); //sets text color
textbackground( 9 ); //sets text background
cout <<" Here we go !! \n\n"; //colored printf
getch();
textcolor(12+BL INK); //uses blinking
textbackground( 1);
cout <<" And One more time !\n\n";
getch();
textcolor(14+BL INK);
textbackground( 13);
cout << " Look out for another color \n\n";
printat(24,70," Teeyester");
getch();
}
//0 BLACK
//1 BLUE
//2 GREEN
//3 CYAN
//4 RED
//5 MAGENTA
//6 BROWN
//7 LIGHTGRAY
//8 DARKGRAY
//9 LIGHTBLUE
//10 LIGHTGREEN
//11 LIGHTCYAN
//12 LIGHTRED
//13 LIGHTMAGENTA
//14 YELLOW
//15 WHITE
..........code came from planet source code, so I still haven't figured
out the blinking part(maybe API or something) but the original
question was how to get color in text in DOS without API's
Comment