home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / pclcjs.zip / TEXTBOX.C < prev    next >
C/C++ Source or Header  |  1992-12-21  |  812b  |  25 lines

  1. /* text_box library function copyright 1991 by Chuck Steenburgh 
  2.    This function fills a box defined by r1,c1,r2,c2 with
  3.    character "fill" and attribute "color".  Works in text mode.
  4.    
  5.    Returns:   0 if box successfully drawn and filled             
  6.               1 if passed invalid parameter                      */
  7.  
  8. #include <bios.h>
  9.  
  10. int text_box(int r1,c1,r2,c2,fill,color,max_rows)
  11.  
  12. {
  13.      int counter;
  14.      
  15.      /* Check for valid row/column positions, fill character, and attribute */
  16.      if (r1<0 || r1>r2 ||  r2>max_rows || c1<0 || c1>c2 || c2>79 || fill<0 || fill>255 || color<0 || color>255)
  17.           return 1;
  18.  
  19.     /* Place fill on screen */
  20.      for (counter=r1;counter<r2+1;counter++) {
  21.           poscurs(counter,c1);
  22.           writechs(fill,color,c2-c1+1);
  23.      }
  24. }
  25.