by James Maki
NOTE: Due to the large size of this program, it is available only on this month's disk version or in the databases of the ST-LOG SIG on DELPHI.
After working as a research chemist for six years, James Maki decided to become a freelance writer and make his Atari computers pay for themselves. He lives in Indianapolis with his wife, a new daughter, a golden retriever and four Siamese cats.
Outline Plus is a program that will help just about anyone, including writers, students, journalists or managers, to organize their writing in a more logical, coherent and useful manner. This type of program is often called an idea processor, thought processor or outline processor. It takes much of the tedium out of writing a list or an outline because it automatically takes care of line numbering, subject grouping and format. It is easy to rearrange, add or delete items, so free thinking is encouraged. Up to four windows can be opened and the total number of lines is limited only by the system's memory (approximately 3,000 lines for an unexpanded 520 ST with no desk accessories).
I wrote this program because I am not aware of an outline processor for the Atari ST. It is often included with the more expensive word processors, such as WordPerfect, and was announced for the illfated PaperClip Elite from Batteries Included. I designed the program to compliment any word processor that can import ASCII files.
First and foremost, this program is a creative writing tool. Use Outline Plus to bring better organization to your writing, whether it be story plots, articles, a things-to-do list or a student project. Your writing will be better because Outline Plus allows both organization and planning to occur before writing begins. Creativity flows unimpeded while random and disjointed thoughts are captured before they are forgotten, to be saved and collected in subject groupings to be reviewed later At the same time, the process is very dynamic because making changes in the outline is so easy.
Brainstorm the main subject groupings and fill out the subtopics and details later as they naturally occur. The multiple windows make it easy to work on several ideas almost simultaneously. When a brilliant flash occurs, switch to another window (file) and record the thought immediately rather than hoping to remember it later. A good idea will never again be lost because Outline Plus saves all of your visions; your imagination is free to run wild.
Running the program
Run Outline Plus by double-clicking the file OUTLINE.PRG. The program fully supports GEM and uses windows, dialog boxes and alert boxes for all input and output. After loading the program, a GEM selection box will open. Select a file to modify or enter a new filename. Outline Plus defaults to an .OLP filename extender.
A new menu bar will be displayed with the titles Desk, File, Block, Output and Menu. All menu bar selections have a keystroke equivalent: The File and Output selections are entered by pressing the control key and the first letter of the command, while the Block functions are entered via the alternate key and the first letter of the command (i.e., Control-O to open a window, Alternate-M to mark a block; see the command summary at the end of the article). Desk will allow access to any desk accessories that were present on your boot disk (Note that the program will not function properly with a desk accessory that utilizes a GEM window that remains open).
Under File are the items Open, Save, Close and Quit. Select Open to retrieve a file for modification or to open a new file. The program will prompt if the file does not yet exist before creating a new file. Select Save to save the current file to disk. Close will close the current window and prompt to save a modified file. Quit exits Outline Plus, prompting you to save any modified files.
The Block selections, Mark, Cut, Paste, Clear, and Hide are used to manipulate text blocks between and within windows. All block functions operate on complete lines only! Select Mark to indicate the first line of the block. Move the cursor, if necessary, and select Mark a second time to indicate the last line. The block will be displayed on screen in boldface font. Selecting Mark the second time moves the selected region to the block buffer, ready to paste.
The block region can be removed from the current file by selecting Cut (the block buffer is still available for paste operations). Paste inserts the block buffer to the current file at the current cursor location. Delete clears the block region and deletes the block buffer, while Hide just clears the block from the screen without affecting the block buffer.
The Output selections, Print and Disk refer to the destination of the output. Selecting Print sends the output to the printer. The filename is centered at the top of the page followed by 56 lines of text. The page number is printed at the bottom of the page. No special printer codes are utilized so any printer can be used.
Selecting Disk will print the file to the disk in ASCII form, which can be retrieved by most word processors. This allows the outline to be available in a second window while writing and also can be used to produce fancier output using the output formatter of your word processor.
The Menu selections allow easy access to the multiple edit windows available. The open windows will be displayed by filename and can be made current by selecting the appropriate Menu item or pressing function keys Fl to F4 (corresponding to the window number).
The outline format used by Outline Plus is:
- First Level
- Second Level
- Third Level
- Fourth Level
- Fifth Level
- Sixth Level
- Fifth Level
- Fourth Level
- Third Level
- Second Level
The level designators are automatically incremented by the program. Selecting Open will display a saved file or create a new file. When a new file is created, the window will open displaying only a roman numeral I. and the cursor. If information has been previously entered, it will be displayed, and the cursor will be positioned at the first item.
Figure 1. Linked List
Figure 2. Add A Record
Figure 3. Insert a Record
Figure 4. Delete A Record
Text is entered in the same manner as a word processor except the lines will not wrap. Each entry is limited to 96 characters. The window will scroll as necessary to accommodate the entire line. Pressing Return will move the cursor to the next line and will insert a new line if the cursor is not on the last line of the file.
The level designators can be changed with Tab or Shift-Right-Arrow to move to a lower level or Shift-Left-Arrow to move to a higher level. The display is redrawn to show the effects of a level change. Once the text is entered, it can be moved via the block commands Cut and Paste. Text can be edited with the backspace and delete keys. Backspace will delete the character to the left of the cursor and move the cursor and line one character left. Delete will delete the character at the current cursor position and move the remainder of the line one character to the left.
The cursor keys or mouse are used to move the cursor within the outline. Use the right and left arrows to move to within a text line. Entering a character will insert the character at the cursor position (limited by the 96 character total line length). The up and down arrows will move the cursor up or down a field, scrolling the window if necessary to display the file Shift-Up-Arrow will scroll the window up a page if possible, while Shift-Down-Arrow will scroll the window down a page.
A specific word can be found by using the Search function of Outline Plus. Press F10 to produce a dialog box for word input. Press Return and the program will search forward from the current cursor position. If the search string is found, the window will be redrawn at the word's location. Pressing F9 will renew the search for the same word. The search is case sensitive and forward seeking only.
An entire line (except for the level designator) is erased by pressing the Escape key. The entire line is deleted by pressing the Clear/Home key. The contents of the deleted line are saved to a delete buffer for retrieval if necessary (the Undo command is described below). While the text is saved, the level designator is not. The delete buffer will hold a number of records limited by system memory. The more items in the delete buffer, the fewer lines available for the edit windows.
Pressing Undo will write the last deleted item of the delete buffer to the current cursor location, allowing retrieval of an item mistakenly deleted. The delete buffer is a last-in, first-out stack arrangement. After the last item is recalled by Undo, the next to last deleted line is the next line to be undeleted via Undo. Pressing Shift-Clear-Home will clear the delete buffer and should be periodically performed after the deleted items are deemed expendable to provide the maximum number of lines for the edit windows.
To add a new line between two existing lines, press Insert or Return. Insert will add a new line at the current cursor position, pushing all subsequent lines down, while Return will insert a new line after the position of the cursor. The new line will take on the level of the current cursor line, and the window will be redrawn to reflect these changes.
The program handles most I/O system errors and displays an alert box describing the problem. The most common are insufficient memory to load or save a file. Changing to a new disk will alleviate the problem of insufficient storage space. If the problem is insufficient computer memory, try erasing the delete buffer (Shift-Clear-Home), closing unneeded windows, and booting without any desk accessories.
Other errors are described with their GEM or TOS error code number. I have not been able to force generation of these other error messages.
Outline Plus demonstrates many of the abilities of Personal Pascal, the most important being the use of linked lists to store information. The major feature of a linked list is the utilization of pointers. Pointers are variables that store the address (memory location) of a record. In addition to data, the record can store pointers that point to other records. In this manner, the records can be linked together to form a list of connected records. Figure 1 graphically illustrates a linked list and the associated pointers.
A pointer is declared in the same manner as any other Pascal type. (See Listing 1.) The information stored in this variable is the address of a record (or nothing, referred to as a nil pointer). A pointer cannot be inspected—Writeln(PointerType) is not legal! The syntax, PointerType, refers to the record information stored at the address PointerType. If PointerType is a record, then the individual items of the record are referred to as PointerType ∧. Stored DataOne, PointerType ∧. Stored Data Two, etc. Once this relationship is understood, using pointers becomes second nature!
The second important method utilized by Outline Plus is recursion. Recursion is a programming method where a procedure calls itself. Recursion makes the implementation of linked lists much easier.
In Listing 1, AddARec will continue to call itself until it gets to the end of the list. At that point, a new record will be created, a pointer from the previous last record will point to the newly created record (which is now the new last record), and the new information will be stored.
The basic building blocks of constructing a linked list are procedures to add a record, delete a record and insert a record (see REC_MOD.PAS and Figures 2 through 4).
Moving through the outline amounts to traversing the links between records. New lines are added via AddARec and Insert-ARec. Old lines are deleted with DeleteARec. The remainder of the program supports these procedures and displays the information on the screen.
An excellent source for more information about linked lists, pointers and recursion can be found in the text Oh! Pascal! by Doug Cooper and Michael Clancy.
Everyone who uses a word processor on his/her Atari ST can benefit from Outline Plus, whether one is a writer, a student or an executive. It is easy to use, versatile and dynamic. I used Outline Plus to help write this article, and I have never written an article faster or more comprehensively. It did not require the rewrites normally needed to add additional facts because I used Outline Plus to gather and correlate the facts before, not during, the writing phase.