home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / PRINTF.ZIP / PRINTF.CMD
OS/2 REXX Batch file  |  1990-09-06  |  896b  |  29 lines

  1. /* print file with header showing filename, */
  2. /* date and page number                     */
  3. arg fileid
  4. call lineout prn, D2C(27)||D2C(38)||D2C(108)||D2C(50)||D2C(65)
  5. pageno = 1
  6. lineno = 57
  7. do while lines(fileid) > 0
  8.      if lineno = 57 then do
  9.           if pageno \= 1 then call charout prn,d2c(12)
  10.           pageline = right('Page' pageno,80)
  11.           dateline = strip(center(date(),80),'t')
  12.           finalline = overlay(dateline,pageline)
  13.           finalline = overlay(fileid,finalline)
  14.           call lineout prn,finalline
  15.           call lineout prn,'  '
  16.           lineno = 1
  17.       say 'Printing Page' pageno
  18.           pageno = pageno + 1
  19.           end
  20.      call lineout prn,linein(fileid)
  21.      lineno = lineno + 1
  22.      end
  23. call charout prn, D2C(27)||'E' 
  24. call lineout fileid
  25. call lineout prn 
  26.  
  27.  
  28.  
  29.