Color in MSC using *printf?
brian at bradley.UUCP
brian at bradley.UUCP
Sat May 28 07:52:00 AEST 1988
> /* 7:54 pm May 25, 1988 by C03601DM%WUVMD.B at 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 at seas.ucla.edu
(309) 677-2230 ICBM: 40 40' N 89 34' W
More information about the Comp.lang.c
mailing list