VU-CALC Tutorial, Wide Printer Enhancement and Additional Notes on VU-Calc

See all articles from Update July 1989
Author(s): Bob Mitchell
Publication: Update Magazine
Pub Details: Update July 1989
Date: July 1989
Pages: 32-35

The “Mitchell VC” Issue Disk for LKDOS (Oliger DOS Version avail August 1989)

Printing a spreadsheet on the tiny 2040 printer does not provide a very useful output. You end up cutting and pasting to get a full display on one piece of paper. Then, to keep the copy from fading or turning brown, it must be photocopied. Hardly state of the art!

Thus provoked, I wrote a revised version of the vu-calc BASIC program <vcalc.B3> to take advantage of my wide printer (Smith-Corona Fastext 80) and the Larken printer interface code (pif) contained in the Version 3 Eprom available from Larken Electronics.

Next came a BASIC routine to perform the spreadsheet printout <vcalcP.B2>; this will work fine, but the printout is very slow. The next step was to compile the printout routine via Timachine and the result was much faster, quite tolerable in fact.


Let’s take <vcalc.B3> first.

Enter vcalc.B3 (listing 1) and SAVE by going to line 9900 (or 9910 for a Larken AUTOSTART SAVE).

To use vcalc.B3 requires the vu-calc machine code that appeared on the original tape. If you have this on disk, skip the next paragraph.

If you are going to load the code “vc” from the original Psion cassette, LOAD vcalc.B3, BREAK into BASIC, position the tape at the start of the code and use LOAD “” CODE. When the code is loaded, enter <GO TO 12> to carry on. Now is a good time to SAVE this code to disk. Use <PRINT #4: SAVE “v.C1″CODE 29327,5230.

There is a display of the number of formula slots used out of the 100 available; this helps keep track of how many have been used. Careful assignment and editing of formulae is essential to avoid running out of slots, especially in a complex spreadsheet.

Two HELP files available on the Update disk may be displayed on screen using <taswide>. Alternatively, you can get a copy on your wide printer by using the Larken pif. But you must have the Version 3 Larken Eprom to do this. Use the following procedure to get this print out:

1. PRINT #4: POKE 16090,63: REM line length
2. PRINT #4: POKE 16092,10: REM line feed
3. PRINT #4: POKE 16094,8: REM left margin
4. PRINT #4: LPRINT “vcC?.CT” (or vcT?.CT).

The two Help Files are:

1. Commands. <vcC?.CT> This is essentially the detail included in the Vu-Calc manual, with a few additional notes.

2. Tutorial. <vcT?.CT> This is the file you are viewing now. It not only explains how the printing takes place on the wide printer but also includes additional information on vcalc.B3.

Also included is an option in the vu-calc BASIC program to save or load data files via tape.


Enter vcalcP.B2, the wide printer routine (listing 2) and save it.

Several lines send commands to the printer: Line 2008 selects PICA font and turns CONDENSED mode OFF. Line 2010 sets CONDENSED mode to ON; this is a fairly standard command <OUT 127,15>. Lines 2075 and 2120 do a Line Feed while line 2135 does a form feed. Check your printer manual for correct commands and change these lines accordingly.

You may want to check the BASIC before compiling. Activate your LKDOS printer interface code, load a data file and GO TO 110. Your printer must be turned on. The spreadsheet will be printed, albeit very slowly. Make sure the BASIC is working to your liking before compiling it.

Clear the computer and LOAD Timachine. LOAD vcalcP.B2 into Timachine (use RANDOMIZE USR 100: LOAD “vcalcP.B2) and do the compilation. SAVE the compiled code to disk and clear the computer. LOAD the compiled code back into the computer and SAVE it again as v2.CP CODE 63000,length. (length is given in the Timachine output.)

Make sure your wide printer is ON.

LOAD vcalc.B3 and using vu-calc option <#l>, (that’s el for Lima), load any available spreadsheet data or make up one. There is a sample on the Update disk (vgh2). Use the vu-calc command <#p> to start the wide printer routine.

You are prompted for some inputs. It will be necessary to determine the dimensions of the wide printout as you view the screen and before going to the print routine.

1. extra space between columns? y/n. Entering <y> will make reading columns with seven numbers easier. This will sometimes break up words that span two or more columns. Unless the numbers are large enough to fill up the column width, <n> will usually suffice.

2. No. of cols. Up to 9 columns (spaced) or 10 (unspaced) will result in a PICA sized printout; otherwise CONDENSED mode will be switched in. If too many columns are called for, an error report will appear and this prompt will be repeated.

3. start at col? (1-50). Enter the column number shown at the top of the vu-calc grid.

4. start at row? (a TO ax). Enter the row letter shown at the left side of the vu-calc grid.

5. end at row? (b TO ax). Enter the row letter at which the printout is to stop. The <b> in this example will change to correspond to the next letter after the start row letter.

6. paper eject? Enter 1 for yes or 0 for no.

LISTING 1

10 ON ERR RESET : CLEAR VAL "29327": CLS : RANDOMIZE USR VAL "100": OPEN #VAL "4","dd"
11 PRINT #VAL "4": LOAD "v.C1"CODE
12 PRINT #VAL "4": OPEN #VAL "3","lp": PRINT #VAL "4": POKE VAL "16090",VAL "127": PRINT #VAL "4": POKE VAL "16094",VAL "8": PRINT #VAL "4": POKE VAL "16092",NOT PI
20 CLEAR : GO TO VAL "3200"
900 LET lenc=PEEK bfre+VAL "256"*PEEK (bfre+1)-zz: RETURN
1000 GO SUB VAL "1100": PRINT #VAL "4": LOAD a$CODE : CLS : GO TO USR e2
1100 GO SUB VAL "1200": PRINT #VAL "4": CAT ".CV",: INPUT "name? (eg,vinc)"' LINE a$: LET a$=a$+".CV": RETURN
1200 PAPER VAL "7": INK VAL "0": BORDER VAL "1": CLS : RETURN
2000 IF PEEK VAL "63000"<>VAL "205" THEN PRINT #VAL "4": LOAD "v2.CP"CODE VAL "63000"
2005 RANDOMIZE USR VAL "63000"
2010 GO TO USR e3
3000 GO SUB VAL "1200": PRINT "1>EXIT"''"2>CLEAR WS"''"3>RESUME"''"4>DATA via TAPE"''"5>HELP!"''"Formulae used= ";PEEK VAL "34566": INPUT "OPTION? ";a
3010 IF a>NOT PI AND a<VAL "6" THEN GO TO (VAL "3000"+a*VAL "100")
3020 GO TO VAL "3e3"
3100 GO SUB VAL "1200": STOP
3200 CLEAR : DIM b$(VAL "100"): DIM c$(VAL "20"): GO SUB VAL "1200"
3201 LET e1=VAL "29764": LET e2=e1+VAL "3": LET e3=e2+VAL "3": LET zz=e1+VAL "4789": LET bfre=e1+VAL "4798": LET dcontx=e1+VAL "4376": LET xcol=e1+VAL "3116": LET xrow=xcol+LN PI: GO TO USR e1
3300 CLS : GO TO USR e2
3400 INPUT "1=save 0=load ";sl: IF NOT sl THEN CLS : LOAD ""CODE : GO TO USR e2
3410 IF sl THEN GO SUB VAL "900": SAVE a$CODE zz,lenc: CLS : GO TO USR e2
3500 INPUT "1=commands 0=tutorial ";cc: IF NOT cc THEN CLS : LET i$="vcT?.CT": GO SUB VAL "3600": GO TO VAL "3000"
3510 CLS : LET i$="vcC?.CT": GO SUB VAL "3600": GO TO VAL "3000"
3600 IF PEEK VAL "64300"<>VAL "245" THEN PRINT #VAL "4": LOAD "taswi.Cx"CODE
3610 ON ERR GO TO VAL "3620": PAPER VAL "7": INK NOT PI: BORDER VAL "7": CLS : RANDOMIZE USR VAL "64300": PRINT CHR$ VAL "3";: PRINT #VAL "4": PRINT i$
3620 ON ERR RESET : PRINT CHR$ VAL "2": PRINT "Press a key": PAUSE NOT PI: RETURN
4000 GO SUB VAL "1100": GO SUB VAL "900": PRINT #VAL "4": SAVE a$CODE zz,lenc: CLS : GO TO USR e2
5000 LET c$=STR$ VAL b$: GO TO USR dcontx
9000 GO SUB VAL "1200": PRINT ''''"ERROR was at"''"COLUMN ";PEEK xcol+VAL "1"
9100 LET a=PEEK xrow: LET b=INT (a/VAL "26"): LET a=a-b*VAL "26": LET d$=CHR$ (b+VAL "64")+CHR$ (a+VAL "65"): IF b=NOT PI THEN LET d$=d$(2)
9200 PRINT "ROW ";d$: INPUT "Press ENTER to continue";b$: GO TO USR e2
9500 INPUT a: PRINT PEEK a+VAL "256"*PEEK (a+SGN PI): GO TO VAL "9500"
9900 CLEAR VAL "29327": RANDOMIZE USR VAL "100": SAVE "vcalc.B3" LINE VAL "10": STOP
9910 CLEAR VAL "29327": RANDOMIZE USR VAL "102": GO TO VAL "10"

LISTING 2

50 REM !USR 63000
60 REM ! LPRINT
70 REM !INT +xs,le,end,x,y,r,h,eject,z,q,f,g
80 REM !LEN $<=2
90 REM ! LIST
100 REM ! OPEN #
110 GO TO 2000
1000 IF IN 127<>237 THEN GO TO 1000
1010 RETURN
2000 CLS : INPUT "extra space between columns? y/n"; LINE s$: IF s$<>"y" AND s$<>"n" THEN GO TO 2000
2002 LET xs=7
2003 IF s$="y" THEN LET xs=8
2004 LET end=PI-PI: INPUT "No. of cols ";x: LET x=x*xs
2008 GO SUB 1000: OUT 127,27: GO SUB 1000: OUT 127,80: GO SUB 1000: OUT 127,18
2009 IF x>120 THEN PRINT "too many columns": PAUSE 60: GO TO 2000
2010 IF x>75 THEN OUT 127,15
2020 INPUT "start at col? (1 TO 50)";y: LET y=y-SGN PI
2030 INPUT "start at row? (a TO ax)";z$
2035 IF LEN z$=SGN PI THEN LET z$=" "+z$
2040 IF z$(2)=" " THEN LET h=CODE z$(1)-97
2050 IF z$(2)<>" " THEN LET h=(CODE z$(2)-97)+(26 AND z$(1)="a")
2052 IF end THEN LET r=h: RETURN
2055 LET z=h
2060 INPUT "End at row? (";CHR$ (h+98);" TO ax)";z$: LET end=SGN PI: GO SUB 2035
2063 INPUT "paper eject? 1=yes 0=no ";eject
2065 LET r=r-z: IF r<=PI-PI THEN GO TO 2060
2070 LET q=34573+(7*y)+(350*z)
2072 IF xs=8 THEN LET le=x-1-(x/8)
2074 IF xs=7 THEN LET le=x-1
2075 LPRINT CHR$ 10
2080 FOR f=q TO q+(r*350) STEP 350
2090 FOR g=0 TO le
2100 LPRINT CHR$ PEEK (f+g);
2105 IF xs=8 AND (g+1)/7=INT ((g+1)/7) THEN LPRINT " ";
2110 NEXT g
2120 LPRINT CHR$ 10
2130 NEXT f
2135 IF eject THEN OUT 127,12
2137 LPRINT
2140 RETURN

VU-CALC INSTRUCTIONS

COMMAND PANEL. Four types of inputs:

1. TEXT. Enter column or row headings or subheadings, names, or any other labels you choose. First, position the red cursor to the box on the 50 x 50 grid where you wish to start your text. Next, Enter< ” > and up to 28 characters. Press ENTER to transfer text to the grid.

2. DATA. Position cursor type data and press ENTER. Numerical data may be entered directly.

3. FORMULAE. Enter these directly. Position cursor to box which will print the result of the formula. The answer will appear in the chosen box with the formula appearing just under the box and to its left. Returning to this box will display the formula.

.Syntax of a formula: constants (numbers), references to numbers in other boxes and simple arithmetical operators +, -, /, and *. Refer to other boxes by their coordinates, rc where < r > is the row letter(s) and < c > is the column number.

eg. B1*1.03
D7-C7
D12*(B2+1.5)/C1

.A formula can be applied to rows or columns of numbers by using the Repeat Command (see below).

.Sum facility enables you to add a row or column or part thereof or a rectangular block of boxes. Use the form &f:l where f=top left hand box and l=bottom right hand box. Note box f must always be above and/or the the left of the box reference.

eg. &A2:B4 (sums boxes A2+A3+A4+B2+B3+B4)
&C3:C10 (sums row C3 to C10)
&B5:D5 (sums column B5 fo D5)

4. COMMANDS. Press < # > and the two line command panel appears.

#B — Blank: to delete contents of current box ready for updated data .
#C — Calculate: Recalculates entire table after entering new or changed data, etc.
#E — Edit: Allows formula to be changed. If this is not done faithfully, formula capacity will be needlessly wasted.
NB. There is no provision for deleting a formula and thereby restoring the capacity by one.
#F,c,f,j — Format, Format, column, format-type, justified: Determines how a number will be shown in a given col. Defined by three parameters — c,f, and j
c = one or two digit number) or (< A > ie, all specifying a column ) ( for entire table
f = format type required i = integer, $ = two decimal places, g = general
j = justified l = left, r = right
#G,rc — GO TO box designated by row r and col c.
#L — Load data from disk. Type in file name with no extension. (extension is always < .CV >.
#P — Print a copy to the wide printer.
#Q — Quit and 1. exit the program. 2. clear the worksheet. 3. resume vu-calc operation. 4. save/load data via tape. 5. view help files. ) press ENTER
#R,rc,f:l — Repeat contents of box rc over range of boxes which may be a row or column or part thereof or a rectangular block of boxes. It means: ‘repeat contents of box rc in all boxes from <f>irst to <l>ast’

Similar to Sum Facility above. Also repeats a formula for box rc across a row or down a column but not over a block of boxes. eg, if box A2 has formula < 1.03*A1 > then #R,A2,A3:A10 will automatically increase the value of A in the formula by 1 for each succeeding box. Thus box A3 would have formula < 1.03*A2 >; box A4 would have formula < 1.03*A3 >; etc For columns, the letter would increase — B to C, C fo D, etc, as the formula moved down the column. Prefix a box reference with < $ > to render it an absolute box which does not change when repeated.

In the above example, the formula 1.03*$A1, when applied to any box in row A would remain the same.

#S — Save file to disk, without specifying the extension, which will be < .CV >. Upon completion of the save, the program with all data intact will return to the screen.
#T,r(or c),r(or c) — Transfer a row or column defined in the first parameter to the row or column defined by the second parameter. A row cannot be copied to a column or vice versa.

5. If a formula is entered which references a blank box or a box with text rather than data, the program will stop with an error report. GO TO 9000 and press < ENTER >. The display will return to the table and you may continue.


Editors Note: The “Mitchell VC Disk” contains: <1> Operating Listing 1, <2> Operating Compiled Listing 2, <3> Un-compiled Listing 2 for user adaptations, <3> Supporting Code, <4> A Saved sample View Calc Spreadsheet for an example to work with. Update advises all to obtain a View Calc Cassette from your dealer to have the original back up program and the manual. You can likely buy it for less than $16.00. The disk update of this software makes it a very nice addition to anyone’s computing capability.

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