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>puttext() copy text from memory to screen</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 puttext()               Copy Text From Memory to Screen

 #include <conio.h>

 int        puttext(left,top,right,bottom,source);
 int        left;
 int        top;
 int        right;
 int        bottom;
 void       *source;

    puttext() copies the contents of an area of memory pointed to by
    'source' to a rectangular screen area bordered by absolute screen
    coordinates ('left','top'), ('right','bottom').

    The number of bytes of memory needed to originally store the screen
    information is:

            #bytes = (#rows) x (#columns) x 2

    This is because each screen position takes 2 bytes of memory. (The
    first byte is the cell character and the second is the cell's video
    attribute.)

       Returns:     1, if successful. 0 is returned on failure.

   Portability:     IBM PC & BIOS-Compatables only.

   -------------------------------- Example ---------------------------------
    The following statements fill part of the screen with characters,
    store those characters in memory and put them back on the screen in a
    different place.

           #include <conio.h>

           main()
           {
               char buffr[20*10*2];
               int x, y;

               for (y = 0; y < 9; y++) {
                    for (x = 0; x < 19; x++)
                         printf("d");
                    printf("\n");
               }
               gettext(1,1,20,10,buffr);
               getch();
               clrscr();
               puttext(30,12,49,21,buffr);
           }


See Also: gettext() movetext()

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