PRETTYPRINT writes a string pointed to by an osword control block. In addition, there are some special properties that it looks out for:

To use a dictionary entry, place a CHR$ 27 followed by an entry number to look up in the range 1-255 (the entry '0' is used to look up the 'special string' pointed to by XY+8).

There is a default dictionary, which doesn't contain all 255 entries, but you may of course specify your own 'User dictionary' if the application you have in mind uses a lot of the same strings. e.g. a chemistry related program.

Effectively, this will result in text being compacted since whole words are replaced by just two bytes.

Dictionary Format

Dictionary entries may recursively refer to other dictionary entries, nested no deeper than 32 levels (otherwise the stack overflows). The first byte of the entry points to the next entry, then there's text terminated by a 0 byte. So for a file of N strings:

<1STstring$of255chr$orless><00>
<2NDstring$of255chr$orless><00>
   :                          :                        :
   :                          :                        :
<(N-1)THstring$of255chr$orless><00>
<00><00>

Default Dictionary
00=>
01=>"Syntax: *"+
02=>" the "
03=>"director"
04=>"filing system"
05=>"current"
06=>" to a variable. Other types of values can be assigned with *"
07=>"file"
08=>"default "
09=>"tion"
10=>"*Configure "
11=>"name"
12=>" server"
13=>"number"
14=>"Syntax: *"++" <"
15=>" one or more files that match the given wildcard"
16=>" and "
17=>"relocatable module"
18=>CR+"C(onfirm)"+TAB+"Prompt for confirmation of each"
19=>"sets the"
20=>Syntax: *"++" []"
21=>")"+CR+"V(erbose)"+TAB+"Print information on each file "
22=>"spriteLandscape [ [ [ []]]]]"
23=>"is used to print a hard copy of the screen on EPSON-"
24=>"."+CR+"Options: (use ~ to force off, eg. ~"
25=>"printe"
26=>"Syntax: *"++" "
27=>"select"
28=>"xpression"
29=>Syntax: *"++" ["
30=>"sprite"
31=>" displays"
32=>"free space"
33=>" {off}"
34=>"library"
35=>"parameter"
36=>"object"
37=>" all "
38=>"disc"
39=>" to "
40=>" is "

Robert Sprowson, EUG #40