The Text Editor
The text editor is where any messages on the BBS will be entered. It works by letting users type anything they want to type.
This is a line-based editor; you cannot use cursor keys to move up and down a line like you can in most modern text editors/word processors. |
Enter Text
To enter text, simply type it into the editor.
DELete works as usual, but INSerT
does not.
There is no need to press Return at the end of each line. The editor uses word-wrap, so words which extend past the edge of the screen will be erased and put at the beginning of the next line.
As the sysop, you can define how many lines of text (in multiples of ten) a user can type into the editor. (Refer to [user-flags] for more information.) If a user is in local or pseudo-local mode, they are allowed 253 lines in the editor.
The amount of free memory is kept track of. If this amount becomes too small (less than 256 bytes), the message
*** End Of Memory ***
appears, and you must use .S to save, or .A to abort.
Entering the editor in local or pseudo-local also mode reports how many bytes are free.
Command Mode
When you need to do something with the text you have entered:
-
Type Return if necessary to start a new line.
-
Type . (period) as the first character on the line.
This displays Command:
and waits for you to press another key (called a “dot command”).
This is Command Mode.
When you reach the end of the text buffer, you are automatically put into Command Mode in order to edit your existing text or save it. |
-
If you press DELete or Return keys, the
Command:
prompt is removed, and you are returned to the editor. -
If you press an unrecognized command key, the editor exits to BASIC to check if you have added that command before assuming it is an illegal command.
The +.WF program uses this technique extensively for the .Put, .Get, and .$ View Directory commands.
If you wish to program your own commands, we suggest you examine that file to see how it is done.
No documentation is available for this as yet.
|
If you press a key corresponding to a command, the editor displays the command, waiting for you to enter either:
-
a line range, discussed next
-
another character, for some commands
You can tell a command accepts a line range or parameter when there is an extra space after the command, like List .
|
-
or press Return to accept the command
Line Ranges
Most commands allow a line range to be entered after the command, just like BASIC’s list
command.
A line range can be specified in one of the following ways:
Type | Purpose |
---|---|
x |
Just line #x |
x- |
Line #x to the end of the message |
x-y |
Lines #x to #y |
-y |
From the beginning to line #y |
Any delimiter (comma, etc.) may be used in place of the -
, depending on one’s preference.
Dot Commands
The commands available in the editor are grouped into related commands, discussed here.
Exit the Editor
There are two ways to get out of the editor:
-
The first way is to abort the message you were typing, with the .Abort command.
There is no confirmation, unfortunately. This is something I have mostly working and plan on adding to Image BBS 1.2 and up. |
-
The second way is to save the message with the .Save Text command.
-
Neither command requires or allows line ranges.
Read What You Typed
There are several options to view the text you have already typed:
-
First, the .Read command. This displays each line just as it was typed, including each color change character and MCI command; this might be useful to “proofread” your message.
-
Next, the .MCI Read command. This interprets MCI commands, and displays color change codes.
-
Finally, you can also .List the text, which displays line numbers, used in line ranges for other commands.
If no line range is given for the .Read, .List, or .MCI Read commands, all text in the buffer is read or listed.
You can pause text with Ctrl+S or Home keys at any time. Messages may be aborted while paused with the spacebar or / keys.
Manipulate Text
Delete Lines
.Delete removes lines of text from your message permanently; there is no “undo” capability.
-
Any line range you type after .Delete is removed from the buffer.
-
If no line range is specified, the last line of text is deleted.
Edit Lines
.Edit changes lines of text. When a line is edited this way, the line number is displayed, then the text itself, just like the .List command does. You may then type the new line below it. (Refer to Editor/Input Control Keys for useful editor keystrokes.)
-
DELete or Return as the first character on the line causes the editor responds with
(No Change.)
and returns to the main editor. -
. as the first character causes
Command: Exit
to appear and abort the Edit command. -
If no line range is specified, .Edit defaults to the last line of text entered.
Editor Modes
Insert Mode
The .Insert command enters Insert Mode.
This is shown by displaying Ix:
(where x is the line number you are inserting at).
The line you specify is where you start inserting. If no line number is specified, the first line is assumed.
As you type each line of text, text on subsequent lines is moved down in the buffer, then your line is put in its place.
You can exit Insert Mode by typing a . as the first character on the line.
This responds with Command: Exit
and goes back to the normal editor.
Shape Your Text
Justify Text
The .Justify command allows you to format your text in one of 7 different ways.
After typing the .J command, you are prompted:
Justify (C,E,I,L,P,R,U):
These are the seven Justify commands. Press the key corresponding to which justification mode you want. To escape Justify mode, type ., DELete, or Return.
If a valid command is selected, the editor displays the command name, and then allows you to enter a line range.
If you do not specify a line range, the Justify commands default to all text in the buffer.
The Justify commands are:
Command | Purpose | ||
---|---|---|---|
Center |
Center text |
||
Expand |
Insert spaces between words to the limit of your .Columns setting |
||
Indent |
Move text right by one column, if possible |
||
Left |
Remove leading spaces |
||
Packed |
Remove all extra spaces added by Expand |
||
Right |
Push text to the right margin
|
||
Un-indent |
Moves text one column to the left, if possible |
Border Text
The .Border command puts a border around your text. If you do not specify a line range, it will default to all text entered. Specify the border character. FIXME If there is not enough room on a particular line to add both border characters, that line is ignored.
Set the .Columns width to 2-4 characters less than your current line length before typing the text to be bordered. |
The .Columns command followed by a two-digit number (22
-80
) changes the number of characters the editor allows you to type on a line before word-wrapping text.
If you do not specify a column width after the command, the current column width is displayed.
Starting Over
The .New (the dot command displays Clear Text
) command re-starts the editor, erasing all text you have typed.
There is no confirmation, unfortunately. This is something I have mostly working and plan on adding to Image BBS 1.2 and up. |
Search for Text
The .Find command allows you to search for any occurrence of a character, word or phrase. If no line range is entered, all text will be searched. Find will prompt you for the text to search for, and will list all occurrences (including line numbers they occur on) of it.
Replace Text
The .K (Replace
, think Kill) command will prompt you for an optional line range, then a Search Phrase:
as Find does, but also ask what to Replace With:
Then it will go through the text.
If the replacement phrase is too large to fit within the current line length, the editor will display Too Big, Can’t Fit.
and skip that line.
Disk Access
(These commands are available from local/pseudo-local mode only.)
Get and Put
The .Get and .Put commands allow you to:
-
Load (.Get) a file from a device
-
Edit using all the normal editor facilities
-
Save that file (.Put) to any device and drive
You can re-save the file to the same device/drive (you are prompted for the current filename, and can change it in the process). Or, you can save to a different device/drive if desired.
If the file already exists, you are prompted:
[A]ppend [R]eplace [Q]uit:
-
rename it
-
append to the current file
Rewrite:
(These commands are only available from local or pseudo-local mode.)
.Get allows you to load a text file from any device and drive. It appends the file to any text already in the editor’s buffer.
You can then use all the normal editor facilities.
if you are trying to work with SEQ files with C/G codes in them, use .Columns 80 first, so lines don’t word-wrap._ |
.Put allows you to save the text file in the buffer to a specified device and drive. If the specified filename already exists, you can either replace the file or append the text in the buffer to the existing file.
.$ (View Directory) command views a disk directory of any device and drive, with a pattern if desired.
.& reads an existing file. A filename, device and drive are prompted for.
.! issues a DOS command.
If a “new” (starts with n
) or “scratch” (starts with s
) DOS command is issued, you are prompted to confirm your actions.
Editor/Input Control Keys
Certain key combinations are used to edit your text while you are typing it, whether in the BBS editor or at a BBS prompt. For example, any character that you delete with the DELete key can be “re-typed” with Ctrl+U. Other control keys:
DELete | Move back one character |
---|---|
Ctrl+B |
Move back to beginning of line |
Ctrl+D |
Delete character under cursor |
Ctrl+I |
Insert character under cursor |
Ctrl+N |
Move forward to end of line |
Ctrl+O |
Duplicate all text on current line |
Ctrl+U |
Re-type one character from buffer (move forward one character) |
Ctrl+V |
Verify (re-display) current line; useful for poor connections |
Ctrl+W |
Move back one word |
Ctrl+X |
Abort input (prints a British pound sign, £, on Commodore equipment, or a backslash (\) on ASCII terminals) |
Ctrl+Y |
Re-type word from buffer (move forward one word) |
Dot Command Quick Reference
Command | Purpose |
---|---|
.Abort |
Exit editor (no confirmation) |
.Border |
Put specified character around text |
.Columns |
Set width of text entry allowed |
.Delete |
Delete line(s) |
.Edit |
Edit line(s) |
.Find |
Find text in specified line(s) |
.Help, .? Help |
Show help menu file |
.Insert |
Insert line(s) at specified line |
.Justify |
Justify text in various ways |
.K Replace |
Search for and replace text |
.List |
List line numbers and lines of text |
.MCI Read |
Read with MCI interpreted |
.New Text |
Erase buffer (no confirmation) |
.O Line Numbering |
Show line numbers as text is typed |
.Query |
Show lines used and remaining |
.Read |
Read without MCI interpreted |
.Save Text |
Save text to disk |
.Version |
Show editor version |
.Y Move Lines |
Move line range to specified line |
.Z Copy Lines |
Copy line range to specified line |
.# Scale |
Show 40-column scale |
WF Dot Commands
These commands can be used if in local mode.
Command | Purpose |
---|---|
.Get File |
Append to buffer a disk file’s contents (filename is prompted for) |
.Put File |
Save a file (filename is prompted for); can Append or Replace existing file |
.Unborder |
Remove characters put by .Border |
.! DOS Command |
Send DOS command (device and drive are prompted for) |
.& Read File |
Read SEQ file (filename is prompted for) |