Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_outtext() display text at current position</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _outtext()              Display text at current position

 #include   <graph.h>

 void far _outtext( text );
  char far *text;   Text to display

    _outtext() displays the null-terminated string that text points to.
    Text display begins at the current text output position.

         Notes:     _outtext() does no formatting, in contrast to the
                    standard console I/O functions such as printf(). All
                    numeric conversions must be completed using functions
                    such as itoa(), ltoa(), ecvt(), etc. and concatenated
                    with the string that text points to before using
                    _outtext().

                    The text output position is based on character row
                    and column coordinates, and is distinct from the
                    graphics output position which is based on horizontal
                    and vertical pixel coordinates. See
                    _settextposition() for more information.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

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

    This program writes text at a new logical origin in the center of the
    display.

           #include <conio.h>
           #include <graph.h>

           char text[80] = {"<-- Logical origin"};
           char xloc[10], yloc[10];

           main()
           {
              struct xycoord xy;
              struct videoconfig config;
              short pix_row, pix_col;

              _setvideomode( _MRES4COLOR );
              _getvideoconfig( &config );

              /* shift logical origin to center of screen  */
              _setlogorg( config.numxpixels/2-1, config.numypixels/2-1);

              /* reset text position to new logical origin */
              pix_col = config.numxpixels / config.numtextcols;
              pix_row = config.numypixels / config.numtextrows;
              _settextposition( (config.numypixels/2-1)/pix_row+1,
                                (config.numxpixels/2-1)/pix_col+1 );

              /* print location of logical origin */
              _outtext( text );

              while ( !kbhit() );
              _setvideomode( _DEFAULTMODE );
           }


See Also: _settextposition() _setactivepage() _moveto()

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