home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 1: Collection A
/
17Bit_Collection_A.iso
/
files
/
265.dms
/
265.adf
/
WordWright62.doc
< prev
Wrap
Text File
|
1988-07-25
|
66KB
|
1,292 lines
´3 to tmargin
6 to bmargin
63 to footer-line
40 to page-pos
7 to lmargin
5 to rmargin
15 to indent
78 to columns/line slow²
àINTRODUCTION TO WORDWRIGHTÿ
´"Wordwright documentation" to footer-string²
· Wordwright is made up of a collection of four integrated packages,
a word processor, an outliner, mail merge, and a set of general purpose
utilities. A few of the more unusual features of Wordwright are listed
below.
1. Wordwright is fast enough that characters may be entered at the
beginning of a forty page document as fast as the auto repeat feature of
the Amiga allows with no noticable slowdown.
2. A table of contents may be generated automatically.
3. Cursor control is accessable from both the keyboard and the
mouse. A scroll bar is included to allow easy movement over long
distances.
4. User definable macros allow common phrases to be entered with a
single keystroke.
5. Calculations may be embedded within text. Conditional statements
allow the value of a flag or calculation at print time to determine
which of two phrases to print.
6. Extensive use of color is made to distinguish between commands
and text, highlight strings found in the search mode, etc.
7. An outliner is included as an integral part of the word
processor, allowing the user to expand and collapse either individual
sections or all sections. This makes it easy to see the structure of the
entire document as it is being written.
8. The mail merge program allows multiple copies of a document to
be made with automatic substitution of integer and string variables by
data obtained from a merge file. In addition, decisions can be made
concerning whether to print a letter or not based on tests made at print
time. For example, if data in the merge file contains information
concerning the employees of a company, it is possible to write a form
letter to just those employees in a particular department.
9. A utilities window contains a decimal or hexadecimal calculator,
a dump utility which can dump any area of memory in both hexadecimal and
ascii, and access to all DOS utilities.
10. A screen saver turns off the screen after several minutes with
no input from the keyboard.
àCHAPTER 1: GETTING STARTEDÿ
This first chapter describes a few of the basics that must be
mastered before you can do anything usefull with Wordwright. After you
have mastered this chapter, there is no reason to read the documentation
in the order in which it is written and you are encouraged to jump
around from one topic to another as your interest dictates. The
information in this chapter though is of such importance that you should
at least master this chapter before going any further.
áBACKUP PROCEEDUREÿ
The first thing that you should do when you receive any software is
to make a backup. The instructions for making backups are included in
the documentation that came with the Amiga. I strongly recomend that you
make at least two backups and keep them in separate locations. The 3 1/2
inch disks which the Amiga uses have such a high density that a very
slight difference in alignment between the disk drive used to write the
information and the drive used to read the information will cause the
disk to be unreadable. Since the disk which I supply was created on a
different drive than the one which you are using to read it, the disk
which I supply will generaly be less reliable than one which is created
on your own disk drive.
I have noticed that software which I receive from Commodore can be
read from drive 0 but not from drive 1 on my system even though disks
that I create with drive 0 can usually be read from drive 1 without any
problems. Because of alignment problems, it is my policy to use drive 1
only for reading and all writing takes place on drive 0.
áMAKING A CLI DISKÿ
The Amiga actually comes with two different operating systems.
Workbench, the operating system which normally boots up when you first
get your Amiga is built on top of another operating system called the
CLI for Command Line Interface. The CLI operating system is far more
powerfull than the Workbench and is a more traditional operating system
than the Workbench. The Workbench operating system is essentialy a
subset of the CLI which has been modified to work by selecting icons
with the mouse instead of typing commands from the keyboard. In addition
to the fact that the Workbench contains only a subset of the commands
available from the CLI, it also takes up more memory because it is so
graphics oriented.
Wordwright was intended for advanced users who want the maximum
utility and are willing to pay the small price of typing commands
instead of pointing at icons. For this reason, it is written to run
under CLI instead of Workbench.
A CLI disk may be made from a Workbench disk by the following
steps.
1. Use Preferences to enable the CLI and save the updated
selections.
2. Reboot the system. The "System" drawer will now contain the CLI
icon. Select it to get into the CLI operating system.
3. Edit the Ðfile "S:Startup-Sequence", removing the lines with the
commands "LoadWB" and "endcli > nil:". The file may be edited either by
Ed (the editor that came with the Amiga) or by Wordwright. The disk will
now boot up with the CLI instead of Workbench.
4. Erase any files which aren't needed.
áSTARTING WORDWRIGHTÿ
Once you have the CLI running, you can look at the directory of the
disk which came with Wordwright by using the "DIR" command as shown in
the "AmigaDOS User's Manual". In addition to the executable file which
is labled "Wordwright", there are also some sample text files to help
you get started. Start Wordwright by running the command "Wordwright".
After you type "Wordwright" the computer will respond by opening a
window labled "UTILITIES". It will then display the copyright notice and
type a prompt (the greater than symbol ">"). The prompt indicates that
the computer is waiting for user input.
There are a wide variety of commands available in the "UTILITIES"
window, but the one of concern at this time is the command "edit". If
you still remember the name of a text file, you may read it into the
edit buffer and start editting with the command "edit filename" where
"filename" is the name of the documentation file. If you don't remember
the name, type "dir" just as if you were still using the normal CLI.
This command will open up a new CLI and display the directory. After you
have found the filename you may return to the "UTILITIES" window by
hitting the return key. Once you have the file displayed you may begin
playing with the various commands as shown in the rest of the
documentation.
You will probably want to read the entire documentation file
eventually, but for now, just jump from one command to another until you
get a feel for the commands which interest you the most. As long as you
have your backup copy stored in a safe place there's really no way to
cause any damage by hitting the wrong key. The only thing you should be
aware of at this time is that the print command will probably cause your
printer to behave strangely until you have customized Wordwright for
your particular printer. As soon as you have familiarized yourself with
the editor, you should see the section entitled "INITIAL PRINTER SETUP"
to see how this is done.
áSTARTING A NEW FILEÿ
If you want to start a new file, you must first determine whether
you are in the utilities mode or the edit mode. The mode is indicated by
the name of the window. If it says "UTILITIES" you are in the utilities
mode. If it says "WORDWRIGHT" you are in the edit mode. If you are in
the utilities mode all you have to do is type the word "edit" followed
by the return key. This will clear the edit buffer and put you in the
edit mode.
If you are already in the edit mode, type the escape key to get
into the utilities mode and then type "edit". I have predefined the
function key F10 so that it types the word "edit " with a single
keystroke. Unless you redefine F10 as explained in the section on
macros, you may thus start a new file from the "UTILITIES" window by
typing the two keys F10 and return, or you may start a new file from the
edit window by typing the three keys escape, F10, and return.
If you ever type the escape key from Wordwright either accidentally
or to use the utilities mode for some purpose, you may return to the
file from which you came by just typing ^E. (Hold the control key down
and type the letter "e".)
áREADING FILESÿ
Files may be read in either of two ways. If you are in the
utilities mode, the file may be read in at the same time the edit mode
is involked by just typing the file name after the "EDIT" command. For
example, to edit the file "SAMPLE.TXT", you would type "EDIT
SAMPLE.TXT". If you are already in the edit mode, you may read in a new
file by using the pulldown menu named "FILES". In this case, you will be
given the option of reading in a new file and overwriting any file which
is currently in the edit buffer or appending the new file to the end of
the file currently being edited. After the menu selection is made, the
computer will prompt you for the filename.
áSAVING FILESÿ
A file is saved by selecting the "SAVE" option from the "FILES"
pulldown menu. When the computer prompts for the filename to use in
saving the file, it will suggest using the name of the last file which
was read. If this is acceptable, just type "RETURN" or "ENTER" and the
computer will append the suffix ".BAK" to any file which has that name
and then use that name for the new file. Wordwright will never delete a
file unless it has the suffix ".BAK", ensuring that there is always at
least one backup. It is also a good practise to keep a recent backup of
any valuable file on a separate disk which is not stored near the
computer.
If you ever accidently select the "READ" option from the "FILES"
menu when you intended to save a file, just type "RETURN" with no file
name and the computer will abort the read attempt without destroying the
file which you were editing.
áPRINTING FILESÿ
A file may be printed by selecting the "PRINT" item from the
"FILES" menu. There are two options allowed from the menu. You may print
from the start of the file or from the current cursor position. In
either case you must supply some information before the computer starts
printing. The computer will first prompt you for the name of a merge
file if one is used.
A merge file is used to supply data which is inserted into form
letters. A description of how to use this feature is given in the
chapter on mail merge. For normal text editing, the merge file doesn't
apply and you may just respond with a carriage return.
The next prompt is a question asking whether to send the text to
both the printer and the screen or just to the screen. It is sometimes
usefull to send the text to just the screen in order to see how the
document will be formatted.
If text is being sent to the printer as well as to the screen, you
will be asked for the number of copies to print. You may either enter
the number of copies that you want and then type a carriage return or
you may just hit carriage return. If you just hit carriage return
without telling the computer how many copies you want, the computer will
assume that you just want one copy.
Whenever the computer asks for input but is capable of selecting a
reasonable responce of its own when no input is supplied, the input
which the computer can supply is called the default responce. Thus the
default value for the number of copies desired is one.
The printing may be paused and restarted by hitting the space bar
or may be aborted altogether by hitting the return key.
áLEAVING WORDWRIGHTÿ
You may leave Wordwright at any time either by hitting the escape
key or selecting the quit gadget in the upper left corner of the window.
This will return you to the "UTILITIES" window where you may use the
utilities provided or return to the operating system by typing "quit".
If you want to return from the "UTILITIES" window to the file which you
were editing, just type ^E and the return key. You will return to the
edit mode, the file will be redisplayed, and the cursor will be moved to
the same location it was at when you left the edit mode.
áINITIAL PRINTER SETUPÿ
Wordwright allows the user to set the control codes which are sent
to the printer in order to change fonts, begin underlining, change
between draft mode and letter mode, or any other special function which
the user desires. To make these changes, the user simply types the
command "SETUP" from the "UTILITIES" window. A series of command strings
will then be displayed and the user will be asked whether each string is
correct for the indicated function. Whenever the user indicates that the
string is incorrect, the computer will ask for the correct sequence.
When all of the command strings are correctly set for your printer, you
will be asked for a filename to use when saving the updated version. Any
filename is acceptable, but my suggestion would be something short and
simple like "WW" since editing programs and writing text are the most
common applications used on any computer.
áPROBLEMSÿ
I have tried to produce the best software that I am capable of and
I am continually making improvements both in Wordwright and in the
documentation for Wordwright. Unfortunately however, I haven't yet
achieved perfection and there are still some problems which you should
be aware of. I have listed some of the most common problems below with
the solutions when solutions are known.
Q. After editing some text, you leave the computer for about 5
minutes. When you come back, the screen is blank.
A. Wordwright contains a screen saver which automatically turns off
the screen after 5 minutes of no activity. Hit any printable character
on the keyboard and the screen will reappear.
Q. W²hen you start Wordwright, a message appears saying that the
memory is too fragmented for Wordwright to run. As soon as you hit any
key, the computer returns to the CLI.
A. Wordwright is designed to handle large text files with all text
being held in memory instead of on the disk because of speed
considerations and because I have a lack of faith in the ability of the
operating system to recover gracefully in the event of disk errors.
Wordwright can be set up to edit files up to 128K bytes in length in a
computer with 512K. This is about 40 pages of text. In addition to the
memory required to hold text, Wordwright also requires a large area for
the copy buffer, and the program itself takes up about 80K. I have thus
had to take over a large portion of the memory which is not being used
by the operating system in order to maximize the computer's utility as a
word processor.
If another program has been run prior to using Wordwright, the
operating system may have broken the availble memory into discontinuous
fragments which are not of sufficient length to allow Wordwright to
function properly. The operating system is not able to reconstruct
continuous memory from the fragments and the computer must be restarted
before Wordwright can be used.
If a large portion of memory is being used for other purposes such
as a RAM disk or a clock that runs in the background, there may be
insufficient memory left for Wordwright.
Some programs such as compilers are notorious for requiring a huge
stack in order to run properly. It has thus become a common technique
among programmers to include a line of code in the script file
"STARTUP-SEQUENCE" which tells the computer to allocate a huge amount of
stack space for each task. This will also cause the computer to have
insufficient memory.
The "setup" command which is used to set up Wordwright for your
printer allows you to set the amount of memory which is allocated for
the text file. If you want to run other programs concurrently with
Wordwright, you have the ability to create a version of Wordwright which
will require less memory than I have allocated.
Due to the structure of the language which Wordwright was written
in, Wordwright allocates its own stacks and makes no use of the stack
which is allocated for it by the operating system. The 4K which is
normally allocated for stacks is therefore more than adequate for
Wordwright. If you want to try using an even smaller stack, you should
first test the effect on other programs which you will want to run from
Wordwright (DIR, INFO, DELETE, COPY, etc.).
Q. When saving a file which has taken a couple of hours to produce
you get a system message saying that the disk has an error. You are then
asked whether you want to try again or abort the attempt. Regardless of
what responce you make, the computer just keeps trying over and over
again to save the file and will not allow you to abort the attempt or
try with another disk.
A. This is the most obnoxious problem that I have come across and I
have no solution since the problem is in DOS itself and not in my
software. When disks go bad there is very little that can be done to
reconstruct the data. DON'T depend on "DISKDOCTOR"! Errors almost always
occure on the track which is used to store the directory since this is
the track which is used the most. "DISKDOCTOR" can generally save only a
small portion of the disk.
Make sure you keep lots of backup copies of any important files. If
your disk drives have a tendency to cause errors, it is a good idea to
reformat your disks every once in a while even before they start to
cause problems. My experience has shown that a disk which has been
reformated recently is much more reliable than a disk which has never
shown any problems but has been used several times without being
reformatted.
It is also somewhat safer to print the document before trying to
save it on a disk. This way you will at least have a hard copy in case
the drive locks you out.
Q. Wordwright just doesn't do what you want it to do.
A. All software involves compromises. Wordwright was written to
solve my needs and if your needs happen to be the same as mine, I
believe that you will be very happy with it. If you have questions or
needs which I haven't satisfied, give me a call.
If I have solved the problem since you bought your copy of
Wordwright, I will send you the update at minimal cost. At the present I
am not charging anything for updates. This may change in the future but
I don't anticipate ever charging more than $5 to $10 for an update. In
any case, I welcome feedback and many of the features which are
contained in Wordwright now are the result of requests from my previous
customers.
Wordwright also comes with a one year guarantee. If at any time
within a year of purchase you decide that Wordwright doesn't satisfy
your needs, send me a note saying that all copies of Wordwright have
been destroyed and I will send a full refund. My address and phone
number are shown below.
RTL Programming Aids
10844 Deerwood SE
Lowell, MI 49331
(616) 897-5672
àCHAPTER 2: THE EDITORÿ
Now that the basics are out of the way, the fun can begin! In this
chapter you will learn how to move the cursor around, search for
strings, define macros, and start actually using Wordwright. From this
point on the features of Wordwright can be studied in any order that you
want so don't be afraid to jump around a little. Use the features that
you need and ignore the ones that you don't need. The important thing is
to use Wordwright.
áCURSOR CONTROLÿ
There are a wide variety of ways to move the cursor. For large
cursor movements, a scroll bar is included on the right margin. If
Wordwright is set up so that 128K of memory is reserved for the text
buffer, the entire length of the scroll bar represents 128K bytes of
text. Thus for a 64K text file only the top half of the scroll bar is
used. To move to the middle of a 64K file, you would use the mouse to
point to the location of the scroll bar which is 1/4th of the way from
the top and press the left mouse button. If you try to move past the end
of the file, the cursor will move to the end of the file and the scroll
bar indicator will move to the appropriate spot to indicate the
percentage of the 128K which is used by the file.
For smaller movements the mouse can be used by pointing the mouse
at the desired cursor position and pressing the left button. If the
mouse is pointed at the first or last line of the screen, the computer
scrolls in the appropriate direction.
Although the mouse is an excellant tool for moving the cursor
arbitrary distances, the arrow keys are usually more convenient for
moving short distances such as a single character or line. The unshifted
up and down arrows are used to move to the begining of the line above or
below the line which currently contains the cursor. The unshifted left
and right arrows are similarly used to move one character to the left or
right in the file.
If the shift key is held down while an arrow key is pressed, it
modifies the behavior so that the up and down arrows move the cursor a
screen at a time and the left and right arrows move a word at a time.
If the cursor is pointing to the right location of the document but
is at the top or bottom of the screen, it is sometimes usefull to be
able to rewrite the screen so that the line containing the cursor is in
the center of the screen. This is done by hitting Cnt-N (for normalize).
Cnt-T and Cnt-B may be used to quickly move to the top and bottom
of the file respectively.
áSEARCH MODEÿ
The search mode is entered by typing Cnt-S and is used to find a
particular word or string. When the search mode is selected, the
background color becomes lighter. If the background was black, it will
become grey. If it was dark blue, it will become light blue. As each key
is pressed the computer adds that character to the search string and
searches for the first instance of that string. If the string is found
the cursor moves to the string and the string is highlighted. If the
string is not found the cursor remains where it is. When the search mode
is first entered, all searches take place in the forward direction. The
next instance of the string may be found by typing either the right
arrow or the down arrow. The previous instance of the string may be
found by typing either the left arrow or the up arrow. Whenever the
direction is changed by typing one of the four arrow keys, the computer
remembers the direction. If any additional characters are added to the
search string to cause a new search to take place, the direction of the
search will be the same as the last search.
Characters may be removed from the search string one at a time by
typing the backspace key. When you want to leave the search mode and
return to the normal mode, type the escape key (labled "ESC").
áSEARCH AND REPLACE MODEÿ
The replace mode is entered by typing ^R and is identical to the
search mode except that the user is asked to type in a "replace string"
before the computer enters the search mode. Once the replace string has
been entered, type the "ENTER" or "RETURN" key to return to the text
window and enter the search mode. The search mode is then used in the
normal way to find and highlight strings. Each highlighted string may be
replaced with the replace string by typing ^R (hold down the key labled
"CTRL" while typing the upper or lower case letter "R").
áGLOBAL SEARCH AND REPLACEÿ
The replace mode which was just described is the safest way to
replace one string with another string since in that mode, the computer
allows the user to give confirmation before each string is replaced.
When you are sure that every instance of a phrase should be changed,
there is a much faster way of replacing the phrase.
The global search and replace command is involked by typing ^G.
When ^G is typed the computer requests the user for the search string
and the replace string. It then finds each instance of the search string
and replaces it with the replace string.
áEMBEDDED COMMANDSÿ
Much of the power of Wordwright comes from the ability to embed
commands in the text which will be executed when the document is
printed. Commands are distinguished from normal text by the fact that
commands are printed in yellow on the screen while normal text is
printed in white. You can change the color to yellow in order to insert
a command by typing Cnt-Y. When you want to return to the normal text
mode, type Cnt-W to change the color back to white.
áFORMATING COMMANDSÿ
Formating is done according to the values contained in a number of
variables which may be changed at any time by typing the appropriate
command in yellow. The following variables are included:
lmargin left margin
rmargin right margin
tmargin top margin
bmargin bottom margin
columns/line columns per line
lines/page lines per page
lf/cr line feeds per carriage return
(for single or double spacing)
In addition to these variables, the following commands affect the
way text is printed:
tof go to the top of form (next page)
section if you are near the bottom of a page
eject to the next page otherwise just
insert a line feed.
Cnt-J begin word wrap
Cnt-K end word wrap
superscript begin superscript
superscript-off end superscript
subscript begin subscript
subscript-off end subscript
fast draft mode
slow letter quality mode
áWORD WRAPÿ
When a document is being written, it is usually important to have
the maximum number of whole words on each line. This can become a
problem when text is later edited and words are inserted into or deleted
from the text. The result of inserting or deleting text can be some
lines with only a few words on them and other lines which extend past
the end of the screen (or past the right edge of the paper when the text
is printed). Word wrap causes the computer to find the best places for
line feeds so that the maximum number of whole words fit on each line
without going over the maximum number of character which will fit on one
line.
When word wrap is on, the computer will recalculate the proper
position for line feeds as characters are inserted and deleted from the
document. The display on the screen will be optimized for the best
looking display which can be generated for the given window size and the
size of the characters as selected by the "PREFERENCES" program.
Since the printer will often allow a different number of characters
per line than the screen will allow, the locations of line feeds and
spaces will be recalculated during the printing of text to correspond
with the variables, lmargin, rmargin, and columns/line.
Word wrap can be turned on or off by hitting Cnt-J or Cnt-K
respectively. Whenever Cnt-J is typed, the background changes to dark
blue to give a visual indication that word wrap is turned on. Whenever
Cnt-K is typed, the background changes to black to show that word wrap
is turned off. It is possible to turn word wrap on and off several times
at different locations of the text. In this case the background at
different locations will be different colors so that it will always be
obvious whether word wrap is on or off.
Word wrap is usually a desirable feature and will generally be used
in all text except those portions of text when you specifically require
the ability to determine the position of the line feeds yourself.
Examples of these situations are the use of Wordwright to write computer
programs or display columns of data. In the chapter on mail merge, it
will be seen that merge files depend on the position of line feeds to
distinguish between data items.
áJUSTIFICATIONÿ
When the computer prints your document, it can either space the
words as they are written on the screen or it can insert extra spaces
between some words so that the right margin is straight. Aligning the
right margin is called right justification. Right justification is
closely associated with word wrap and is always turned off unless word
wrap is turned on. In addition, right justification also depends on the
variable "justify". Thus if the variable "justify" is true and word wrap
is on, then right justification will occur, but if either "justify" is
false or word wrap is off, justification will not occur. Publishers
generally like to perform justification themselves and therefore prefer
not to have justification done by the author.
The "justify" variable can be changed by the code "true to justify"
or "false to justify". If you want the ability to go back and forth
between these settings, you may include this code at the start of each
document. If you will always use justification or will never use
justification, you may enter this code from the utilities window and
then run the setup command so that you may save the updated version of
Wordwright. In this case Wordwright will always start with the correct
setting of the "justify" variable.
áPRINT STYLEÿ
Italics, bold, and underlining are controled by toggling the
desired functions with alternate keys. For example, to print a section
in italics, you would place the cursor at the start of the section and
type ALT-I (hold down one of the two the keys labled ALT and press the
letter "I" or "i"). At this time all characters from the cursor until
the next ALT-I will be changed to italics. You would then place the
cursor at the end of the section and type another ALT-I to change back
to normal characters.
Bold and underlining may be performed in an identical manner using
ALT-B for bold and ALT-U for underlining. When any of these print styles
are turned on or off a single character control code is inserted into
the text. This control character is invisible on the screen except for
its affect on the print style but it can be shown to exist in the text
by its effect on the left and right arrow keys. If the cursor is at a
control key and the right arrow is pressed, the screen will not change
because the control code doesn't take any space on the screen. A control
code may be erased with the delete key or the backspace key just like
any other character and the screen will immediately be updated.
áHANGING INDENTÿ
It is sometimes desirable to have two alternate left margins and
have the active left margin toggle back and forth between them. This
technique is often used when creating a glossary and is called a hanging
indent for reasons which are not known to me. The following example will
show how a hanging indent is used.
OUTLINE MODEA mode in which only chapter and section headings are
displayed on the screen. This mode allows the user to see
the overall structure of the document without all the
distracting details. While you are in this mode, it is
possible to move entire sections with the same ease that
you would move sentences or paragraphs in the text mode.
A hanging indent is toggled on and off by typing Alt-M. In the
example just shown, I started the hanging indent immediately after the
words "OUTLINE MODE" and stopped it at the end of the indented
paragraph. The variable "indent" is used to indicate how many spaces to
adjust the left margin when the hanging indent is turned on. In the
example just shown, I set "indent" to 15 so the paragraph is indented 15
spaces to the right of the normal right margin. Since the new left
margin is positioned relative to the normal left margin, the variable
"lmargin" may be changed without affecting the hanging indent.
áHEADERS AND FOOTERSÿ
The variables "header-line" and "footer-line" are used to indicate
which line to place a header or footer on. Whenever the printer gets to
the appropriate line, a header or footer is printed. If you want the
header to be printed on line 3 you would set the variable "header-line"
to 3 with the command "3 to header-line". The command would have to be
started with ^Y and ended with ^W to show the computer that this is a
command and not just normal text. If you don't want a header or footer
just set the variable "header-line" or "footer-line" to zero. Since the
line numbers start at one, there will never be a match between the line
number and the "header-line" or "footer-line".
The header will print the string contained in the string variable
"header-string" which may be changed at any time with a command such as:
"This is the new header string" to header-string
As before, the command must be shown in yellow to be interpreted as
a command. The footer behaves in a similar manner except that after the
"footer-string" is printed, the printer moves to the column indicated by
the variable "page-pos" and prints the page number. In order to number
the pages on line 65, in column 39, with no footer message, you would
start your text with the command:
"" to footer-string 65 to footer-line 39 to page-pos
áTABSÿ
There are two ways to set tabs in Wordwright. The simplest way is
to select the pull down menu labled "TABS". This will open a new window
and will then prompt you for the correct tab settings. The weakness of
this approach is that the tabs must be set manually each time the file
is read in.
The second approach is to imbed commands within the text file
itself. The commands available for setting tabs in this way are:
clear-tabs removes all tab settings
set-tab set a tab
reset-tab remove a tab
The syntax for setting or removing a tab requires that the column
number of the tab must preceed the command. In the next example,
commands are shown which will set tabs at columns 10 and 20.
clear-tabs 10 set-tab 20 set-tab
If a form is being edited which has commands as shown above, the
commands will be executed whenever the file is reformatted by typing ^A
as well as when the text is printed.
áBLOCK COPYÿ
A copy buffer is used to store text which is to be copied to a
different location. Text is placed in the copy buffer by one of two
ways. Whenever a block of text is deleted by use of the delete mode or
by the block delete command, the text is placed in the copy buffer as a
safety feature to allow the recovery of the text if it is deleted
erroneously.
A second method of placing text in the copy buffer is to mark each
end of the block by placing the cursor there and typing ^X. The
background color will change to green when the first ^X is typed and
will return to normal when the second ^X is typed.
Once text is placed in the copy buffer, as many copies as are
needed may be inserted into the file by placing the cursor in the
desired positions and typing ^C.
áBLOCK DELETEÿ
A block may be deleted by marking the beginning and end of the
block with ^X as described above in the section concerning copying of a
block. After the block is marked and before any other key is pressed a
third ^X may be entered to delete the block. If any other key is pressed
between the second and third entry of the ^X, the block will not be
deleted and the ^X will be interpreted as the first ^X in another
attempt to mark a block of text and the computer will indicate this by
changing the background color to green. If a ^X is entered in error and
you don't want to lose the text which is already in the copy buffer,
enter a second ^X without moving the cursor. When a block of zero length
is marked in this way, the computer recognizes this as a mistake and the
copy buffer isn't changed.
áBLOCK MOVEÿ
A block of text may be moved from one area to another area by
combining the proceedure for the block delete with the proceedure for
the block copy. The block to be moved is first deleted. Before any other
block deletes are made the cursor is moved to the desired location of
the block and a copy is placed there by typing ^C.
áDELETE MODEÿ
The delete mode allows a fast way of deleting words or lines of
text. The delete mode is entered by typing ^D. While in the delete mode,
the characters are changed to a particularly ugly shade of pink (chosen
for good contrast not beauty) and the cursor will begin to flash on and
off. In this mode the arrow keys are interpreted as special delete keys.
The up and down arrows are used to delete text from the cursor to the
end of the previous line or the beginning of the following line
respectively. The left and right arrows are used to delete to the
beginning of the previous or following word. The computer will return to
the normal mode if any key except one of the arrow keys is pressed. It
will also return to normal mode after about two seconds without a key
being pressed.
The text which is deleted while in the delete mode is saved in the
copy buffer in case an error is made and replaces the text which was in
the copy buffer.
áMACROSÿ
The 10 function keys are available as user definable macros. In
order to see how the macros are currently defined or to change the macro
definitions, you must select the macros option from the "MISC" pull down
menu of Wordwright. The current definitions of the macros will be
displayed and you will then be given the oportunity to change any macro.
To change a macro, just hit the function key which you want to
redefine. As soon as this is done, the computer will prompt you for the
string to be associated with that macro. After the string is typed in,
the macro definition is finished by typing the escape key. When a macro
has been defined, the macro definitions will be redisplayed and you will
again be given the oportunity to change macro definitions. When no more
changes are desired you may return to Wordwright by typing the escape
key when you are asked to type a function key.
Any characters may be included in the macro definition except the
escape key which is used to end the macro. Although macros are generally
used to type frequently used text, it is also possible to define a macro
as a sequence of commands. For example, a command to move the cursor
down 3 screens and then search for the first instance of the word "the"
could be defined as a macro by holding the shift key down, hitting the
down arrow key 3 times, typing control S, and following with the word
"the".
It should be noted that some keys such as the arrow keys emit a
string of characters starting with the special control sequence
introducer 9B hex. Since this byte doesn't have a printable ascii
representation, the byte 9B is represented by a tilde (~) when the macro
definitions are displayed.
áHELPÿ
The help key is used while in Wordwright to provide on line help in
the form of information screens which summarize the commands which are
associated with the various control characters and display information
such as the current macro definitions. To use the help key, just hit it
while in the edit mode.
àCHAPTER 3: THE OUTLINERÿ
In addition to the word processing capabilities of Wordwright, an
integrated outliner is also included. The power of an outliner becomes
very apparent when a large document is being written. In the same way
that a word processor allows you to easily move words and phrases around
so that your sentences become clear and easy to read, an outliner
enables you to move entire sections around and clarify the structure of
an entire document.
áOPENING AND CLOSING SECTIONSÿ
The basic feature that gives an outliner its usefulness is the
ability to shrink and expand sections. By shrinking all the sections so
that only the section titles are shown, it is possible to shrink the
text file by perhaps a 15 to 1 ratio for a clear overview of the
structure of your document.
Cnt-F is used as a toggle to either shrink or expand an individual
section. If the cursor is at a closed section when Cnt-F is pressed, the
section will be expanded. If the cursor is at an open section when Cnt-F
is pressed, the section will collapse so that only the section title is
shown and the cursor will be moved to the beginning of the section
title.
Cnt-O (the letter not the number) is similar to Cnt-F except that
its effects are global. In other words, if the cursor is at an open
section all sections will be closed and if the cursor is at a closed
section, all sections will be expanded.
áCURSOR CONTROLÿ
The outliner is integrated with the rest of the word processor in
such a way that cursor control is identical in both the text mode and
the outline mode and is independent of whether sections are open,
closed, or a combination of the two. This includes cursor control both
by the mouse and by the keyboard.
It is usually much easier to learn by example than it is by just
reading so you are encouraged to try editing a text file at this time
and experiment with opening and closing sections and moving the cursor
while in the outline mode. The unshifted up and down arrow keys will
still move the cursor a line at a time and the shifted up and down arrow
keys will still move the cursor a screen at a time. However, since each
line displays an entire section in the outline mode, the cursor will
move a much greater distance in relation to the size of the file.
This can be seen clearly by noticing the effect of cursor movement
on the scroll bar. Moving up or down a single line in the text mode will
hardly move the scroll bar indicator. However, moving up or down a
single line while in the outline mode can cause the indicator to move
quite a large distance if the sections are large.
You should also try moving the cursor by means of the mouse. In
this case, the cursor will again behave in a similar manner independent
of whether the screen is displaying the file in the text mode, the
outline mode, or some sections in each mode.
If you enter the search mode and the computer finds a string in a
closed section, the section will be opened automatically so that the
string can be displayed. This is also true for text which is found by
moving the scroll bar.
A block of text may be moved, deleted or copied in either the
outline form or the text form. If you are in the outline mode and a line
of text is deleted by entering the delete mode and hitting an up or down
arrow key, an entire section can be deleted at one time. If this is done
by mistake, the entire section can be recovered by typing Cnt-C just as
it would be in the text mode.
áSTARTING A NEW SECTIONÿ
In order to use the outliner, each section header should be
highlighted on the screen. Wordwright allows a section header to be
highlighted by placing the cursor anywhere on the section header,
holding down one of the two keys labled "ALT", and pressing the letter
"S" (for Section). This will cause the section to be shown in inverse
video on the screen.
If the cursor is placed at a section title which is already shown
in inverse video and the Alt-S is pressed, the section will be indented
two spaces for each time Alt-S is typed. This indicates that the title
refers to a subsection.
In order for your document to look right, you must ensure that the
title of a section is never on one page and the begining of the text on
the next page. Wordwright will prevent this from happening as long as
the title of the section is written in inverse on the screen.
When a text file is printed, there is a distinction between
sections that are indented and sections that aren't indented. Any
section which is not indented will always start on a new page. This is
therefore generally used for the beginning of a chapter. If the section
is indented, it makes no difference how many levels it is indented
except for its appearence in the outline. Indented sections will start
at whatever location of the page you happen to be at as long as there is
sufficient space on the page to include the section title and at least
two lines of text. If you are too close to the bottom of the page for
this to be possible, the printer will eject to the top of the next page
before it starts the section.
The indentation is only shown on the screen to make the outline
easier to understand. No indentation will occure on the paper unless
spaces are typed into the section title by pressing the space bar.
áTABLE OF CONTENTSÿ
A table of contents may be generated automatically by simply typing
the command "contents" in yellow as the last command in your text. As a
document is being printed, Wordwright keeps track of the page where each
section starts. The command "contents" causes the computer to use this
information to generate a table of contents. Since the computer won't
know what page each section starts on until after the document is typed,
it is important that the "contents" command be the last command given in
the document.
àCHAPTER 4: MAIL MERGEÿ
I hardly ever go more than a month without receiving a "personal"
letter from some computer telling me what a great guy I am and how lucky
I am to be one of the few priveliged people selected to receive the
latest marvel of science for only $19.95 plus $3.00 for shipping and
handling. The letter will invariably mention me by name at least once
and it will also include some other personal information such as my
address to show that the letter was written by someone who really cares
about me.
Mail merge allows you to write very complicated form letters in
which the exact wording is modifed by data taken from a separate file
called the merge file.
áVARIABLESÿ
Two types of variables are supported in Wordwright, integer
variables and string variables. Each variable must be defined before it
is used with one of the defining words declare or declare-string. The
syntax for these commands is shown by the examples below. It is
important to remember that commands must be shown in yellow on the
screen or they will be interpreted as normal text.
declare gross-sales
declare-string first-name
In each case the defining word is followed by the name of the
variable which is being defined. The two types of variables have
different properties and will therefore be treated seperately in the
following sections. Any variable which is defined in a text file is a
local variable. This means that the variable will be removed as soon as
you leave Wordwright and any space which was reserved for the variable
will be returned.
áINTEGER VARIABLESÿ
Integer variables are 32 bits in length. This gives a range of more
than 2 billion in both the positive and negative directions. When a
variable name is encountered the computer normally returns the value
which is contained in that variable. For example if the variable "age"
has been declared and set to 10 the code "age =" would print the number
10. The action of a variable may be changed by immediately preceeding it
with the word "to" or "+to". The word "to" is the assignment operator.
This causes a number to be assigned to a variable. The code "25 to age"
would assign a value of 25 to the variable "age". The word "+to" behaves
in a similar manner, but instead of assigning a fixed value to the
variable, it adds to the number which was already in the variable. If
the variable "age" had the value 25, the code "3 +to age" would change
the value of "age" to 28.
áSTRING-VARIABLESÿ
Each string variable may hold a string up to 50 characters in
length. When a string is encountered, the normal behavior is to return
the address where the string is located. The command "print" is used to
print a string from its address. If the string variable "animal" is
declared and the string "cat" is assigned to "animal", the code "animal
print" will print the word "cat". Like the integer variables previously
discussed, the behavior of a string is also dependent on whether it is
preceeded by the word "to" or "+to". In this case "to" is used to assign
a string to the variable and the word "+to" is used to append a string
to a string which was already contained in the variable.
Since examples are often more instructive than explanations, the
following example is offered to show how a string variable is modified
by various commands. The left column shows the commands and the right
column shows what would be printed as a result of each command. Again,
remember that in order to distinguish between commands and text, the
commands must be printed on the screen in yellow and normal text must be
printed on the screen in white. The control characters ^Y and ^W are
used to change the color of the text. µ
declare-string name
declare-string street
declare-string city
declare-string state
"RTL Programming Aids" to name
"10844 Deerwood SE" to street
"Lowell" to city
"MI" to state
name print RTL Programming Aids
street print 10844 Deerwood SE
city print ", " print state print Lowell, MI
·
áDECISIONSÿ
In order to be as flexible as possible, the computer must be able
to make choices and perform different tasks under different
circumstances. This requires two things. First there must be a variety
of instructions which are capable of making comparisons or returning
various types of status information, and second there must be control
structures which are capable of making different responses as a result
of these instructions. The next two sections will show how to alter the
way a document is printed based on conditions which are encountered
during the printing of the document.
áTESTS AND COMPARISONSÿ
The purpose of a test or comparison instruction is to return a
flag. A flag can be thought of as a switch which represents a true or
false condition. There are 6 different comparisons which can be made
between numbers and 3 comparisons which can be made between strings. The
following is a summary of the comparison instructions.
NUMERIC COMPARISONS STRING COMPARISONS
greater-than $greater-than
greater-or-equal $equal
equal $less-than
not-equal
less-than
less-or-equal
In each test the arguments being tested preceed the test itself.
THIS IS EXTREMILY IMPORTANT. The program will not operate correctly if
the order is changed. For example, if the variable "age" contains the
age of a person, you could determine whether the person is 21 years old
or greater with the code "age 21 greater-or-equal".
áCONTROL STRUCTURES ÿ
The simplest control structure is the IF ... ENDIF structure.
Because Wordwright uses postfix notation, this structure behaves a
little bit differently than the same structure in some computer
languages. It is assumed that a flag indicating a true or false
condition has been generated prior to entering this control structure.
Any nonzero number is considered a true flag and a zero is considered to
be a false flag. When the word IF is encountered the flag is tested to
see whether it is true or false. The flag is then dropped and execution
either proceeds with the next sequential instruction (if the flag was
true) or execution jumps to the word immediately following the word
ENDIF.
In the example just given, there was no response for the case when
the comparison instruction returned a false flag. Many times, there is
one procedure in the case of a true flag and an alternate procedure in
the case of a false flag. The IF ... ELSE ... ENDIF construct may then
be used.
The IF ... ELSE ... ENDIF construct tests the flag in the same way
as the IF ... ENDIF construct. It then executes the clause between IF
and ELSE in the case of a true flag and the clause between ELSE and
ENDIF in the case of a false flag. After the appropriate clause is
executed, execution proceeds with the word immediately following the
word ENDIF.
For those people who are familiar with the IF THEN and IF THEN ELSE
constructs of BASIC, it is important to compare the differences between
the BASIC version and the Worwright version of this structure. It isn't
obvious at first glance, but the BASIC control structures should
actually be written as IF ... THEN ... ENDIF and IF ... THEN ... ELSE
... ENDIF. The word ENDIF is not explicitly included in BASIC, but is
implied by the end of the line. This means that the BASIC version of
this control structure can never have a clause longer than one line and
the only way to get around this arbitrary limitation is to include
commands such as GOTO or GOSUB in clauses which are too long otherwise.
Another difference is the fact that Wordwright requires the
conditional flag to be determined and placed on the stack before
entering the control structure. BASIC determines the condition from code
placed between the words IF and THEN. If the conditional clause is
indicated by COND?, the syntax of the two versions can be compared as
follows (with the implied ENDIF of BASIC displayed).
Wordwright
COND? IF ... ENDIF
COND? IF ... ELSE ... ENDIF
Basic
IF COND? THEN ... ENDIF
IF COND? THEN ... ELSE ... ENDIF ´tof²
áFORM LETTERSÿ
In the following examples, embeded commands are used to show how a
form letter may be written which will print different phrases based on
the values of variables which are defined at the beginning of the
letter. Both of the letters which follow were printed using the same
form letter. The only change is the values assigned to the variables.
µ
´declare current-gross
declare past-gross
declare gross-increase
declare-string scapegoat
380000 to current-gross
326000 to past-gross
current-gross past-gross - to gross-increase
"our newest employee" to scapegoat
"Z,ZZZ" to format
²
·Dear Stockholder,
The gross sales for this quarter was $´current-gross =². This is
´gross-increase neg?- if "a decrease" else "an increase" endif print² of
´gross-increase abs "$" print =². This change in gross sales is due
primarily to the efforts of ´gross-increase neg?- if scapegoat else "our
beloved and industrious president" endif print².
As the newly appointed assistant to the president it is my sad duty
to inform you that the accident which my predecessor "Uncle" Ned
suffered in front of my office will prevent him from resuming his duties
for at least the next 3 months.
Sincerely,
Albert Smith
(Ambitious Al)
µ
´326000 to current-gross
380000 to past-gross
current-gross past-gross - to gross-increase
"our newest employee" to scapegoat
"Z,ZZZ" to format
²
·Dear Stockholder,
The gross sales for this quarter was $´current-gross =². This is
´gross-increase neg?- if "a decrease" else "an increase" endif print² of
´gross-increase abs "$" print =². This change in gross sales is due
primarily to the efforts of ´gross-increase neg?- if scapegoat else "our
beloved and industrious president" endif print².
As the newly appointed assistant to the president it is my sad duty
to inform you that the accident which my predecessor "Uncle" Ned
suffered in front of my office will prevent him from resuming his duties
for at least the next 3 months.
Sincerely,
Albert Smith
(Ambitious Al)
´tof²
áGETTING DATA FROM A MERGE FILEÿ
The form letters which were shown in the previous section have one
major fault. It is neccessary to edit the file and change the values of
the variables for each letter that is printed. A much more powerfull way
to generate form letters is to put the data in a separate file called a
"merge file" and have the computer automatically initialize the
variables from the data in the merge file at the start of each letter.
This allows a large number of customized letters to be printed with no
interaction required from the user.
The modification neccessary in the text file in order to use mail
merge consists of simply modifying each command that assigns a constant
or string to a variable so that the constant or string which is assigned
to the variable comes from the merge file instead of from the text file.
The command which does this is called "get". Thus the in the previous
example, the phrase "326000 to current-gross" would be replaced by the
phrase "get current-gross", the phrase "380000 to past-gross" would be
replaced by the phrase "get past-gross", and the phrase ""our newest
employee" to scapegoat" would be replaced by the phrase "get scapegoat".
áLOOPSÿ
It is often desireable to search through the merge file for data
which meets certain conditions and only print letters when those
conditions are met. For example, if you want to advertise a trade show
which is only of local interest, it might be nice to send letters to
just those people with zip codes in a certain range. The "LOOP"
structure gives you the ability to collect data from the merge file,
test it, and continue going back for more data until the data satisfies
your conditions so that a letter can be printed.
The following example shows how code would be written to accomplish
the task just described. µ
begin
get name
get street
get city
get state
get zip
zip 45000 greater-than
zip 46000 less-than
and
repeat-until
· In the example shown, the program gets all the information from the
merge file and then performs a test to see whether the information is to
be used or not. If it is NOT to be used, the program will jump back to
the word begin and will gather information for another person. As soon
as the conditions are met the program will continue with the printing of
the letter using the values just collected for the variables.
The test portion of the code which was just shown needs further
clarification. The test in this case indicates a true responce when the
zip code is greater than 45000 and less than 46000. It should be noted
that two separate tests are performed and both tests must be true for
the conditions to be met.
In each test the arguments being tested preceed the test itself.
THIS IS EXTREMILY IMPORTANT. The program will not operate correctly if
the order is changed. For example, in the code "zip 45000 greater-than"
the value of the zip code comes first (zip), then the value which it
will be compared to comes (45000), and finally the comparison is made
(greater-than). This comparison returns a condition of either true or
false. The second test behaves in a similar manner and returns a
condition of true or false. The second condition will be met whenever
the zip code is less than 46000.
After both conditions are tested for, the word "and" provides a
third test. In this case the word "and" will return a true indication if
both of the previous tests returned a true indication and it will return
a false indication if either or both of the previous tests returned a
false indication. Again it is important to note that the two previous
tests must be completed before the "and" test is made. The "or" command
is similar to the "and" command. In this case only one of the previous
tests has to be true for the "or" condition to be true.
If the letter was to be sent to everyone in the merge file EXCEPT
those people within the given zip code range, the code could be modified
by replacing the word "repeat-until" with the word "repeat-while". In
this case the code would look like the following. µ
begin
get name
get street
get city
get state
get zip
zip 45000 greater-than
zip 46000 less-than
and
repeat-while
·
áCREATING A MERGE FILEÿ
Once the text file is modified so that it looks for input from a
merge file, the text file can be saved and a separate merge file can be
created. The merge file is simply a text file that contains the data
needed by the text file. The data must be entered in the same order that
it is requested by the document. Numeric data may be separated either by
spaces or by placing each number on a separate line. Strings must be
separated by placing each string on a separate line.
Blank lines may be inserted if desired for readability but they
will be ignored by the program. In other words, if the program tries to
read the value for a numeric or string variable, it will keep skipping
lines until it finds a line with data on it.
When a document is being printed and a merge file is specified, the
document will be printed again and again using different data each time
until either the file is exhausted or the user stops the printing by
typing a carriage return.
àCHAPTER 5: UTILITIESÿ
A number of utilities are included with Wordwright which aren't a
neccesary part of the word processor but add a lot to the usefulness of
it.
áCLIÿ
It is frequently usefull to access system utilities from within
Wordwright. The most common system utility "dir" may be called from the
"UTILITIES" window by simply typing in the word "dir" with an optional
drive or path name. This will start a new CLI (Command Line Interface)
and execute the dir command. After the dir command is executed, the new
CLI will remain until a return is typed with nothing in the line.
If you want to execute a system command other than dir, you may
create a new CLI without first executing the dir command by typing the
command "CLI". Both the dir and cli commands are also available from the
edit mode by using pull down menus.
áCALCULATORÿ
The utilities window contains a simple calculator which is intended
primarily as an aid to programmers. It is a four function calculator
which works only with integers but can perform calculations in either
the decimal mode or the hexadecimal mode. It can also convert from one
base to another and can give the ascii representation for any key which
is pressed.
The calculator uses Reverse Polish Notation or RPN. RPN is the way
functions are entered in calculators made by Hewlett Packard and it
differs from algebraic notation in that functions are entered after
numbers instead of between numbers. The following example illustrates
the keys which would be typed in both algebraic notation and RPN to add,
subtract, multiply, or divide two numbers.
ALGEBRAIC RPN
2 + 2 = 2 2 + =
5 - 3 = 5 3 - =
3 * 4 = 3 4 * =
8 / 2 = 8 2 / =
It should be noted that there must be a space between numbers and
functions.
The calculator works in both the decimal and hexadecimal modes and
you can switch from one mode to the other by typing the words "decimal"
or "hex". If you want to convert a decimal number to hexadecimal you
would make sure that you are in the decimal mode, enter your number,
type "hex" to enter the hexadecimal mode, and print the number by typing
an equal sign.
If you want to know what the ascii representation is for a
particular key, you may type the word "key?" followed by a carriage
return. The computer will then wait for you to press the next key and
will type the ascii representation for the character or characters that
are sent to the computer when that key is typed. The ascii
representation can be given in either the decimal mode or the
hexadecimal mode depending on which number base is selected at the time.
áDUMPÿ
It is sometimes usefull to see a memory dump of text to show
unprintable characters such as tabs or characters which are embedded to
change the screen color. The dump command is used to print the contents
of any area of memory in the computer. If you know the address where you
want to start your dump, you just type the address followed by a space
and the word "dump". If you don't know the address, you can use a
symbolic address such as sof, eof, or current. These symbolic addresses
refer to the start of file, end of file, and cursor location
respectively. If you wanted to start the dump 10 characters in front of
the cursor, you would type "current 10 - dump".
The dump may be stopped and restarted by typing the space bar. When
you want to stop the dump completely and have no desire to restart it,
hit the return key.
áSCREEN SAVERÿ
The screen saver isn't a utility that is deliberatly used, but
instead is a feature that is always present in the background of
Wordwright. The function of the screen saver is to monitor the activity
from the keyboard to determine whether someone is actually using
Wordwright or whether the computer is just sitting idle. If 5 minutes
goes by with no input from the keyboard, the computer assumes that
nobody is using the computer and will turn off the display except for
the pointer, which will be left on as an indicator to show that the
computer is still turned on. The purpose of the screen saver is to
prolong the life of your monitor.
If the screen turns off, you may turn it back on by hitting any
key. The key will only be interpreted as a command to turn on the screen
and will not affect any text which is being edited.
The length of time necessary to turn off the screen is adjustable
by the user. To adjust the time, go to the utilities window and type the
command "N to screen-timer" where N is the number of seconds that you
want to wait before the computer turns the monitor off. For example, the
command "5 60 * to screen-timer" will set the timer for 5 minutes. If
you plan to run another program at the same time Wordwright is running,
you are likely to go for a long time without typing any input to
Wordwright, but you still won't want the screen to turn off. The screen
saver can be disabled by setting the screen-timer to 0.
´contents²