home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / arexx / spooler.lha / File4 < prev    next >
Encoding:
Text File  |  1988-09-24  |  1.9 KB  |  63 lines

  1. /*---------------------------- Start REXX Source ----------------------------*/
  2.  
  3. /*   *********************************/
  4. /*   * Print spooler utility program */
  5. /*   *      using ARexx v1.06       */
  6. /*   *            by               */
  7. /*   *         Dan Schenck        */
  8. /*   *          22-SEP-88        */
  9. /*   *            v 1.00        */
  10. /*   ***************************/
  11.  
  12. copy_dir = "vd0:"
  13. copy_cntl = "rexx:spooler.copydir"
  14. text = center("Enter Spooler Directory",35) || "\" || center("or CANCEL to ""Copy-In-Place""",35)
  15. address command
  16. arg task .
  17.  
  18. select
  19.   when task = "INSTALL" then
  20.     do
  21.       do until(copy_dir ~= "")
  22.         name = request(200,200,text,copy_dir,"OKAY","CANCEL")
  23.         if name = "" then
  24.           copy_dir = "IN-PLACE"
  25.         else if exists(name) then
  26.           do
  27.             if left(statef(name),1) = 'D' then
  28.               copy_dir = name
  29.             else
  30.               copy_dir = ""
  31.           end
  32.              else copy_dir = ""
  33.       end
  34.       call get_file_separator
  35.       last_chr = right(copy_dir,1)
  36.       if (last_chr ~= ":" & last_chr ~= "/") then copy_dir = copy_dir || "/"
  37.       'delete' copy_cntl || " quiet"
  38.       call open('out',copy_cntl,'Write')
  39.       call writeln('out',copy_dir)
  40.       call writech('out',cc)
  41.       call close('out')
  42.       'newcli' "CON:0/20/400/100/SPOOLER rexx:spooler.cntl"
  43.     end
  44.   when (task = "KILL" | task = "EXIT" | task = "QUIT") then
  45.     address "SPOOLER" "EXIT"
  46.   when task = "NEWSEPARATOR" then
  47.     do
  48.       call get_file_separator
  49.       cc = translate(cc,'15'X,' ')
  50.       address "SPOOLER" "NFS" cc
  51.     end
  52.   otherwise
  53.     say 'Invalid operation "' || task || '" requested of Spooler_Utility'
  54. end
  55. exit(0)
  56.  
  57. get_file_separator: procedure expose cc
  58.   cc = '/f'
  59.   cc = request(200,200,'Enter File Separator String\CANCEL = Form Feed\/n = NewLine\/f = Form Feed',cc,"OKAY","CANCEL")
  60.   if cc = "" then cc = '/f'
  61.   return
  62. /*----------------------------- End REXX Source -----------------------------*/
  63.