> gettext<conio.h> ~ Online tutorial

gettext


   gettext copies text from text-mode screen to memory

  Declaration:


   int gettext(int left, int top, int right, int bottom, void*destin);

 Remarks:
 gettext stores the contents of an onscreen text rectangle defined by
(left, top) and (right, bottom) into the area of memory *destin.

gettext reads the rectangle's contents into memory (and puttext puts the
stored contents into the rectangle) SEQUENTIALLY from left to right and top
to bottom.


 Return Value:


   On success,
      gettext returns 1
 
  On error, both functions return 0 (for
    example, if you gave coordinates outside
    the range of the current screen mode)

Program
#include <conio.h>

char buffer[4096];

int main(void)
{
   int i;

   clrscr();
   for (i = 0; i <= 20; i++)
      cprintf("Line #%d\r\n", i);
   gettext(1, 1, 80, 25, buffer);

   gotoxy(1, 25);
   cprintf("Press any key to clear screen...");
   getch();
   clrscr();
   gotoxy(1, 25);
   cprintf("Press any key to restore screen...");
   getch();
   puttext(1, 1, 80, 25, buffer);
   gotoxy(1, 25);
   cprintf("Press any key to quit...");
   getch();

   return 0;
}


Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: