Printing VU-CALC on a Large Printer

See all articles from Update July 1996
Author(s): Bob Swoger
Publication: Update Magazine
Pub Details: Update July 1996
Date: July 1996
Pages: 16-17

One of the many wonderful things about the TS2068 is that there has been so much written to inform the user how to use all the features and capabilities. The manual for it is more informative than manuals I’ve seen for other brands. The way the memory is mapped makes programming a pleasure. The system ROM is located between 0 to 16383. The rest of space up to 65535 is RAM. Moving RAMTOP down to hide machine code is done by simply giving the command CLEAR followed by the address of the last byte of RAM you wish the computer to know about.

The TS2068 manual tells us that if we want to display something on the screen, we just POKE something into the RAM space between address 16384 ( 16 X 1024 ) and 23296 ( 16384 + 6912 ) or print something to one of 768 screen locations.

Because TASWORD TWO is more like a line editor than a word processor, every character and space displayed on the screen is stored in predictable RAM locations. With the use of HEADER.B1 by Nazir Pashtoon for tape and Disk Doctor by George Chambers we find that the start address for TASWORD documents 33280. This is the address of the first character on the top left most position on the screen.

If we do not enter printer controls into a TASWORD TWO document, the location of each character printed on paper and screen is easily located in RAM. If we want to see the text just entered into TASWORD TWO, we know to look for as much as 300 lines of 64 characters per line starting at address 33280 in RAM. Since 300 lines of 64 characters is 19200 bytes ( 300 * 64 ), the last character would be at address 52479 ( 33279 + 19200 ). The sixth character on the fifth line would be at location 33541 found by:

33279 + (4*64)+ 6 = 33541

The following short program will display the first 10 lines of a TASWORD TWO document named wpfile.Ct to the screen just as it appeared on the screen when you typed it into TASWORD in the 32 column mode:

10 RANDOMIZE USR 100: LOAD "wpfile.Ct" CODE 33280
20 FOR I=33280 to (33279+(10*64))
30 PRINT CHR$ PEEK I,
40 NEXT I

THIS WON’T WORK VERY WELL WITH MSCRIPT BECAUSE MSCRIPT LINES ARE OF INDETERMINATE LENGTH.

Now suppose you wanted to print out a portion of a VU-CALC spreadsheet to a large printer. Each VU-CALC cell is seven characters wide. There are 50 cells across. The address of the first character in the first cell is 34567. The address of the last character in the last cell in the first row is (34567 + (50 X 7)) or 34567 + 350. Since there are 50 rows, the last byte in the VU-CALC file is 50 * 350 or 17500 + 34567 or 52067.

As you can see, we can use simple calculations to locate where each byte of a VU- CALC file and each byte of a TASWORD TWO file resides in RAM. Armed with this knowledge, we can write a program to move VU-CALC cell information directly to a Large Printer or into a TASWORD TWO file for further formatting.

Since the large printer can print only 10 columns with reasonable left and right margins rather than all 50 columns across the page, VC2ZLP asks you to choose the left most column to be printed. It then prints that column and the next 9 and all 50 rows below.

TASWORD, being capable of 64 characters in a row, allows us to load 9 VU-CALC columns ( 9 X 7 = 63 ) into a TASWORD TWO file using VC2TAS. The added advantage of doing this before printing is that the file can now be modified further for better readability of the spreadsheet. Since many of our spreadsheet applications don’t require all nine columms there is usually room to improve the appearance of the printout by moving the columns apart and using complete words for headings rather than being limited to 7 characters.

The two programs, VC2LP.B1 and VC2TAS.B1, are both provided as part of the LogiCall ensemble of programs available from Mechanical Affinity and RMG for $15, their listings are provided below.

Thanks to Marie Kendall for alerting this author of a bug in an earlier version of VC2LP.B1.

  10 REM   --== VC2LP.B1 ==--
WRITTEN BY ROBERT E. SWOGER
1996 V1.4
20 REM Prints VU-CALC files
to a large printer.
30 CLEAR 34552: LET h=CODE "d"
: POKE 23658,0: POKE 23728,h
40 CLS : RANDOMIZE USR h: CAT
".Cv",
50 PRINT AT 16,0;'"This progra
m prints 9 columns &50 rows of
a VU-CALC file to alarge print
er. You select theleft-most c
olumn. You may Save,Quit or sel
ect drives 0-4 now."
60 INPUT "Name of file to prin
t? "; LINE g$
70 IF g$>="0" AND g$<="4" THEN
RANDOMIZE USR h: GO TO VAL g$:
GO TO 40
80 IF g$="s" OR g$="S" THEN GO
TO 9990
90 IF g$="q" OR g$="Q" THEN GO
TO 9998
100 RANDOMIZE USR h: LOAD g$+".
Cv"CODE
110 IF PEEK 23728<>h THEN PAUSE
h: GO TO 30
120 REM R=VU-CALCs 50 ROWS
130 REM C=VU-CALCs 9 clmn/pg
140 REM V=VU-CALC doc start-1
150 REM S=First column to print
160 REM O=Offset to begin J
170 LET R=50
180 LET C=9
190 LET V=34572
200 REM Determine start column
210 INPUT "Start with what colu
mn? ";S
220 IF S<1 OR S>42 THEN GO TO 2
10
230 LET O=(S-1)*7
240 REM SET-UP LP driver
250 RANDOMIZE USR h: OPEN #3,"L
P"
260 RANDOMIZE USR h: POKE 16090
,72: REM Printer width
270 RANDOMIZE USR h: POKE 16094
,8: REM Left margin
280 LPRINT
290 REM PRINT VU-CALC TO LP
300 FOR I=V+O TO (V+(50*350))-1
STEP 350
310 FOR J=1 TO 63
320 LPRINT CHR$ PEEK (I+J);
330 NEXT J
340 LPRINT
350 NEXT I
360 GO TO 9998
9992 RANDOMIZE USR h: SAVE "VC2L
P.B1" LINE 10
9998 RANDOMIZE USR h: LOAD "L.B1
"
  10 REM   --== VC2TAS.B1 ==--
WRITTEN BY ROBERT E. SWOGER
1996 V1.2
20 REM Converts VU-CALC files
to TASWORD 2 files.
30 CLEAR 33279: LET h=CODE "d"
: POKE 23658,0: POKE 23728,h
40 CLS : RANDOMIZE USR h: CAT
".Cv",
50 PRINT '"This program create
s a 9 column50 row Tasword 2 fi
le from a VU-CALC file that can
be printed ona large printer. Y
ou may selectthe left-most colum
n. You maySave, Quit or selec
t drives 0-4."
60 INPUT "Name of file to conv
ert? "; LINE g$
70 IF g$>="0" AND g$<="4" THEN
RANDOMIZE USR h: GO TO VAL g$:
GO TO 40
80 IF g$="s" OR g$="S" THEN GO
TO 9990
90 IF g$="q" OR g$="Q" THEN GO
TO 9998
100 RANDOMIZE USR h: LOAD g$+".
Cv"CODE
110 IF PEEK 23728<>h THEN PAUSE
h: GO TO 30
120 REM R=VU-CALCs 50 ROWS
130 REM C=VU-CALCs 9 clmn/pg
140 REM I=Tasword doc start
150 REM J=VU-CALC doc start
160 REM S=First column to print
170 REM O=Offset to begin J
180 LET R=50
190 LET C=9
200 LET I=33280
210 LET J=34573
220 REM Determine start column
230 INPUT "Start with what colu
mn? ";S
240 IF S<1 OR S>42 THEN GO TO 2
30
250 LET O=(S-1)*7
260 LET J=J+O
270 REM MOVE VU-CALC TO TASWORD
280 PRINT #0;TAB 12; FLASH 1;"W
ORKING";
290 FOR K=1 TO R
300 FOR L=0 TO (7*C)
310 POKE (I+L),PEEK (J+L)
320 NEXT L
330 LET I=I+64
340 LET J=J+350
350 NEXT K
360 RANDOMIZE USR h: SAVE g$+".
CT"CODE 33280,((7*C)+1)*R
370 GO TO 9998
9992 RANDOMIZE USR h: SAVE "VC2T
AS.B1" LINE 30
9998 CLEAR 6E4: RANDOMIZE USR 10
0: LOAD "L.B1"

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