9 Output Operations
The optional WIDTH parameter specifies where to insert CRLFs in the output, as described at the start of this chapter. Once created, each spool file must not be accessed by other file storage operations (COPY, RENAME, PRINT#, etc.) until you have completed spooling into the file. Then reassign the printer-control function to another device (for example, PRINTER IS 8) to close the spool file.
Here is a program sequence which creates three spool files for later use:
10 F$="SPOOL" 20 D$=",SCR_PAD" 30 PRINTER IS F$,WIDTH(80) 40 SYSTEM PRINTER IS F$"1",WIDTH(132) 50 PRINT ALL IS "SPOOLA"D$ 60 END
COPY file specifier
The contents of the spool file are dumped to the currently-specified printer of the same type assigned to the spool file. The current line width of the printer is ignored during the spool file dump.
Here is an example program which generates a 65-character-wide "ripple printout" of alphanumeric characters. The output is first spooled into a file called Ripple then dumped to the printer.
10 Makeripple: ! output ripple to spool file. 20 PRINTER IS "Ripple",WIDTH(65) 30 PRINT LIN(5),SPA(25);"RIPPLE PRINT",LIN(1) 40 C1=32 50 FOR Line=1 TO 32 60 FOR Char=C1 TO C1+64 70 PRINT CHR$(Char); 80 NEXT Char 90 C1=C1+1 100 NEXT Line 110 Dumpripple: ! copy spool file to printer. 120 PRINTER IS 0,WIDTH(200) 130 COPY "Ripple" 140 ENDNotice that the output can be duplicated as many times as needed by simply repeating the COPY statement.
RIPPLE PRINT !"#$%&'()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ !"#$%&'()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_a "#$%&'()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ab #$%&'()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abc $%&'()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcd %&'()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcde &'()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdef '()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefg ()*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefgh )*+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghi *+,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghij +,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijk ,-./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijkl -./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklm ./0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmn /0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmno 0123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnop 123456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopq 23456789:;%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqr