[net.micro.pc] Setting colors in C

gold@aecom.UUCP (Yosef Gold) (04/22/85)

    I recieved many responses to my query about setting character 
colors from C (lattice).  All the responses suggested  using  the
ansi.sys  device  driver,  and setting the colors by printing the
appropriate escape characters.  If anyone knows  of  any  way  to
easily  accomplish  this  (without  using  the dos call, which is
limited to one char at a time and won't  handle  integers  unless
they are sprintf'ed to a string) I am still interested in hearing 
it.  

        On a different subject, I  just  saw  an  ad  for  Norton
Utilitys  3.0  At the bottom had a little note there was a little
note about upgrades.  It said that upgrades are $25  ,  and  then
follwing  that  there  was  one  more  little note.  It offered a
registered legal copy to all pirates who send  in  their  pirated
copies for the same $25 as the upgrade fee.  

I just thought it was intersesting.
-- 
Yosef Gold
...{philabs,cucard,pegasus,ihnp4,rocky2}!aecom!gold

kevinp@mmintl.UUCP (Kevin Piette) (04/30/85)

The following paraphrased from origional context :
'Does anyone know of an easy way to set character colors from Lattice C
programs using ANSI.SYS?... ...the DOS call only outputs one character
at a time... ...would appreciate hearing of a better way...'

I have written applications in Lattice C which rely upon ANSI.SYS to
provide cursor addressing and attribute selection for displayed text.
Within these applications I simply use printf.  Below is an example of
a Lattice C statement to set the foreground attribute to cyan.

#define ESC	0x1B
...
	printf("%c[36m", ESC);

This approach was chosen to provide MS-DOS portablility provided the
target system has an ANSI.SYS device driver.  There are other methods
which enable faster display output at the cost of portability.
--
Kevin Piette					Phone: (203) 522-2116
Multimate International Corporation, Research & Development
UUCP: ...!seismo!cmcl2!philabs!pwa-b!mmintl!kevinp