%OP%BON
%OP%PL70
%OP%BM2
%OP%LM0
%OP%HE///@T@
%OP%FO//@P@//
%OP%DEZ189A  Typewriter Doc.
%CO:A,12,72%%C%%H2%%H1%Z189A TYPEWRITER%H1%%H2%

These instructions are the result of just critisism of the original and 
incorporate suggestions for improvement and text by Philip Hodson 
(0713).

NOTE the symbols | and # are used to represent diamond and square keys, 
~ introduces special keys such as ~L ~R ~U ~D the four cursor keys. 
Also ~E enter ~S shift ~X delete.

This is an programme which enables a Z88 and printer to function as a 
typewriter.  In other words, what you type to the screen appears on 
paper almost immediately. Assuming the paper being in your printer 
which is connected to the Z88, of course. There are two different 
versions of the programme. 

Version 1 Z189E which is refered to as TYPElite is very simple and was 
designed on the assumption you would be watching the paper as much as 
the screen. It probably works best with Daisy Wheel printers and for 
brief typing. Facilities are limited but it is small, it can be named 
anything, it is TYPElite. 

Version 2 has been superseded by Version 3 which includes "assiciated 
files". Version 3 can be used for brief work and for drafting longer 
articles if you like to be able to see on paper what you have typed. 
This is achived by the new feature of "Copy Line" where text is sent to 
the printer and a file on line at a time. The file can then be loaded 
in PipeDream or QuickEdit for editing.

Do not be put off by the length of this document. It is detailed for 
the learner to understand. Basic instructions are given to get you up 
and running, detailed descriptions are given later.

%H2%BUT FIRST......%H2%

You will have been supplied with five files Z189A Z189B Z189C Z189D and 
Z189E. Z189A is this document. Z189 B C D and E are BASIC files which 
you should be able to LOAD"Z189B" and LIST . If they give "Bad 
programme" they have been corrupted somewhere along the line. Try 
reloading them before you re-request them from the Library. Z189 B C 
and D have been modified so that they need to be in a directory called 
LIBRARY (which you must create if you have not got one already) and 
must retain there current names. If you wish to rename them you will 
need to refer to the section on RENAME and ALIAS.

Next select BASIC #B. Select the Filer #F and select the directory 
called LIBRARY to find the Z189 files. Press ESC to return to BASIC.

%H2%Running Z189B TYPEwriter.%H2%

1) It is assummed that you have an appropriate PrinterEd printer driver 
setup for PipeDream. TYPEwriter accesses that driver in the same way as 
PipeDream and only the same effects can be produced. See EDITING 
DEFINITION FILES for more details. Connect your printer to the Z88, 
load it with paper and switch it on-line.

2) Type:  CHAIN "Z189B" and ENTER . As you RUN Z189B TYPEwrit, you will 
see a message that it is creating a default Definition file which is 
called typeDEF.1   Z189B does this by CHAINing in Z189C. (If you now 
press #F you will now see a a new file called typeDEF.1)
%P0%
This done, Z189C TYPEdefX is of no further purpose and may be archived.
(Saved elsewhere and deleted from the Library directory). See DEFAULT 
DEFINITION for details.

3) Back to TYPEwriter.. The programme now tells you that it is a:-
  Programme to drive a printer as a typewriter
  TYPEdef.1 Default
  Input number of DEFinition File required 1 to 1?
At this stage you have only got TYPEdef.1 otherwise named Default so 
type 1 and ENTER
 
4) Next you are asked :-
Do you want to edit settings? Y/N     enter N for Y see EDITING 
                                              DEFINITION FILES

5) %H2%This is the start of a Session%H2%. From this point TYPEwriter will work 
according to the DEFinition file settings. You are then informed :-
Defintion file selected   = Default
Copy Line file is         = :RAM.0/COPYplain.txt }See EDITING DEFINITION 
Printer Driver File (PDF) = :RAM.0/your.pdf      }FILES d)
 and asked
UPDATE PDF? (Y/N) ?    enter N as I bet your PrinterEd file is not 
                       called :RAM.0/your.pdf !

6) then you are asked :-
 BUFFER TEXT? None Word Line Copy Line (N/W/L/C)?  
Enter any one of those letters. I would suggest N for a start and press 
ENTER.                See BUFFERING for more details

7) The following appears :-
Select Highlight Codes UBXILRAE (F = finished)
Codes selected =                                  Current cpi = 10
            CODE
Press F    see PRINTER CODES for details of the other options.

8) %H2%This is the start of the Sub-Session%H2%. FROM NOW UNTIL YOU PRESS |Q 
THE PRINTER IS IN USE: THIS MAY PREVENT PRINTING FROM OTHER PROGRAMMES 
SO USE |Q WHEN YOU ARE FINISHED. Buffering and Highlight codes can only 
be changed by ending the Sub-Session and selecting new values.

Now four windows appear. You are now ready to start typing, and if you 
selected N the printer will almost immediately start to print your 
keystrokes.  Note that in some printers however, there may be a short 
delay or they may hold a line or more in their buffer. For further 
details see WINDOWS and EDITING TEXT.

Near the end of a line typed, you will hear a beep to tell you that you 
have 5 character spaces left.  (See EDITING DEFINITION FILES c) iii) )
So finish your word and press ENTER to move to a new line.  If you do 
not do that, your printer will just carry on the same line as far as it 
is able.

9) Press |Q to leave the windows and terminate the Sub-Session. THE 
PRINTER IS NOW NOT "IN USE" SO OTHER PRINTING WILL NOT BE AFFECTED.  
You then have the choice to Continue/New printer/Finish (C/N/F) . C and 
ENTER returns you to step 5 which would be a new Sub-Session. N and 
ENTER returns you to step 3) which would be a new session. F and Enter 
returns you to the BASIC > prompt which terminates the programme.

This is the end of the General Section for %H2%Running Z189B TYPEwriter.%H2%

                          **********            
%P0%
%H2%Running Z189D TYPElite%H2%

This original programme has been retained because!
1) It may be all people need, crude as it is.
2) It is much smaller, 1.8K compared to the 10.8K "all up" figure of 
its sibling. 3) Anyone who wants to rework the programme to give a 
better TYPElite or faster/smaller TYPEwrit may find it easier to have 
the original!

You may need to edit control codes when using TYPElite because they 
are part of the programme and not in a definition file. The relavant 
codes are probably only Backspace (bs) and Print Character (pc).  To 
make the editing simpler these have been put on short lines of their 
own.

To edit them, LOAD TYPElite into Basic; Type LIST, press ENTER, observe 
lines 60 bs%PC% = 8 (this refers to the most usual code for Backspace)
      70 pc%PC% = 8 (pc = Print Character.  This tries to force the 
                  printer to print instead of buffering).

Press ESC, and rewrite those lines as required e.g.:
type:
      60 bs%PC% = 127  (a possible alternative code for backspace.  Look 
                    in your printer manual to see what it needs and 
                    enter that value.)
      70 pc%PC% = 163  (another possible alternative value for Print 
                    Character).
      
Think up a name for this adjusted Basic programme; 
then type SAVE "name"   and press ENTER to save your adjusted version 
of TYPElite.

Type RUN, or next time CHAIN your new file by its name (between 
quotes). Choose Buffering as in 6) above and enter 0 for the codes. See 
section on PRINTER CODES for more details.

This is the end of the General Section for %H2%Running Z189E TYPElite.%H2%

  
%C%%H2%%H1%R E F E R E N C E   S E C T I O N%H2%%H1%

%H2%RENAME%H2%

To rename the files do the following. (if you want B = TYPE : C = DEF :
 D = EDIT) First in BASIC *RENAME Z189B TYPE etc. Then LOAD"TYPE" 
then LIST IF CHAIN and press the spacebar until the ">" prompt returns. 
You should get something like:-
   60 IFD%PC%=0:CLOSE#D%PC%:CHAIN"LIBRARY/Z189C"
Retype or edit the lines to replace LIBRARY/Z189C with LIBRARY/TYPE 
(take care not to alter anything else) etc. Then SAVE "TYPE". Do the 
same for the other two files but with the appropriate name changes.

%H2%ALIAS%H2%

The alternative is to create a directory in the same RAM as LIBRARY 
which for example could be called BASIC.GO . Use PipeDream to create 
the following file which you save as TYPE with plain text option. 
#I|CARD#T#I~D~D~E#F|SI|D/LIBRARY~E|[#I~U~U~R~ECHAIN"Z189B"~E
If you keep a PipeDream on the Suspeneded Activities list called 
BASIC.GO which contains lines of text to the effect #F|EXtype = 
Typewriter etc. you can set up a launcing point for all your LIBRARY 
programmes.
%P0%
%H2%DEFAULT DEFINITION%H2%

The function of Z189C, TYPEdefX. is to create a default Programme 
Printer Definition file. Once that file exists you do not need Z189C 
anymore. TYPEdef.1 could have been supplied instead but this way it is 
easier for others to develop the programme. 

%H2%EDITING DEFINITION FILES%H2%

(Note throughout the DEFinition editor you will be shown the current 
value and be given the chance to supply a new value. Pressing ENTER 
will keep the current value without you having to retype it.)

TypeWriter uses DEFinition files to syncronise its behaviour with that 
of PrinterED and to change other defaults without having to edit BASIC. 
You have the option to create your own definition files which will have 
descriptive names within TYPEwriter, but will be called TYPEdef.1 
TYPEdef.2 etc. within filer. The internal names can be anything you 
wish e.g.Envelopes, Labels, My New Book, Epson LQ 1050 A3 etc.  You 
would want to do this if you have a number of different types of 
printer, or special needs in terms of highlights, or page margins etc.

a) Do you want to edit settings Y/N y
   Current Name XXXXXXXX:
   New Name (ENTER to edit this file) YYYYYYYY
you can either edit this file by just pressing ENTER or supply a new 
name which will result in an additional TYPEdef file, (but see e below) 
which will take the next number in the series say .2 

b) Alter Highlight Settings Y/N? Y
The main purpose of this first section is to get the programme in 
harmony with your Z88 Printer Driver #E. If your printer works at 12 
cpi as standard then here is the place to alter the settings. Apart 
from the default cpi. for each of the eight highlight codes (as in |PB 
in PipeDream) you can supply :-
i) A name (this is initially the same as in PrinterEd but if A no 
longer means alternative font but 16.7 cpi you can call it 16.7 cpi)
ii) Changes pitch to Zcpi. If Z = 0 this means that it does not change 
the pitch (for instance you would not expect Underline to also change 
to 15cpi!) Other values mean that it does change the pitch to the value 
given.
iii) Off at C/R Yes or No. This should match the setting in PrinterEd. 
The reason is that TYPEwriter uses the chosen highlights for the whole 
Sub-Session and if it sends codes at the wrong time you will not get 
the right results! You can lie of course but the results will be odd.

c) Alter Control Code Settings
The Control codes section sets the codes used by TYPEwriter for:-
 i) backspace, usually 8 but you may find 127 does the same!
 ii) the "Print Character" if you want text printed out as you type 
(see buffering later). Your printer will either oblige, or hold it in a 
buffer until it gets one of several codes CR LF BS or DEL. If this code 
is not zero the programme sends a space (dummy character) followed by 
the code. Obviously CR and LF (13 and 10) are no use in causing a 
charcter to print, but 8 or 127 may do the trick. Mark's typewriter 
will oblige with text when he uses code 8 but refuses to print any 
spaces until it is followed by some text!
 iii) code for Bell in case you do not want the Z88 to beep when it has 
a message!  i.e enter 0 in lieu of 7.
%P0%
 iv) The (left) margin in 10th's of an inch.  This prompt is of 
interest where you have decided you want a TYPEdef file to be used 
solely for eg typing up envelopes, and you know you want a margin of eg 
3 inches then you would enter 30.
 v) The TOTAL carriage width in 10th's of an inch, including the 
margin. Rightmargin = e-d.  This would be important if creating a 
TYPEdef.X file for labels with a limited width.
 vi) The length of the sheet in lines. If your PDF has a code for End 
of Page then this will only affect when you get a warning, if not it 
will affect how many lines the printer driver sends to your printer.
NOTE iv,v and vi can be altered in the main run so you need only have 
your main preferences. (ie in the WINDOWS section with |S)

d)Specify COPY and PDF filenames.
 i) BUFFERING Option C sends text to the printer and also to a file 
named in this section (default name=:RAM.0/COPYplain.txt). This is a 
Plain Text file which can be loaded into PipeDream or QuickEdit, as 
plain text, and edited as you wish. You might prefer to type in here 
:RAM.1/Booktxt , if you are writing a book etc. The file will either be 
created or appended to as required and will be time and date stamped.
 ii) Next you can give the name of the associated PDF. With this the 
programme can (if required) update PrinterEd automatically. In doing 
this it creates and deletes a file called :RAM.0/E.CLI which you may 
reconise from the BASIC line editor. The second thing it does is invoke 
PrinterEd and also KILL it afterwards. If you habitually keep PrinterEd 
active you may not wish to use this option. A non-existant file will 
ensure that the option is inactive(ish).
 iii) Both associated files are checked for "Bad filename" but not for 
the existance of RAM:DIRECTORY/orFILE . These are covered in Typewriter 
because you could always change these between now and when they are 
used!

e) Saving the edits
You are then asked if you wish to save the definition file which you 
have just been editing. If you say Yes and you did not alter the name 
it takes the same number as you selected at the start of the programme, 
else it takes the next number in the sequence. 
If you say No it saves it as TYPEdef.0 which is a temporary file which 
will be overwritten. You can RENAME it in FILER if you decide later 
that you want to keep it. If you have a gap in the number sequence of 
TYPEdef files TYPEwwriter will not reconise the existance of the others 
until the gap is filled i.e. 012356 will result in 123 being reconised 
until either 4 is recreated or 6 is renamed 4! 0 is never reconised!

f) When you have a stable set of TYPEdef.'s you can archive TYPEedit.

%H2%BUFFERING%H2%

When the programme asks if you want to 
BUFFER TEXT (%H2%N%H2%one %H2%W%H2%ord %H2%L%H2%ine %H2%C%H2%opy Line), which means that: 
1. Characters are sent either immediately on pressing a key, (None = no 
buffering - attempts can be made to prevent the printer buffering by 
use of the "Print Character". See Definition file editing c) ii) ):
2. After a space or TAB (5 spaces not to a tab stop) (Word = characters 
are sent only after a space of TAB). 
3. Only after ENTER, (Line = characters are sent only after pressing 
ENTER to start a new line of text). 
4. As 3, but text is also sent to the Copy Line file (See EDITING 
DEFINITION FILES d) (Copy and Line)
%P0%
To select these options, type:
  N for None : W for Word : L for Line : C for Copy to file & Line 
Whether text is sent or not affects what can be done to it 
subsequently while it is still on the screen. SEE EDITING TEXT

%H2%PRINTER CODES%H2%

Next it asks for the Highlight codes you want applied for the 
sub-session and as they are selected the name supplied in DEFinition 
file is shown at the bottom. ENTER confirms your choice and the codes 
selected are shown on the line above the cursor. The current cpi 
(characters per inch) in use is also shown.  
   %H2%Highlight codes and their default names are listed below.%H2%
 U = Underline           B = Bold            X = Extended Sequence     
 I = Italics             L = Subscript       R = Superscript     
 A = Alt. Font       (NB also defined 12 charcters per inch (cpi)
 E = User Defined    (NB also defined as 15 cpi)
 F = Finish          THERE IS NO ENTER TO CONFIRM ON THIS OPTION

F finishes this menu and is valid as your first and only choice. i.e if 
you wish to make no changes, or have made sufficient, press F. This 
causes you to reach the typewriter screen, which is what the programme 
is all about.

AT THIS POINT THE PRINTER MUST BE SWITCHED ON. THE COM PORT IS IN 
USE, MAKE APPROPRIATE ARRANGEMENTS BEFORE THIS POINT! The comms port is 
released when you quit |Q.

%H2%WINDOWS%H2%

This has four windows, Beautiful aren't they!. 
All width measurements are in 1/10ths of an inch which may be marked on 
the type bar of your printer. Lenghts are in lines.

%H2%Top left is the TEXT window:%H2% 80 characters wide and wraps to give up to 
255 characters per line on the paper. You can only see one line at a 
time but you can move back along it to the begining with the left 
cursor as backspace or by using DELete when you are in "buffered text". 
The line length of 255 characters is a restriction of BASIC were 
strings this maximum length. Who can put 255 characters on a line? 
20cpi and a wide printer can achive it in 12.75" and why should I put 
in a lower limit than that?

|F sends a Form feed to the printer driver which will either send it 
to the printer, or send the required number of lines as defined by 
"Lines" which you entered in the top right-hand window. (End of line is 
india Continue, puts you back to 
the buffering question and Finish the Basic prompt. (RUN would get you 
back to the very start from the BASIC prompt). 

%H2%Top Right Window: Settings%H2% This shows the Margin; Line length and page 
length You can reset the Left Margin, the Page Width, and the Page 
length by pressing |S. If you want to keep the current value(s) just 
press RETURN at the prompt. First this invites you to enter the new 
margin, eg 5, or 15 etc.  (When you do this, any margin set will affect 
the cursor position in the left hand window).  So, enter a figure, 
press ENTER. Similarly set the page width, eg 80 characters,  and the 
page length eg 60 lines. 
%P0%
Margin is only effective from the next carriage return, Carriage and 
Lines are effective immediately, but the warings are not checked for if 
they are appropriate. 

%H2%Bottom Right Window:%H2%  Indicates the lenght of the line as: the number 
of characters on the line and the number of columns (at 10 per inch) so 
that you can position yourself from the markings on the type bar of 
your printer. Also given is the number of lines typed since |F.

%H2%Bottom Left Window:%H2%  Information and Messages. Also EDIT options. Shows 
your choice of Buffering, Type pitch and Highlight codes. 

%H2%EDITING TEXT%H2%

The edit options often result in messages. Text can exist in two 
states, OUTPUT (sent to printer) and BUFFERED (still in the Z88) What 
can be done to it is influenced by this. You can backspace (left 
cursor) over any text and can overtype any text (but with a different 
results). A message is given as appropriate. DEL only works on buffered 
text as does |U.  So there will be a message if you attempt to use 
these on text already printed.  

Overtyping the buffer will replace one letter with another. Overtyping 
printed text will give, on the paper, two letters on top of each other, 
unless you get the Tipex out first. 

|U will insert a space into buffered text, this can then be overtyped 
with the character you want to insert, if it is not a space.

|R will put you at the end of the line. You do not need to |R before 
you press ENTER, or |F; and they do not carry the buffered text to the 
next line. There is no right cursor so if you have overshot you have to 
|R relocate and backspace again.

%H2%ROLL CREDITS%H2%

Mark hopes that is all the facilities anyone really needs, (though the 
associated files were added after Mark had made that statement) and no 
doubt someone somewhere can produce a slim trim version to displace 
TYPElite and TYPEwrit.

If there are any bugs please let Mark know, athough he cannot promise 
to fix them promptly, and updates will be via the Library.

Programme by Mark Foweraker 21 Heol-y-Ddol, Caerphilly, Mid-Glamorgan, 
CF8 3JF
Z189A Notes edited by Philip Hodson (0713) and revised for Version 3 MF
%CO:B,12,60%%CO:C,12,48%%CO:D,12,36%%CO:E,12,24%%CO:F,12,12%