DUAL PRINTOUT UTILITY
PRINT_2 is a utility allowing two text files to be printed out side by side on
one sheet of paper. The program uses the 'condensed' font available on Epson
and compatible printers, together with a reduced line spacing, to give a
compact but readable output. I use it mostly to print voting slips for a
photographic group, but it is useful wherever compact printed output or paper
economy is wanted.
The program was written to drive an Epson RX80 printer, producing printouts 60
characters wide, with a gap of approximately 20mm between them. The program
can easily be customised in PROCinit for other printer carriage widths and
linelengths. A vertical line (ASCII &7C) is printed down the centre of the
page as a cutting guide for seperating the printouts.
Operation of the program should be self evident. Enter the filenames of the
text files for the left and right sides where prompted. Text files should be
in plain ASCII and can be unformatted (i.e. no carriage returns), or formatted
to a line length of 60 characters or less, as the program word-wraps to fit
the width. A form feed is performed only after a form feed has been
encountered in both files. Control characters other than carriage return and
form feed are ignored.
I have tried to make the program reasonably well structured with seperate
procedures to handle different operations. The main part of the program is
the procedure PROCprint_2, which repeatedly calls PROCadd_a_letter. This adds
the character read from one of the files to "Word$" until a space is
encountered, whereupon "Word$" is added to "Line$". If a carriage return or
form feed is encountered, or the character count in the current line reaches
"Cmax" (default 60), then the flag "DONE" is set. Back in PROCprint_2, either
PROCadd_a_letter is called again, or if "DONE" is set PROCprint is called to
print the (half) line of text. PROCprint also stores for later use, any
residue of "Word$" as "Part$" and changes the variable "file" to the file
handle of the 'other' text file. The process then repeats, alternating
between files. It is interesting that BASIC allows the same file to be opened
more than once, and allocates a different 'handle' each time, so the program
works correctly if the same name is entered for both sides.
Although written in BASIC and structured for readability rather than speed,
the program is not excessively slow; it just about keeps up with my printer!
David Robinson 24-Oct-94