From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: NEWBIE text question Date: Thu, 9 Jul 1998 22:20:08 -0300 Organization: University of New Brunswick Lines: 54 Message-ID: References: <35a4601e DOT 139962692 AT news> <300083F0 DOT 2C0B AT linetap DOT com> NNTP-Posting-Host: sol-alt1.unb.ca Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-900033608=:13650" In-Reply-To: <300083F0.2C0B@linetap.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime AT docserver DOT cac DOT washington DOT edu for more info. ---559023410-851401618-900033608=:13650 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 9 Jul 1998, nebo wrote: ->Mark Phillips wrote: ->> Can someone tell me how to change the foreground & background ->> color of text for a cout please? It would also be helpful to know how ->> to get the cursor move to a certain part of the screen, say row 4 ->> column 8 for example. One last thing, a way to clear the screen would ->> be nice too. thanks for your time -> Without a TSR, you can't... use cprintf() instead. -> change colour with textattr() -> and use gotoxy() for coordinates. -> That's not necessarily true. If the destination machine has "Ansi.sys" loaded in memory, then you can use colors in cout. I have included a file I called "ansi.h" which will set up the right stuff so you can do colors by calling... cout << "Hi" << AnsiColor(2) << " there."; Color values can range from 0 to 15. Endlisnis [I have a pyramid of wingyness] ---559023410-851401618-900033608=:13650 Content-Type: TEXT/PLAIN; name="ANSI.H" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Ly9Qcm9ncmFtbWVkIGJ5IFJvbGYgQ2FtcGJlbGwgKEp1bHkgMTk5OCkuDQ0K Ly9FbWFpbCBtZSBhdCBzMjU3bUB1bmIuY2EgdG8gb2J0YWluIHRoZSBvcmln aW5hbHMuDQ0KLy9UaGlzIGNvZGUgaXMgcHVibGljIGRvbWFpbiBhbmQgY2Fu IGJlIG1vZGlmaWVkIG9yIHVzZWQgaW4gYW55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