[comp.lang.pascal] Change fore/background color permanently

cncst@unix.cis.pitt.edu (Christophe N. Christoff) (12/21/90)

I have a color graphics adaptor, and likes to change the DOS default
color to high intensity white over blue instead of light white over
black.   Can I do this with Turbo pascal?  TEXTCOLOR and TEXTBACKGROUND
only work within the turbo pascal programs, once the programs 
terminate, light white over black color comes back again. 
Can one provide a solution for it?

Thanx in advance.

nate@neutron.lcs.mit.edu (12/22/90)

Chris,

To make the screen blue with high intensity white, do the following:

1) include the following line in config.sys
	device=ansi.sys
assuming that the ansi.sys driver is in the root of the bootup directory.

2) include the following line in your autoexec.bat file
	echo [1;37;44m

where  is the escape character (ascii 27)

good luck,

nate liskov

p.s. check the dos 4.01 manual for more details on ansi commands

einstein@cs.mcgill.ca (Michael CHOWET) (12/28/90)

In article <73116@unix.cis.pitt.edu> cncst@unix.cis.pitt.edu (Christophe N. Christoff) writes:
>I have a color graphics adaptor, and likes to change the DOS default
>color to high intensity white over blue instead of light white over
>black.   Can I do this with Turbo pascal?  

  It'd be easier to do it right from DOS, though. Try creating a program
(in TP) that asks you for the colors you want, then based on that and
the required numbers as specified in any DOS text that discusses ANSI.SYS
have it write a batch file that contains the line:

  echo [ESC]<Attr Numbers>m

  Where the Attributes are as follows:

0	all attrs off
1	bold on
2 	faint on
3	italic on
5	blink on
6	rapid blink on
7	reverse video on
8	concealed on
30	black fore
31	red fore
32	green fore
33	yellow fore
34	blue fore
35	magenta fore
36	cyan fore
37	white fore
40	black back
41	red back
42	green back
43	yellow back
44	blue back
45	magenta back
46	cyan back
47	white back

  Then, all you need do is run the batch file (don't use the EXEC in TP,
since it'll change the colors for only the temporary command shell). Create
a batch file that'll run the program, then the batch file, then perhaps
destroy the other batch file. (Free up disk space. I know I'm *always*
short... :-)

==============================================================================
Today's message was brought to you by the letter 'S', the number 6, and

  		    =====> Einstein@cs.mcgill.ca  <====
             =====> Mike CHOWET | McGill CSUS VP External <=====

			Post back soon, now y'hear...
==============================================================================

ts@uwasa.fi (Timo Salmi) (12/28/90)

In article <1990Dec28.065520.22248@cs.mcgill.ca> einstein@cs.mcgill.ca (Michael CHOWET) writes:
>In article <73116@unix.cis.pitt.edu> cncst@unix.cis.pitt.edu (Christophe N. Christoff) writes:
>>I have a color graphics adaptor, and likes to change the DOS default
>>color to high intensity white over blue instead of light white over
>>black.   Can I do this with Turbo pascal?  
>
>  It'd be easier to do it right from DOS, though. Try creating a program
>(in TP) that asks you for the colors you want, then based on that and
>the required numbers as specified in any DOS text that discusses ANSI.SYS
:

Right.  And it is also very easy to do as a batch.  See color.bat in
/pc/ts/tsbat22.arc available by anonymous ftp from uwasa.fi.  It
changes your foreground and background colors as you wish. 

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

Donald@cup.portal.com (Donald W Randolph) (12/30/90)

About changing the default DOS colors from TP, check out David Gerrolds
PRISM utility from the December 11, 1990 PC Magazine.
	Donald@cup.portal.com

eli@smectos.gang.umass.edu (Eli Brandt) (01/02/91)

In article <1990Dec28.065520.22248@cs.mcgill.ca> einstein@cs.mcgill.ca (Michael CHOWET) writes:
>In article <73116@unix.cis.pitt.edu> cncst@unix.cis.pitt.edu (Christophe N. Christoff) writes:
>>I have a color graphics adaptor, and likes to change the DOS default
>>color to high intensity white over blue instead of light white over
>>black.   Can I do this with Turbo pascal?  
>
>  It'd be easier to do it right from DOS, though. Try creating a program
>(in TP) that asks you for the colors you want, then based on that and
>the required numbers as specified in any DOS text that discusses ANSI.SYS
>have it write a batch file that contains the line:
>
[ ANSI.SYS discussion deleted ]
If you want to permanently change DOS to use a different color, you can patch
COMMAND.COM to clear the screen differently.  Use DEBUG to search COMMAND.COM
for all INT 10 calls, CD10h.  Find the one which is CLS (where it scrolls the
screen 25 lines) and patch the byte that it loads into BH, which controls the
color.  This should work on any DOS version, even OEM and weirdo versions.

Eli