home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / PROCWRKB.ZIP / BENCH1.ZIP / PRINT / ALIGNREP.C next >
Encoding:
C/C++ Source or Header  |  1990-08-07  |  1.4 KB  |  60 lines

  1. /* ==( bench/alignrep.c )== */
  2.  
  3. /* ----------------------------------------------- */
  4. /* Pro-C  Copyright (C) 1988 - 1990 Vestronix Inc. */
  5. /* Modification to this source is not supported    */
  6. /* by Vestronix Inc.                               */
  7. /*            All Rights Reserved                  */
  8. /* ----------------------------------------------- */
  9. /* Written   Nig   1-Jan-87                        */
  10. /* Modified  Geo   4-Oct-89  See comments below    */
  11. /* ----------------------------------------------- */
  12. /* %W%  (%H% %T%) */
  13.  
  14. /*
  15.  *  Modifications
  16.  *
  17.  *   4-Nov-89  Geo - V2 version
  18.  *  25-Oct-89  Geo - 1.32 Merge
  19. */
  20.  
  21. # include <stdio.h>
  22. # include <bench.h>
  23. # include <prt.h>
  24.  
  25. /* Function prototypes */
  26. static PROTO (void dsp_col, (int, int));
  27.  
  28. /*
  29.  * Helps user to align report stationary
  30.  * with printer top of form
  31. */
  32. void align_report(replen, repwidth)
  33. int  replen, repwidth;
  34. {
  35.     int i;
  36.  
  37.     underln_p(1, 1, P_NORMAL, repwidth);
  38.     center_p(1, 1, P_BOLD, repwidth, " TOF ");
  39.  
  40.     for(i = 0; i < repwidth; i++)
  41.         dsp_col(3, i + 1);
  42.  
  43.     underln_p(replen, 1, P_NORMAL, repwidth);
  44.     center_p(replen, 1, P_BOLD, repwidth, " BOF ");
  45.  
  46.     flushprt();
  47.     clear_p();
  48. }
  49.  
  50. static void dsp_col(line, col)
  51. int line, col;
  52. {
  53.     char colstr[5];
  54.     int ctr;
  55.  
  56.     sprintf(colstr, "%3d", col);
  57.     for(ctr = 0; ctr < 3; ctr++)
  58.         poke_p(line + ctr, col, P_NORMAL, colstr[ctr]);
  59. }
  60.