Pat Morrissey’s add-on for Psion’s VU-Calc spreadsheet that prints a worksheet as a real spreadsheet on an 80-column printer, instead of the T/S 2040 screen copy. A new option 4, PRINTOUT, on VU-Calc’s file menu asks for a title, a left margin and the range of columns and rows to print. It then prints the title in expanded type and the cells in condensed type, with column numbers along the top and bottom. Up to 19 columns fit on a standard sheet in condensed print, and Morrissey notes that a 136-column printer could take up to 32.
There are two versions, one for the Tasman Centronics interface and one for the AERCO interface. The article text says how to build your own working tape: type in the new lines, MERGE them into the BASIC part of VU-Calc, then save that BASIC with VU-Calc’s two code blocks and the printer driver. Both versions were written for a Star SG-10 printer, with notes on the codes to change for a Blue Chip M120/10 or other printers.
The download holds what Morrissey sent to SyncWare News in October 1985: the finished AERCO version (vcalcPA) and Tasman version (vcalcPT), each with VU-Calc’s screen and code and the Tasman (t) or AERCO (a) driver code, a demo worksheet (payroll) after the Tasman version, and the added lines alone (vcalcPAmrg and vcalcPTmrg), as published. It also holds the article text, which covers both versions, and his covering letter, which lists what is on the tape. The Tasman article appeared in SyncWare News as “VU-Calc and the Tasman I/F” and the AERCO one in Timelinez.
Program Analysis
Structure
- Line 10: the loader, which loads the screen and VU-Calc’s code at 29328 and jumps to line 3200.
- Lines 40–63 (AERCO) or 50–63 (Tasman): set up the printer interface and send the margin, expanded and condensed print codes.
- Lines 68–190: ask for the range, print the column numbers, then read each cell’s text straight out of VU-Calc’s worksheet memory and LPRINT it.
- Lines 1000–5000: VU-Calc’s own file menu, with option 4 added to call the print routine.
- Line 4000: a VERIFY routine that checks data saved from the program.
Notable Techniques
- The print routine reads the worksheet directly with
PEEK (34573+k+i): each of the 50 rows takes 350 bytes, seven characters for each of 50 columns. - The AERCO version switches the driver between “expanding” and “literal” modes with
POKE 64456, so printer control codes pass through unchanged, and POKEs 26703/26704 to send LPRINT output to the Centronics port. - Almost every number is written as
VAL "n"to save memory, since only a little memory is left free beside VU-Calc. - Line 2000 replaces VU-Calc’s
#pscreen-copy command with a jump back to the worksheet, so the program does not hang when no T/S 2040 is connected. - Line 3200 includes the fix for the “2: Clear Worksheet” bug in the commercial program.
Potential Issues
- Line 9500, carried over from VU-Calc, is an endless PEEK loop that nothing calls.
- The printer codes are set for the Star SG-10; other printers need lines 51, 53, 60, 63, 69 and 180 changed, as the article explains.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.