Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!elroy!spl1!laidbak!daveb From: daveb@laidbak.UUCP (Dave Burton) Newsgroups: comp.lang.c Subject: Re: Color in MSC using *printf? Message-ID: <1458@laidbak.UUCP> Date: 26 May 88 14:12:33 GMT References: <14608@brl-adm.ARPA> Reply-To: daveb@laidbak.UUCP (Dave Burton) Organization: is pretty bad/My method of Lines: 20 In article <14608@brl-adm.ARPA> C03601DM%WUVMD.BITNET@cornellc.ccs.cornell.edu (Derek Morgan) writes: |Has anybody gotten printf,(c-,v-,-f) to produce colors inside of MSC 5.0? I |can get color text by using _outtext, but _outtext doesn't have formatting |capabilities. To use ANSI.SYS is cheating, because not everybody has DEVICE= |ANSI.SYS in their config.sys file. Nocando. Printf() as implemented by MS uses DOS calls to allow I/O redirection. The DOS interrupt functions will eventually use a BIOS call 'wrtty' I think (int 0x10, func 0x14?). Anyway, allowing color info in the stream would hinder the usefulness of redirection. You may want to use sprintf() first, then use _outtext() to dump it in color. If you could devise a decent enough parameter list, perhaps even write a wrapper printf that did what you wanted. I once wrote a high-performance PC screen management library, but used MASM for the lowest level (replacing the BIOS routines). The first motivation for this was because I couldn't get printf() to output color info. The second motivation was because printf() (in MSC4.0) was slooooow. As for portability, I only cared about true blue and 100% compatibles. You may also want to do the same, depending upon your circumstances.