textmode
Puts screen in text mode.
Defined in header <conio.h>
Syntax
#include <conio.h>
void textmode(int newmode);
Portability
| DOS | UNIX | Windows | ANSI C | C++ 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:
| Symbolic | Numeric | |
| constant | value | Text mode |
| LASTMODE | -1 | Previous text mode |
| BW40 | 0 | Black and white, 40 columns |
| C40 | 1 | Color, 40 columns |
| BW80 | 2 | Black and white, 80 columns |
| C80 | 3 | Color, 80 columns |
| MONO | 7 | Monochrome, 80 columns |
| C4350 | 64 | EGA 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 LASTMODE | to 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.
Stable link: /3.1/conio.h/textmode/
· short form /3.1/textmode/