Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>textmode() set screen to text mode</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 textmode()              Set Screen to Text Mode

 #include   <conio.h>

 void       textmode(mode);
 int        mode;

    textmode() sets the screen to one of the video modes available on
    your system's monitor and adapter.  The screen is initialized to a
    full-screen text window in the specified mode and is cleared of
    existing text and images.

    'mode' can be one of the following values or symbolic constants of
    enumeration type 'text_modes' defined in <conio.h>:

     Symbolic constant   Value     Text mode
     LASTMODE             -1       Previous text mode
     BW40                  0       Black & white, 40 columns
     C40                   1       Color, 40 columns
     BW80                  2       Black & white, 80 columns
     C80                   3       Color, 80 columns
     MONO                  7       Monochrome, 80 columns

    textmode(LASTMODE) selects the most recently selected text mode and
    is useful for going back to a text mode after being in a graphics
    mode.

       Returns:     Nothing.

   Portability:     IBM PC and compatibles only

   -------------------------------- Example ---------------------------------

    The following statements return the screen to text mode after using
    it in graphics mode.

           #include <graphics.h>
           #include <conio.h>

           main()
           {
               int gdriver = DETECT;
               int gmode;
               char *str = "Back in text mode.";

               initgraph(&gdriver,&gmode,"");
               arc(320,150,0,179,50);
               getch();
               closegraph();
               textmode(LASTMODE);
               gotoxy(20,20);
               cprintf("%s",str);
           }


See Also: gettextinfo()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson