Borland C++ reference

textmode

raw OCR

Puts screen in text mode.

Defined in header <conio.h>

Syntax

#include <conio.h>
void textmode(int newmode);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

textmode selects a specific text mode.

You can give the text mode (the argument newmode) by using a symbohc constant from the enumeration type textjnodes (defined in conio.h). If you use these constants, you must include conio.h.

The textjnodes type constants, their numeric values, and the modes they specify are given in the following table:

SymbolicNumeric
constantvalueText mode
LASTMODE-1Previous text mode
BW400Black and white, 40 columns
C401Color, 40 columns
BW802Black and white, 80 columns
C803Color, 80 columns
MONO7Monochrome, 80 columns
C435064EGA 43-line and VGA 50-line modes

When textmode is called, the current window is reset to the entire screen, and the current text attributes are reset to normal, corresponding to a call to normvldeo.

Specifying LASTMODEto textmode causes the most recently selected text

mode to be reselected.

textmode should be used only when the screen is in text mode (pre-sumably to change to a different text mode). This is the only context in which textmode should be used. When the screen is in graphics mode, use restorecrtmode instead to escape temporarily to text mode.

Return value

None.

See also

Example

#include <conio.h>

int main (void)
{
   textmode (BW40:
   cprintf ("ABC":
   getchO  ;
   textmode (C40),
   cprintf ("ABC"
   getchO  ;
   textmode I
cprintf ("ABC");
getch( );
textmode (C80);
cprintf ("ABC");
getchO  ;
textmode (MONO);
cprintf ("ABC"),•
getch( );

return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.