“Thread Spooling” With the Cumana QL Disk Drive Interface

Author(s): Joe Newman
Pub Details: Time Designs Magazine v3 n4 (Volume 3, Issue 4)
Date: May/June 1987
Pages: 33-34

They call it the “bargain” interface, or the “economy” interface. I prefer not to refer to it as this, because of the negative conotations of the words “bargain” or “economy”. Sure the Cumana is the cheapest disk drive interface (along with the CST) for the QL, but it is more than just a disk interface.

Before I got my first Cumana interface, I didn’t realize the power potential for this little black device. Only when I started looking through the nicely printed manual at the EXTRA COMMANDS that the interface adds to SuperBASIC, did I start to realize the Cumana’s potential. I started to examine this potential, and discovered a few very interesting things.

In this article, we’ll examine a useful and easy to use feature of the Cumana know as “Print Spooling”. Print Spooling allows you to send a file to a “spool”, which will then send all files on the spool to the printer. The printing is a background job on the QL…in other words, files print out while you still have complete control of SuperBASIC. This can save much time, especially if you have some long files to print out. You can send a file to the spool, and the file will be printing out while you are typing in some program lines! You are no longer limited to the buffer of your printer!

The example program I have made is for printing out more than one QUILL (QL Wordprocessor) file. Imagine that you have five or six letters to type, but don’t wish to wait for each letter to print out while you type the next one. To use my program, you just PRINT your letters to disk, then use my program to print out all the letters at once, at your convenience.

In order to print a file to disk, first type your article, letter, or whatever, then choose the print command in Quill (Hit F3, then P). Now hit ENTER twice only! The prompts that you press ENTER to are: Current, and Whole. Now instead of hitting ENTER for printer, type in a name (such as “letter1”), then hit ENTER. You file will now be stored on disk in the exact format as if it were printed out. In order to be able to use my print spooling program, you MUST print all files you wish to spool to disk in that manner.

Once you have completed your typing and are ready to print your letters, load my program into your QL. RUN it and the following will happen: you will be asked “Number of files to print?”. Enter the total number of files you wish to print at that time. You will then be asked “Drive to use (1 or 2)”. Enter the number of the drive your disk with the files is in. You can enter a number greater than 2 if you have more than 2 drives. Next you are warned that any file which is spooled CANNOT be removed from the spool until it prints. There is no way to stop the printing of a file unless you reset the QL. So make sure you print the right files. Now you will be asked to enter the name of the file you wish to spool. Just enter the filename itself; the drive name and extension _LIS will be automatically added (the _LIS extension is added by Quill to all files which are printed to disk). Your disk should “whir” and the printer will start printing. If your printer was off, you can still turn it on now and you will not loose any data.

Let’s now examine the program in more detail. Notice in Line 50 the FLP_EXT? This tells your Cumana interface that you wish to enable the extra commands. If this is not entered first, entering any of the extra commands will just return a bad line error report. Line 70 had the statement: DATA_USE DR$. This tells the Cumana which drive will be accessed by the spool command to find your files. DR$ will just be equal to FLP1_ or FLP2_ (or whatever drive you entered). Line 110 is the spool control…SPL N$. Yep, that’s all there is to it! The N$ is just the name of your file (with the _LIS extension added). To spool any file, just type SPL and the name of the file. The DATA_USE statement specifies which drive to access for the file. After you have entered all your file names, the printer will be printing, and the flashing red cursor will be on the screen. Yes, you can now use your QL for other purposes, even while it is printing! Try loading a new program while something is being printed…it will work fine. The only real limitation to how much can be spooled or done while spooling is being carried out, is your QL’s memory. If you have several large files being printed, you may not be able to load a new program, although you will still have control.

To check on the status of the spooled files, you can enter JOBS and a list of all your spooled files will appear on the screen in the order in which they were spooled. Suppose you send three files to be spooled: file1, file2, and file3. If file1 is currently being printed, and you decide you don’t want to print file2 and/or file3, you can remove them by typing RJOB and the number under the “Job Number” column, a comma, the number under the “Job Tag” column (after entering JOBS), another comma, and a 0. This will remove that file from the spool. The following is an example of what is displayed when JOBS is used:

JOB   TAG OWNER PRIORITY

 0     0     0     32

 1     2    10      1 SPL

 2     3     8      1 SPL

 3     4     7      1 SPL
Printer drawing
Printer drawing
20 REMark       © 10-31 1986
30 REMark BY JOSEPH NEWMAN
40 CLS
50 FLP_EXT
60 INPUT "Number of files to print?";x
70 INPUT "DRIVE TO USE (1 OR 2)";DRIVE:DR$="FLP"&DRIVE&"_":DATA_USE DR$:CLS
80 FOR loop=1 TO x
90 STRIP 0:INK 2:AT 0,10:PRINT "WARNING!":STRIP 2:INK 7:PRINT "Once a file is sent to the spool it CANNOTbe removed or stopped!"
100 INPUT "PLEASE ENTER FILE NAME...(no ext or drivenecessary)";n$:n$=n$&"_LIS"
110 spl n$
120 CLS
130 END FOR loop
140 PRINT "SPOOLING COMPLETE."
Sinclair QL computer
Sinclair QL computer

I strongly suggest you do the following: Load the INSTALL_BAS program for Quill. Choose EDIT to edit your current printer driver, then change or add the POSTAMBLE CODE to the code for a form feed on your printer. Then INSTALL this printer driver again. The form feed will now be sent after every file is printed to make sure printing for each file starts on a new page.

If you have any questions or problems you can contact me at: [address omitted]

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.