home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / lib / r_la4_01 / cfill.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-23  |  827 b   |  27 lines

  1. /* CFILL.C - From page 354 of "Microsoft C Programming for      */
  2. /* the IBM" by Robert Lafore. Uses C putch() function to        */
  3. /* fill the screen. To quit, enter X. The DOS file ANSI.SYS     */
  4. /* must be on disk and accessable in your path and must be in   */
  5. /* your CONFIG.SYS file as:  device = ANSI.SYS for this pro-    */
  6. /* gram to work.                                                */
  7. /****************************************************************/
  8.  
  9. #define ROMAX 25
  10. #define COMAX 80
  11. #define CLEAR "\x1B[2J"
  12.  
  13. main()
  14. {
  15. int col, row;
  16. char ch;
  17.  
  18.    printf("\nType character to start, another to change, X to exit.");
  19.    while((ch = getche()) != 'X') {
  20.       printf(CLEAR);
  21.       for(row = 0; row < ROMAX; row++)
  22.          for(col = 0; col < COMAX; col++)
  23.             putch(ch);
  24.    }
  25. }
  26.  
  27.