Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!rutgers!iuvax!pur-ee!uiucdcs!bradley!brian From: brian@bradley.UUCP Newsgroups: comp.lang.c Subject: Re: Color in MSC using *printf? Message-ID: <9900001@bradley> Date: 27 May 88 21:52:00 GMT References: <14608@brl-adm.ARPA> Lines: 43 Nf-ID: #R:brl-adm.ARPA:14608:bradley:9900001:000:1277 Nf-From: bradley.UUCP!brian May 27 16:52:00 1988 > /* 7:54 pm May 25, 1988 by C03601DM%WUVMD.B@cornellc.ccs.cornell.edu */ > /* ---------- "Color in MSC using *printf?" ---------- */ > 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. We have a function that sends a string to the screen: void send(y, x, a, s) unsigned y, x; /* position */ unsigned a; /* color */ char *s; /* string */ I assume this is similar to what _outtext() does. To send a formatted string to the screen, we use something like: int w_printf(y, x, a, fmt, ...) unsigned y, x; unsigned a; char *fmt; { static char buf[512]; va_list arg_ptr; int nc; va_start(arg_ptr, &fmt); nc = vsprintf(buf, arg_ptr); va_end(arg_ptr); send(y, x, a, buf); return(nc); } ............................................................................... When the going gets weird, the weird turn pro. Brian Michael Wendt UUCP: {cepu,ihnp4,uiucdcs,noao}!bradley!brian Bradley University ARPA: cepu!bradley!brian@seas.ucla.edu (309) 677-2230 ICBM: 40 40' N 89 34' W