home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR16 / SPOOLAQ.ZIP / SPOOL.DOC next >
Text File  |  1993-06-12  |  4KB  |  96 lines

  1. SPOOL.DOC
  2.  
  3. The file SPOOL.EXE contains the following files:
  4.         - SPOOL1.PAS
  5.         - SPOOL2.PAS
  6.         - SPOOLER.PAS
  7.         - SPOOL.DOC        this file
  8.  
  9. I want to give some hints what this file and the code is intended for.
  10.  
  11.  
  12. Copyrights, disclaimer and warnings
  13. This file contains demo-programs which are based on TVGUID15.PAS.
  14. These are copyright Borland International.
  15.  
  16. The file SPOOLER.PAS is developed by me and presented to the public domain.
  17. Feel free to use and/or modify it. But everything is your own risk!
  18.  
  19.  
  20. Describing the problem
  21. The starting point for everything was a time-consuming printout.
  22. It would be nice if this process could be done in a way which allowed the
  23. user to do some other work and keeps the printing-process going on.
  24. So there must be a way to do this in the background.
  25.  
  26. Steve Schafer gave the tip to look for the Idle-method every application
  27. has. To realize this and to check, how often Idle is called, the program 
  28. SPOOL1.PAS was developed. In the upper right corner it shows (approx.) the
  29. number of times Idle is called within a second. You can also do some
  30. entering of data or scrolling through text. This should show how fast a
  31. print-process could be done. 
  32. Experimenting showed that values between 2000 and 15000 occurred. So one can
  33. output between 2000 and 15000 characters per second, if the printer is able
  34. to handle this amount of data.
  35.  
  36.  
  37. The SPOOLER-unit
  38. To develop a spooler it should do the following things:
  39.         - send a file to a printer on a character by character base
  40.         - support almost any port for printer-connection
  41.         - print via direct hardware-acces or via DOS-calls
  42. This is realized in SPOOLER.PAS, which -I think- is documented good enough
  43. to explain the details.
  44.  
  45.  
  46. The test: using the spooler
  47. The program SPOOL2.PAS contains some more code to do the following things:
  48.         - enter the name of the file to be printed
  49.         - select the port
  50.         - enter more necessary data
  51. You can reach this dialog via File/Start Spooling.
  52.  
  53.  
  54. What the demo SPOOL2.PAS not does:
  55. This dialog does _not_ contain code to make the selection of the 
  56. filename comfortable. It does not check the existence of the file.
  57.  
  58. You can output only one file. The second call to the dialog for
  59. entering another filename results in a messagebox saying that this could
  60. not be done. It's only a demo.
  61.  
  62. You have to wait until the print-process has finished. Leaving the program
  63. before this happened stops the printing without any warnig.
  64.  
  65.  
  66. What the SPOOLER-unit not does:
  67. The SPOOLER-unit does not contain any printer specific-code. So it does
  68. not convert data to a specific printer. The contents of the file for the
  69. entered filename will be copied byte for byte to the printer. Therefore it
  70. must contain all the needed ESC-codes.
  71.  
  72. In my application the unit contains code to kill the temp. spool-file
  73. after finishing the print-process. This is not done in the file SPOOLER.PAS,
  74. preserving the contents of the file! There is a hint to the line
  75. containing the code.
  76.  
  77. There is error-handling in the code of the unit but there is currently
  78. no way to inform a user that an error (like out of paper) occured.
  79.  
  80. My application also allows a user to add more printouts by
  81. following these steps:
  82.        - stop the spool-process
  83.        - append the data of the next pages to the spool-file
  84.        - start the spool-process again
  85. The code for doing this is contained in SPOOLER.PAS, but the demo
  86. does not support this.
  87.  
  88.  
  89. Next steps
  90. You may check the files and play with them. You are free to modify
  91. the code. If there are problems (with the original code naturally)
  92. post a message to me via BPASCAL or CompuServe EMail.
  93.  
  94. August Quint
  95. [100023,1545]
  96.