home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / fax067.zip / fqueue.cmd < prev    next >
OS/2 REXX Batch file  |  1996-11-29  |  4KB  |  85 lines

  1. /* faxqueue.cmd   Ver. 1.0    18-10-1995 */
  2. /* Run it from FREC ClPageOk fqueue.cmd or afterwards from cmd-line */
  3.  
  4. /********************< B E G I N - S E T U P >*******************************/
  5. /* 
  6.    This is the Setuppart. I hope it is not too difficult for you to
  7.    declare 4 Directoryvar's ;-) . Leading and trailing " ' "  are needed,
  8.    so don't forget them.
  9. */
  10.  
  11. FaxInBound = 'D:\bound\fax'                        /* Here we store the      */
  12.                                                    /* faxes received by FREC */
  13. FaxSpec    = 'FX*.FAX'                             /* Filemask for faxes     */
  14. FaxStore   = 'D:\bound\fax\printed'                /* Here we store printed  */
  15.                                                    /* faxes                  */
  16. FRECDir    = 'D:\cl2\addon\frec'                   /* Where we find FREC     */
  17.  
  18. /*******************< E N D - S E T U P >*************************************/
  19.  
  20.  
  21. '@echo off'
  22. CALL RXFUNCADD 'SYSLOADFUNCS','REXXUTIL','SYSLOADFUNCS'
  23. CALL SYSLOADFUNCS
  24. say ''
  25. say '  ┌───────────────────────────────────────────────────────────────╖'
  26. say '  │ F A X - Q U E U E  (c) 1995 by Lutz Buchheister (2:240/5304)  ║░'
  27. say '  │ Version 1.0                                                   ║░'
  28. say '  │───────────────────────────────────────────────────────────────║░'
  29. say '  │ FREC/2 is by Harald Pollack (2:310/14.59)                     ║░'
  30. say '  ╘═══════════════════════════════════════════════════════════════╝░'
  31. say '    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░'
  32. say ' '
  33. homedir=directory()
  34. call directory(FaxInBound)
  35. call SysFileTree FaxSpec, 'fqueue', 'F'
  36.  
  37. /* Anybody home ? */
  38.  
  39. if fqueue.0 = 0 then 
  40. do
  41.   say ' '
  42.   say 'Faxqueue is empty, nothing to do ! Exiting now ....'
  43.   call directory(homedir)
  44.   EXIT
  45.   RETURN()
  46. END  
  47.  
  48. /* Display FAX-Queue on screen */
  49.  
  50. Do i= 1 to fqueue.0
  51.  fxname.i=subword(fqueue.i,5,1)
  52.  fxattr.i=subword(fqueue.i,4,1)
  53.  fxsize.i=subword(fqueue.i,3,1)
  54.  fxtime.i=subword(fqueue.i,2,1)
  55.  fxdate.i=subword(fqueue.i,1,1)
  56. END
  57. Say 'Set  Faxname                         Date    Time     Size    Attrib'
  58. Say '─── ────────────────────────────── ──────── ─────── ──────── ───────'
  59. Do i= 1 to fqueue.0                                                 
  60.  say right(i,3)  left(fxname.i,30)  fxdate.i  right(fxtime.i,6)  right(fxsize.i,8) right(fxattr.i,7)
  61. End                                                                 
  62. Say' '                                                              
  63.                                                                     
  64. /* Wait to see what's in */                                         
  65. call syssleep 5                                                     
  66.                                                                     
  67. /* Let's print the queue */                                         
  68.                                                                     
  69. call directory(frecdir)                                             
  70. do i= 1 to fqueue.0                                                 
  71.   Say 'Pushing Fax #'i '-> 'fxname.i 'into PM-Printerqueue'         
  72.   'faxview -PRINT -b'||fxname.i                                     
  73.   if rc <>0 then Say 'Something strange happend...'                 
  74.     Else Say ' Printing ' fxname.i                                  
  75.   Say '  Copying ' fxname.i 'to printed fax storage !'              
  76.   'copy 'fxname.i  faxstore ' >nul'                                 
  77.   if rc=0 then  'del 'fxname.i '/N'                                 
  78.    else say 'Error copying 'fxname.i 'to' faxstore                  
  79.   Say ' '                                                           
  80. End                                                                 
  81.                                                                     
  82. call directory(homedir)                                             
  83. call SysDropFuncs                                                   
  84. Return                                                              
  85.