[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

876.0. "CLI Print Spooler" by OASIS2::BERNARD (Have Gun - Will Travel) Thu Nov 05 1987 20:16

             SPOOLER.TXT         CLI Print Spool Utility


This simple print spool utility was DL from PLINK, file SPOOLER.TXT.  This 
print spooling utility was provided by Andy Finkel of CBM-Amiga in the
first issue of 'Amiga Mail', a newsletter for developers.  It was modified by
Larry Phillips to add the TOF (top of form) option.  I modified it again
to redirect the files to utilize both RAM: and VD0: and currently use it on
my system.  I utilize this method due to the minimal amount of memory it uses,
since I have the commands in VD0: anyway.



SETTING UP THE SPOOLER

 
Put SPOOL, PRINT, SPOOLER into the S: subdirectory on your WorkBench or CLI 
disk.
 
   Make a 'TOF' file as follows:

     TYPE * TO SYS:S/tof
      enter a ^L  (hold CTRL key and press the L key)
      enter a ^\  (hold CTRL key and press the backslash key)

     Unfortunately, this will give you a file with one more character than
     you might expect. Its contents will be $0C0A, rather than just $0C.
     If you have a file editor such as FILEZAP, just use it to change the
     contents to $000C. The nulls will be ignored when sent to the printer.
 
Enter the command:  RUN EXECUTE SPOOL

     This will start up a CLI and execute the first file, and needs to be
     done only once.
 

   There are two ways to use the spooler.
 
     1. EXECUTE PRINT filename
        This one will automatically copy the named file to an appropriate
        spool file (one that is not in use), and the spooler running in the
        background will take care of actually printing it.
 
     2. COPY any file to the appropriate spool file from any program.


                            **** NOTE *****

        After the spooler is done printing the files, it will delete the file
        from RAM:.  This is done to free up the spool file name for the next
        file.  THESE ARE TEMPORARY FILES ONLY.

        The files currently used are  SPOOL1  SPOOL2  SPOOL3

        You can change the command files SPOOLER and PRINT to increase the
        number of files that can be spooled.


 
HOW IT WORKS:
 
   SPOOL
     Copies the needed commands to VD0: in order to allow it to run
    without you having to put the WorkBench or CLI disk into the drive
    every time you want to print.
    It also creates a 't' subdirectory to hold the TOF file. Then, it executes
    'SPOOLER', which is the one that does all the real work.
 
   SPOOLER
     Checks RAM: for the existence of a file called SPOOL1, SPOOL2, or SPOOL3.
    If one of these files exists, it is sent to the PRT: device, and is then
    deleted, leaving that name free to be used again. It then checks for the
    existence of the next file and so on. When it finds nothing further to
    print, it will wait 30 seconds and try again by calling itself.  The wait
    time can be changed in the command file SPOOLER.  Be careful not to make
    the time too short.  It may affect the performance of you system.  A time
    of 20-30 seconds seems good.
 
   PRINT
     Checks RAM: for the existence of SPOOLn files. If there is one that does
    not currently exist, it will copy the named file to the appropriate spool
    file in RAM:

    If all three files exist, it will print a message telling you the spooler
    is busy. Once the named file is copied to a spool file, the SPOOLER takes
    over as above, and prints the file.
 


;SPOOL       CLI Print Spool Utility   To start:  RUN EXECUTE SPOOL
;              
;            Also requires  SPOOLER and PRINT  command files
;            TOF  file optional         
;            See  SPOOLER.TXT for full info
 
if not exists VD0:c
 makedir VD0:c
 copy c:copy VD0:c
 copy c:delete VD0:c
 copy c:echo VD0:c
 copy c:execute VD0:c
 copy c:wait VD0:c
 copy c:quit VD0:c
 copy c:run VD0:c
 copy c:if VD0:c
 copy c:endif VD0:c
 copy c:skip VD0;c
endif

 path VD0:c add
 
if not exists VD0:t
 makedir VD0:t
 copy s:tof VD0:t
endif

copy s:spooler VD0:c

RUN > NIL: quit +
execute VD0:c/spooler          ; execute...wait...execute...wait...etc. 
                               ;            30               30


; SPOOLER      Checks RAM for existance of SPOOL files and prints them
;              if they exist.  Spool files are deleted after printing. 

 if exists RAM:spool1
  copy > NIL: RAM:spool1 to prt:
  copy > NIL: VD0:t/tof to prt:
  delete RAM:spool1
 endif
 
 if exists RAM:spool2
  copy > NIL: RAM:spool2 to prt:
  copy > NIL: VD0:t/tof to prt:
  delete RAM:spool2
 endif
 
 if exists RAM:spool3
  copy > NIL: RAM:spool3 to prt:
  copy > NIL: VD0:t/tof to prt:
  delete RAM:spool3
 endif
 
 wait 30
 
 RUN > NIL: quit +
 execute VD0:c/spooler 




.key file/a             ; Note: This MUST be FIRST line in command file

; PRINT       Print command file for SPOOLER utility
; 

if not exists ram:spool1
 copy <file> to ram:spool1
skip
endif
 
if not exists ram:spool2
 copy <file> to ram:spool2
skip
endif
 
if not e|ists ram:spool3
 copy <file> to ram:spool3
skip
endif

ECHO " "
ECHO "Maximum number of files (3) already SPOOLED..."
ECHO "Please try again later..."
ECHO " "

LAB
 
T.RTitleUserPersonal
Name
DateLines