[Tutor] colored text output to Windows console

Alan Gauld alan.gauld at blueyonder.co.uk
Sat Feb 28 03:55:15 EST 2004


> I have written a text mode game that keeps track of 3 lists. I would
like for
> the output of the game to use colors to make it easier for the user
to read the
> text. Kind of like what is seen on an ANSI BBS.
>
>  From my initial research, it seems this impossible to do in a
Windows 'DOS box'.

It is possible but the user must load the ANSI.SYS device driver,
usually in the CONFIG.SYS file. This allows you to embed standard ANSI
codes into your print
strings and thus change the colours(16 possible) and attributes(bold,
underline
etc).

In the days of Windows, editing CONFIG.SYS is probably too much to ask
users so either you need to create an "installer" that does it for
them
or write a simple GUI wrapper round your console mode code.

Alan G





More information about the Tutor mailing list