Text Editor 2000 is my attempt to make a full featured text editor using only Spectrum compatible BASIC.
To begin with, this text editor is an expansion of a very simple concept. Try this:
10 INPUT AT 21,0; AT 0,0; LINE a$
20 LPRINT a$
30 GOTO 10
This is a very simple way to use the editing system built into your TS 2068 (or Spectrum), and Text Editor 2000 is merely an expansion of this concept.
Text Editor 2000 is menu driven, which means that a list of choices is presented, and whenever the prompt ‘Selection?’ appears, all you need to do is push the key corresponding to the numbered option you wish.
For example, option 9 (Quick Note) is the short program described above. A cursor will appear at the top left of the screen. I am assuming that you are already familiar with the TIMEX Sinclair editing system described in the USER’S MANUAL (chapter 2).
Using the Quick Note option allows typing text on the screen and upon hitting the ENTER key, the text will be printed. When entering text, be especially careful never to press SHIFT 6, because all of the text on the screen will be lost. If this should happen to you do not RUN the program. Type
GOTO 800
It is best to type in text a paragraph at a time, and you should not use multi-character tokens. To get back to the menu from Quick Note, hit the ENTER key without typing in any text.
If you wish to use the various other editing and storage options of Text Editor 2000, the text will need to be stored in the computer’s memory, by choosing selection 0, INPUT TEXT. This option works exactly like the Quick Note option, except that the text is not immediately printed. Also, the last two lines that were entered are displayed, so that you can keep track of where you are.
To Input Text type in a line of 32 characters or less and press ENTER. This will place the cursor at the first space of the next line. If the last word you are adding to a line will make that line more than 32 characters, hyphenate the word and press ENTER.
Adding blank spaces at the end of a line until the cursor appears in the line below has the same result.
Choose selection 7 to OUTPUT TEXT either to the screen for review, or to the printer. You will be prompted on whether or not the text is to be printed. Answer by pushing the Y or N keys. If your answer is N, the text will be displayed on the screen. If your answer is Y, then you will be prompted on whether or not the text is to be doubles spaced, and whether or not a 64 column printout is desired (more on this later). If a 64 column printout is not desired, then you will be asked whether or not there are any screen$ to be loaded in (more on this later, also).
To CLEAR the text, choose selection 8.
Options 1 and 2 allow SAVEing and LOADing text files. Each file should have a name of no more than 10 characters. When you save a file, you will be prompted on whether or not you would like to verify the save.
To INSERT TEXT, choose selection 3. This takes you to the full screen editor. In this mode you use the regular Shift 5 through shift 8 keys to move the cursor around the text. In addition, Shift 3 will move the cursor down a page, and Shift 4 will move the cursor up a page. Also, any time you are in the full screen editor mode, you can get back to the main menu by pushing Symbol Shift A (the STOP token).
What you want to do is place the cursor on the first character that you want to appear AFTER the insertion, and then hit the ENTER key. You will be prompted on whether or not to be inserted needs to be loaded in. If not you will be given a cursor to type in the text. If at this point you decide that you do not want to insert any text, then just hit ENTER without typing in text. After the text is inserted it, it will be displayed a page at a time.
Selection 4, DELETE TEXT, works very similarly to INSERT TEXT, except that you move the cursor to the first character that you want to delete. When you press ENTER, the character will be marked with an asterisk, and then the cursor will move one space to the right. Now you move the cursor to the last character that you want to delete and press ENTER again. If you only want to delete one character that you want to delete and press ENTER again. If you only want to delete one character, then move the cursor, back to the marked character. After you press ENTER the second time, you will be prompted on whether or not you to insert text at the same place as the deleted text.
Selection 5 will JUSTIFY the right hand margin. It only searches back 10 character, so you can write on this left part of the screen, without unwanted justification. This prevents:
Dear John,
from becoming:
Dear John,
The last line of a paragraph is not justified. In fact, any line that precedes a line that starts with a space, will not justify. The last line is never justified.
SEARCH AND REPLACE, selection 6, is useful for correcting misspelled words. You will be prompted for the string of characters to be searched for. This would be the word that is incorrectly spelled. You can get back to the menu from here by pushing ENTER without typing in any text. You will then be prompted for the string of characters to be inserted in place of the old string. This would be the correctly spelled word. The new text will be displayed one character at a time as it is finished.
To CENTER a line of text, choose selection A. You will then be in the full screen editor mode, but only use the 6 and 7 keys, and place the cursor on the first character of the line you want to be centered, and hit ENTER. The line will be centered and the text will be displayed on the screen.
Selection 8, TYPE OVER, sends you to the full screen editor and allows you to just type over the text that you want to change.
Selection C allows you to change the PAPER and BORDER colors. INK is always set to maximum contrast.
A 64 column printout is possible by printing out one side and then the other, and then taping the two together. To justify and center the text 64d columns, you must change the width by pushing ‘W’ at the selection prompt and then entering ’64’. Be sure to change the width back to 32, before you print out the text.
There is also a simple cut and paste routine, that allows you to place a screen of graphics into your text. After you have finished editing your text, but before you imbed control characters, insert the characters ‘SCR$’ where you want the graphics to go. When you print out your text answer yes to the screen$ prompt. The screens will be loaded in and copied in their proper place in the text.
You should also be aware of characters not found on the keyboard. As explained on page 25 of the USERS GUIDE, there are some extra characters in the extended mode. To get in to the extended mode, press the caps shift and symbol shift at the same time.
Also there are some defined characters in the graphics mode. To get in to graphics mode type Shift 9.
These characters allow you to write things like H₂O, 2x³, and 1/3 cup of sugar. The box is useful for checklists, and graphics characters D-I are useful for enclosing something in a box.
To copy this program, type ‘S’ at the ‘Selection?’ prompt.
Expert users might experiment with inserting control characters into their text. These are available directly from the keyboard in the extended mode:
0-7 PAPER color
8 BRIGHT off
9 BRIGHT on
Shift 0-7 INK color
8 FLASH off
9 FLASH on
These will interfere with the editing ability of this program, so they should only be inserted after the text has been completely edited.
There are two POKEs that you can add to speed up keyboard input. I have left them out because they have to do with the repeating of the keys, and I have found the extra speed not worth the typing errors caused by the keys repeating. However, you can add them if you prefer:
9900 POKE 23561,10
9910 POKE 23562,3
I hope that Text Editor 2000 is a demonstration of the power in Sinclair Extended BASIC. I have not used any of the TS 2068 specific commands, so owners of emulators and ROMswitches should not have to switch back and forth. Since it is written in BASIC, this program could probably be used with printer interfaces that support LLIST and COPY. Another project might be to combine this program with the TASWIDE screen utility.
If you do not want to type this program in, I will send you a copy for $6. Also feel free to contact me if you have any questions:
Chris Nystrom
People’s Software Supply
609 E.N. 18th Street
Abilene, Texas 79601
915/673-3538
One final tip: The paper for the Radio Shack TP-10 printer works great on the 2040 printer, and it can be bought at any Radio Shack.
TSH




Products
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.