Bob’s Notebook: Printing and TIMACHINE

See all articles from Sinc-Link v8 n3
Author(s): Bob Mitchell
Publication: Sinc-Link
Pub Details: Sinc-Link v8 n3 (Volume 8, Issue 3)
Date: May/June 1990
Pages: 4

Ever wondered how to go about printing the output from the BASIC compiler Timachine on your wide printer? You know, the listing of Run-times and Variables normally printed on the TS2040. If you have tried, you have found that it doesn’t work very well; and why the wide printer? Thermal paper is affected by light, heat and glues so that printing often fades and paper darkens with time. Also, paper of proper width could become hard to find if Radio Shack stops stocking it. Using the wide printer is the alternative.

The main problem is that the Timachine output contains instructions apparently not recognized by the LKDOS printer driver. One of these is code 22 which is the AT control and there are other embedded codes which align the output into columns.

First of all, a way had to be found to SAVE the output to disk and the LKDOS Sequential file commands built into the version 3 EPROM seemed a good bet. This is the procedure I used:

1. LOAD Timachine and the program to be compiled.

2. Open a Sequential file on a suitable disk using the command <RANDOMIZE USR 100: OPEN #3,”name.CT OUT>. The drive will spin indicating this is done. More on the .CT later.

3. Compile the BASIC program as usual with <REM! LPRINT> included. Only essential instructions will show on screen. When compilation is completed, enter <RANDOMIZE USR 100: CLOSE #3>. The drive spins as the listing is saved.

4. Now LOAD “doctor.B1“, the uncompiled version. Use the Directory Analysis option to get track # for the Seq file just saved. Use Exam/Modify option to load the track into the buffer (ie, addr 50000). BREAK into BASIC and enter the following lines and GO TO 10:

10 FOR i=50024 TO 55120
20 IF PEEK i=22 THEN POKE i,32
30 NEXT i: STOP

5. Return to same trk WITHOUT reloading it: Use GO TO 1650. SAVE it to the SAME track.

6. Restart the 2068 and set the LKDOS to LPRINT: <RANDOMIZE USR 100: OPEN #3,”lp”>. Set line length and left margin to suit.

7. Use PRINT USR 100: LPRINT “name.CT”

This routine will produce a readable printout although arrays will not be spaced as they appear on screen or on the TS2040. If you have a copy of Mscript, load “name.CT” into it and do some refining.

With the extension <.CT> it will be straight-forward to load the Seq File into Mscript and do some editing. But first you must take out any zeros in the text since Mscript sees zero as the end of the file. Repeat the earlier loop just changing the 22 to 0. Next, RUN Mscript again and the full file should be in the text.

Do the editing and when all is to your liking, you could SAVE it back as a Seq file using this routine or do an MSCRIPT SAVE instead:

10 RANDOMIZE USR 100: OPEN #2,"name OUT"
20 FOR i=46927 to (end): PRINT CHR$ PEEK i;: NEXT i
30 RANDOMIZE USR 100: CLOSE #2

Get (end) from Mscript Menu.

You can easily make an ASCII copy of a BASIC listing using the Seq filing commands. Such a listing is useful if you want to append it to a column in a newsletter such as Sinc-Link. Here are the steps I used:

1. LOAD the BASIC program you are going to convert to ASCII.

2. Enter <RANDOMIZE USR 100: OPEN #3,”name.CT OUT”>.

3. LLIST the program. It will go to the sequential file.

4. Enter <RANDOMIZE USR 100: CLOSE #3. (The disk will spin. (If the listing is longer than one track length, the disk will spin each time a track is filled.)

5. LOAD Mscript and LOAD the seq file you have just saved.

6. Remove all zeros using the loop procedure given earlier.

7. EDIT out extraneous ODDS & ENDS (eg, those caused by embedded control characters in strings in the BASIC listing.

You can also use these techniques to SAVE a PROFILE text to a Seq File. This will let you examine the entire file using PRINT USR 100: PRINT “name” or even LPRINT it.

And speaking of PROFILE, this may interest you:

If you use Profile to make address labels, you can set the LKDOS printer driver parameters ahead of time and make the labels in wide (elongated) characters, assuming you’re using a dot-matrix printer. I also make my disk labels this way on ordinary printer paper and then glue them onto the disks using Tack a Note so that they are removable. These adhesive sticks are made by Dennison.

One final bit of flotsam and jetsam re TOOLKIT (tstk.C1): When using “LIST VARIABLES” in this collection of utilities you may get a corruption at the end of the list. If so, this may mean that the value in E LINE-1 is not 128 as it should be. Try this: Locate E LINE (PEEK 23641+256* PEEK 23642); then POKE E LINE-1,128 and try again. If all is well, reSAVE the program concerned.

Dated 900411.