Borland C++ reference

textbackground

raw OCR

Selects new text background color.

Defined in header <conio.h>

Syntax

#include <conio.h>
void textbackgroimdCint newcolor);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

textbackground selects the background color. This function works for functions that produce output in text mode directly to the screen, nezvcolor selects the new background color. You can set nezvcolor to an integer from 0 to 7, or to one of the symbolic constants defined in conio.h. If you use symbolic constants, you must include conio.h.

Once you have called textbackground, all subsequent functions using direct video output (such as cprintf) will use nezvcolor. textbackground does not affect any characters currently onscreen.

The following table lists the symbolic constants and the numeric values of the allowable colors:

Symbolic constantNumeric value
BLACK0
BLUE1
GREEN2
CYAN3
RED4
MAGENTA5
BROWN6
LIGHTGRAY7

Return value

None.

See also

Example

include  <conio.h>

int main(void)
{
   int i, j;
   clrscrO ;
   for (i=0; i<9; i++)  {
       for  (]=0; j<80; j++)
         cprintf ("C"),•
       cprintf ("\r\n");
       textcolor (i+1);
       textbackground (i);
   ,}
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.