[comp.lang.pascal] TurboP text color question

rmarks@KSP.Unisys.COM (richard marks) (04/08/88)

In Turbo Pascal 3.0 when I write to a CGA monitor, the output defaults
to yellow letters on a black background - regardless of what my prompt
has set the screen colors to.  How can I get Turbo to just use the
current colors?

(I know I can poke into the screen buffer and use TextColor/TextBackground
to tell Turbo what colors to use, but this is not very elegant.  Also I
do not know how to handle an EGA monitor with this technique.)

Suggestions please.

Thank you,
Richard Marks
rmarks@KSP.unisys.COM

taylorj@byuvax.bitnet (04/09/88)

I think that if you use the DOS print string routine you'll get the colors
you set in DOS.

Make your own writeln routine that uses Turbo's MsDos procedure to call
DOS function 9.  If you need more technical details, let me know--I wrote
a similar routine once just for fun.

Another thought..., if you assign a text file to 'con' and write to the
text file, that might do it too.

Jim Taylor
Microcomputer Support for Curriculum, Brigham Young University
taylorj@byuvax.bitnet