Home Page

 


EARLIER FEATURES

 


FEATURES CONTENTS

 


LATER FEATURES

 

Features Contents


30th November 2002
KEN ABOUT ... PRINTOUTS, EXTENSIONS & PLACES 
Ken Ross

email.gif (183 bytes)
petlibrary@bigfoot.com


 

THE KEY TO THE SITUATION

The Commodore keyboard is an item that should fall to hand. If, however, bits have fallen off instead, fear not!

If your Commodore just has a hole facing you on the keyboard, missing keys can be created quite easily. The return spring is a weak spring 12mm in diameter, 20mm tall. The part of the key that goes through the hole in the keyboard is a simple plastic pole. The measurements for it are 7mm diameter, 12mm tall, with a retaining slot in it 7mm x 2mm. A quick shufty through my pen box reveals quite a few candidates for recycling this way if needed. The replacement spring would have to be experimented for the final result. 

The keycap itself is a plastic box that sits on top of the pole, various methods can be used to create this, recycled from other lesser machines and epoxy glue would be a short cut method.
Epoxy glue would be better than 'superglue' as it can fill cracks and can be thickened up for bodging purposes.

PLACES FAR AWAY ARE CLOSE AT HAND.

I return again to the subject of Video CDs! VCDs can be played in 95% of DVD players and any PowerMac and above (or equivalent PC - perhaps Mr Grainger can fill in a name of such a machine? - Ed: Nope, don't know what a PowerMac can do!).

Various titles can be supplied from:

http://www.lala.co.uk

They are often quite sometime before they turn up in your local HMV and lots cheaper!
(Unlike other places they can be contacted to check things out!)

Back on to the subject of old machines. The magazine RETROREVIEW has a web site at:

http://www.retroreview.com

It is a Welsh / Portuguese co-production, (supply own echo chamber when reading that out!), and, if you visit their site, sample article PDFs can be downloaded to give a flavour of the printed version. The magazine covers a wide range of machines, some more obscure than others, and it's created on an Amiga - hurrah!


From ICPUG journal March/April 1996

Getting a Qwert to Print Out

There are ten programs in the PET library which can be used to get words to printers, and they have varying degrees of user-unfriendliness.

On library disk B2 are:

Dynatext / Context Editor

This has an instruction file 'dynatext.ins', which shows that it dates from as long ago as Dec '79. It uses a DOS-like prompt to enter commands. 'g', for example, means get a file from disk or tape, and 'I#' means list file line # (up to a maximum of 321 on my 8000).

The instruction file is 246 1ines long, and it's not very clear how to start using it. You have to enter 'aO' (add to line 0), which gets you a flickering cursor. Because it has no linewrap, at the end of each line you have to hit return. Up arrow (chr$(94)) is the key to exit, and it then returns to command mode with find and replace, and duplicate functions, amongst others. There are so many features that the instruction file claims 'it may take a month to be comfortable with all the commands and format options'.

Petpro#2

This is my favourite, from 1981. It doesn't have that many features, but it does at least have linewrap, so you don't have to hit return at the end of every line. In fact, you mustn't use the return key at all when entering text. It messes things up if you try!

The exit symbol is the double quote (chr$(34)) so that can't be used in text either. Another major drawback that I've come across in the years I've used it, is that when calling up a file it hangs if the file can't be found. With a bit of modification, (mangling), using the BASIC 4 disk status string and a bit of the C64 sequential file reading program mentioned in my previous {printed}  articles, I've created a version which is a bit more idiot proof.

{petpro#2 was aimed at 4K,tape drive only machines so having 32K & disk drives enabled me to bodge together petpro2.kr}

Easy Edit / XXXX

There are 6 SEQ files on disk containing instructions. Credits attribute the program to Robert Drake from Canada in late 1979. There are 5 versions for different machine set ups. It can deal with 55 lines of text and has no autowrap, so a Return is required at the end of each line. The <clr/home key is used to exit. l used version c when I tried it out. It saved to disk with no problems, but the printout on the 8023 had a very large margin for some reason.

Mini WP PET / (Mini WP PR40)

This magnificent piece of software works with tape only and prints out in upper case, but it does have autowrap and space for 24970 characters. The PR40 version is even earlier and requires a PR40 printer, the output from which was 40 columns wide. [An ancient non-CBM thermal printer popular in the days before Commodore made its own printers - Tim Arnot]. For some reason that has vanished into history ;-

Miniwordpro

From March 1982, this will only allow the creation of one screenful of 40 column text at a time, but it can manage lower case printout. Again, there is a large margin on my 8023.

Wordprocessor

This has linewrap, but is 40-column and tape only. Editing is very awkward.

Word Pro TH2058

There are various modules for editing and printing and a machine code  program as well. The instruction file, 'word p demo', describes its formatting capability at great length. Another 40-column program with linewrap. The exit key is <shift><clr/home>. Text is saved as program files.

On disk U2 are:
Line Processor

This drives a DEC printer or a Selectric out of the user port. You exit by typing £, (chr$(92)), <return> at the beginning of the next line after the end of your text. I hope that's clear! This must be a very early program judging by the fact that it specifies using a Selectric. l'm guessing about the user port but it looks likely from a brief shufty at the listing on screen.

Textwriter

From December '82, this will print out a specific number of text lines which is fixed by the program. No more and no fewer, even if there's nothing in them. The method of exiting is not clear.

On disk CF:
Typewriter

Dating from October 1980, this turns your CBM/PET into an electric typewriter. Type in a line, hit return, and it's printed out. Doesn't save.

To be fair to some of the programs my 4022 may have been better suited to them than the 8023 that I was using whilst doing the tests.


From ICPUG journal May/June 1996

PET BASIC EXTENSIONS


BASICs 1 and 2 have a vocabulary of 75 words. BASIC 4 has more at 90, but to give added functions an extension is needed. The ones in the ICPUG library are:

PROCEP EDITOR, for 32K 80 column machines. A runtime extension. It can be found on disk B1 along with an instruction file.

COMAL V1.02 for the 8096, (more of a BASIC dialect - a complete runtime replacement) giving you 38692 bytes to play with. {See issue 6 printed journal 1995}. It can be found on disk L0.

BASIC AID for various machines. A programmers tool, on disks U1, SU, and A0.

DOS wedge a utility for disk commands, on disks U1, SU, and KenDisk3

Procep Editor

This came from Commodore France. It occupies 4K of memory just below the screen, the same place as BASIC AID, so they can't be used together.

All Procep Editor instructions begin with &, (chr$(38)), and they'll work after a REM which doesn't exactly conform to normal programming standards. That caught me out a few times!

On KenDisk 11 there's a demo I've created, modifying my {spread}"sheet" program (a COMAL version is on KenDisk10).

The most obvious extension to BASIC 4 is a PRINT AT . . . USING statement, to allow output to be easily positioned and formatted, (like always having exactly two digits after the decimal point for money).

In Procep Editor this is achieved as follows:

&OUT n(j,i), x, y,"19999999.88"

The order instruction, data, co-ordinates, format is similar to the CBM printer system.

In COMAL the same thing is achieved like this:

PRINT AT x,y USING "#########.##": n(j,i)

the order of the component parts being: instruction, co-ordinates, format, data

Procep Editor also provides a field entry system, allowing input into a specific area of the screen. When a field is filled to its length limit it flashes. Overfilling a numeric field clears it for re-entry, but if a text field is overfilled the extra gets ignored.

Another feature is the ability to save a screen to disk as an 8K program file which, when called up later, is POKEd direct to screen. Obvious uses would be to implement menus and help screens while at the same time cutting down on memory use. In the "sheet" program I created sixteen help screens by this method.

The help and advice screens used the instruction &SP "file name" to save the screen to disk after construction.

Procep Editor will also draw horizontal and vertical lines with a single command using co-ordinates. For example, to draw a border around the screen:

10 &LINE 80,0,0: REM top line instruction length, x start, ystart
20 &LINE 80,0,24: REM bottom line
30 &COL 25,0,0: REM left side
40 &COL 25,25,0: REM right side

(0,0) is the top left hand corner of the screen, (0,24) bottom left, (25,0) top right, etc

Doing this without Procep Editor requires a lot more typing.

More About COMAL

As mentioned before the standard IF . . . THEN conditional instruction is enormously enhanced in COMAL, in three separate ways. First, the CASE structure. This saves a long list of IFs where the variable being tested can take several different values, each of which requires a different instruction (or set of instructions) to be carried out.

0010 CASE (expression) OF
0020 WHEN (first list of possible values of expression)

0030 // what to do when the expression has one of the values in that list
 {// is a comment, COMAL's version of REM}
0040 WHEN (second list of possible values)

0050 // what to do when the expression has one of the values in the second list
(lines 40 and 50 can be repeated)
0060 OTHERWISE
0070 // optional specification of what to do as a last resort
0080 ENDCASE

The 'expression' can be any numeric or text expression, not just a single variable.

Secondly, an extended IF structure which allows blocks of code to follow each condition and also allows an OTHERWISE block to be executed if none of the previous conditions are satisfied:

0010 IF (condition 1) THEN
0020 // option 1 stuff possibly several lines long
0030 ELIF (condition 2) THEN
0040 // option 2 stuff
(lines similar to 30 and 40 can be repeated)
0050 ELSE
0060 // option 3 as a last resort
0070 ENDIF

And finally:

0010 WHILE (something is true) DO
0020 // lots of stuff probably on lots of lines
0030 ENDWHILE

This is a do routine until something happens. However, because the test comes at the start, the lots of stuff might never get done at all.

Looking through the COMAL listing for the "sheet" program there's a lot of CASEs with IF . . . THEN lines inside the options. To use Procep Editor instructions after THEN they must be preceded by an ampersand.

Basic Aid

BASIC AID is a programmers' tool that incorporates the DOS wedge.

[Explanation of "wedge": Provided the relevant part of the operating system is stored in RAM (i.e. provided it can be changed), it is possible to insert a JUMP into the code at precisely the point where an instruction has been accepted, but has not yet found its way to the interpreter to get carried out or rejected. The code to which this JUMP leads can be used to interpret any number of 'new' commands, which would have been rejected as unrecognized by the main interpreter. Non-'new' commands are simply passed straight back for the operating system to deal with. The thin end of the wedge is a three-byte instruction inserted into the operating system (of which probably on/y two bytes need to be changed). The fat end can be as large as you like. The fat end code for the new interpreter can be hidden somewhere like a cassette buffer, (which was never widely used even when these machines were at the forefront of technology), or at the top end of the BASIC memory. BASIC can then be fooled into thinking that memory does not exist, so must not be used. The user need not be aware of any of this - he simply seems to have an extended BASIC language at his disposal. Jonathan Cooley]

AUTO(xx) will automatically number the lines in the program you're creating (hint!) in steps of whatever (xx) you like.

RENUMBER (start xx, step nn) tidies things up afterwards when you've finished, or more commonly when you need space to insert a routine among a block of lines which have consecutive numbers! In BASIC AID the GOSUB and GOTO target numbers are dealt with as well as the numbers at the start of each line of the program.

DELETE (n1-n2) deletes unwanted bits between the numbers chosen.

MERGE "program name" will merge a program or more likely a subroutine or program fragment off disk into the program being worked on (hint again!).

(The above extensions are built into COMAL)

FLIST "program name" lists a program from disk on to the screen without affecting the rest of the current memory.

FREAD "seqential file name" does the same thing for a SEQ file.

SPOOL "file name" dumps a file direct to the printer.

There are more commands available in BASIC AID but these are the ones I use most often.

Correction

To rectify what I wrote back in issue 6 last year, (printed journal 1995), about using printer secondary addresses with COMAL, this routine is equivalent to 1,4,7 sub from page 79, issue 1 this year: (1996)

0060 PROC printontext
0070 SELECT OUTPUT "LP"

0080 OPEN FILE 4,"",UNIT 4,7,WRITE
0090 WRITE FILE 4 : ""
0100 CLOSE FILE 4
0105 ENDPROC

In the main program any output using PRINT ends up on paper until:

0110 PROC printofftext
0120 SELECT OUTPUT "DS"
0130 ENDPROC

Having been 4040-to-8050ing some C64 stuff and then altering the loading address to get it into my 8096 to see what was usable for the library, l thought about comparing the task with COMAL's ability to save a program as a sequential file that can then be ENTERd (or MERGEd), ignoring the load (or start) address.

I checked with Brian Grainger that a C64 with a 1541 disk drive using COMAL could use sequential listings created on a CBM/PET with a 4040 disk drive and vice-versa. It seems that any bits that the version doing the reading didn't understand would be flagged out, by sticking in a REM (or // in COMAL) in front of any problem lines, before the process continues. These bits can then be adapted or altered later at leisure. Being a SEQ file the listing can be loaded into a word processor perhaps into an article for the journal?


       

TOP