Contents of the SLED.DOC file
SLED and SLHED
SLED and SLHED are small, fast text editors for the IBM PC
(registered TM of International Business Machines Corp.) and close
compatibles. They are designed for program, batch and data file
editing, and simple word processing. They can read and write a
variety of file formats and are useful as file conversion
utilities. Many files can be edited at once, limited only by
There are two versions of the editor: SLED, for monochrome and
color monitors running in text mode, and SLHED, that takes
advantage of the 90 columns and 43 lines of text available using
the graphics mode of the Hercules Graphics adapter (registered TM
of Hercules Computer Technology).
SLED, SLHED and the document you are reading are all Copyright
Suite 1503, 2201 Riverside Drive
Ottawa, Ontario, Canada K1H 8K9
You are welcome to use them and pass copies of them along to
others as long as:
(1) you always keep SLED, SLHED and this document together,
(2) you don't give anyone copies of the programs or of this
document that have been modified in any way, and
(3) you don't charge anyone for copies of the programs or of the
documentation (other than to cover reasonable handling,
packaging and postal costs).
If you find yourself using SLED or SLHED regularly then please
remember that I didn't get them for free. Support the development
of cheap and useful software by sending $15 to the above address.
For $15 I can't afford to send you a leather-bound copy of the
manual or guarantee that there will be a "version 2" of the
editor. You don't need a manual or "quick reference card" close
at hand to use the editors. Both SLED and SLHED have been in use
for over six months by a variety of people and no problems have
been found with the programs. If you send the $15 you will,
however, be on my list of nice people who should be told about any
problems that are found with the editors or any new version.
SLED and SLHED Page 2
You run the editor by entering the name of the editor at the DOS
prompt, followed by the files to be edited and the options to be
used. An MS-DOS machine that is not a close copy of an IBM PC may
require use of the "slow" option. Refer to using /S on the
command line in the "SCREEN COLORS" section. You will also want
to look at the "OPTIONS" and "SCREEN COLORS" sections for all the
ways in which the editor can be configured.
To start with, here are three essential commands:
Alt-H Display a list of all the commands. You can return to
editing by using the escape key, or enter any command
or text character while still viewing the help page.
Alt-Q Discard from memory all files being edited, terminate the
editor, and return to DOS. See F7 for a less drastic exit.
Esc The escape key will always terminate the current
operation. If you are being prompted for a file name or a
search string, Esc will get you out of it. It is always
safe to press Esc, as it doesn't do anything itself.
MOVING THE CURSOR AROUND AND SIMPLE EDITING
Move the cursor to the start of the line.
Move the cursor to the end of the line.
Move the cursor up 22 lines.
Move the cursor down 22 lines.
Delete the character under the cursor, or if at the
end of a line, join the line with the cursor on it with
the one following.
Delete the character to the left of the cursor, or if at
the start of a line, join the line with the previous one.
Tab Move the cursor right to the next tab stop (usually every
Move the cursor left to the previous tab stop.
Put a line break where the cursor is, and put the cursor
at the start of the new line.
Move the cursor one line up in the file.
SLED and SLHED Page 3
Move the cursor one line down in the file.
Move the cursor one character left on the line.
Move the cursor one character right on the line.
Move the cursor to the start of the file.
Move the cursor to the end of the file.
Move the cursor to the top of the screen.
Move the cursor to the bottom of the screen.
Move the cursor to the right edge of the screen. If the
cursor is already at the right edge of the screen, scroll
the whole screen 60 columns right.
Move the cursor to the left edge of the screen. If the
cursor is already at the left edge of the screen, scroll
the whole screen 60 columns left.
Delete the line with the cursor on it.
Duplicate the line with the cursor on it and place the
cursor on the new line.
Alt-J Join the line with the cursor on it with the following.
Alt-K Erase the rest of the line starting at the cursor.
Alt-S Split the line at the cursor, leaving the cursor in place.
Alt-Z Move the cursor to where it was before the last Ctrl-Home,
Ctrl-End, Alt-B, Alt-T or search.
F6 Make the line with the cursor the screen's middle line.
F9 Treat the next key typed as text, even if it is an editor
F10 Insert an empty line after the one with the cursor on it
and move the cursor to the start of the new line. This is
equivalent to pressing End and then Enter.
SLED and SLHED Page 4
SEARCHING AND REPLACING
F2 starts a search. It asks for what is to be found. If you end
your entry with Enter, it is immediately searched for and the
cursor is moved to the first instance found. If you end your
entry with either F1 or F2, you are then prompted for a
replacement. If you end the replacement text with Enter, the
search text is searched for, and if it is found, you are asked to
press F2 to confirm that you want to make the replacement. If the
replacement is ended with F1 or F2 again, all instances of the
search text are replaced by the replacement, from the cursor
position to the end of the file.
Once a search has been started using F2, F1 can be used to repeat
or continue the previous search or search/replace. When you are
asked to press F2 to confirm a replacement, pressing any other key
abandons the search and does what that key would normally do.
In either case, pressing F1 will again resume the search.
If a multiple search/replace seems to be taking a long time, it
can be stopped by pressing Esc. You can then press F1 to resume
the search/replace if you wish.
When you are asked for a search text or a replacement, some keys
perform special functions. Esc abandons the operation; backspace
or the left-cursor key erase the last character entered; and F9
accepts the next key pressed as text, no matter what it is (except
that a second F9 means "cancel the effect of the first F9"). The
previous value of a search text or replacement is remembered, and
can be recovered a character at a time with the right-cursor key,
or in its entirety by the End key. Esc, backspace, left-cursor
and F9 can also be used when entering a file name for loading or
saving, a file name pattern or a DOS command.
Alt-F Reformat the text from the line with the cursor on it to
the next line with no text on it. The text is made to fit
into a width that must have previously been set with
Alt-W. Any spaces at the start of a reformatted line are
removed before formatting, so the resulting paragraph has
Alt-W Set the "word-wrap" width. The column that the cursor is
in is the new right margin setting, as used by Alt-F and
when loading files with the F option set. In addition,
typed text will "word-wrap" when it overflows this width.
This allows this editor to be used as a primitive
word processor. If the cursor is in the first column when
Alt-W is pressed, then the right margin is cleared, Alt-F
will not work, "word-wrap" is disabled and files loaded
with the F option revert to being split every 128
SLED and SLHED Page 5
MULTI-LINE AND BLOCK OPERATIONS
A "marked area" is created by marking the two end points with
Alt-X or Alt-L. When any part of the marked area is displayed on
the screen it will be highlighted.
Alt-X Mark the character under the cursor. If there is already
a marked area in the file, extend it to include the
Alt-L Mark the line with the cursor on it. If there is already
a marked area in the file, extend it to include the whole
of the current line.
Alt-T Move cursor to the top of the marked area.
Alt-B Move cursor to the bottom of the marked area.
Alt-C Copy the marked area to the cursor location. The copy
becomes the new marked area, making it easy to delete it
with Alt-D if a mistake has been made.
Alt-M Move the marked area to the cursor location. Like Alt-C,
the copy becomes the new marked area.
Alt-D Delete the marked area. After Alt-D, there will be no
marked area, but the deleted text is remembered, and if
before marking any new area Alt-C or Alt-M area used, they
will recover the deleted text.
Alt-U Remove the marks, leaving no marked area.
Alt-I Insert a new column at the cursor on each marked line,
shifting over the text to the right of the cursor. The
editor asks for a character to be entered, which is used
to fill the column.
Alt-= Insert a new column as with Alt-I. The character used to
fill the column is that used by the last Alt-I, or space
if Alt-I has not been used. This command is easier to
remember if you think of it as Alt-+.
Alt-- Delete a character at the cursor position on each marked
Alt-O (Alt-letter Oh, as in "Order") Sort the marked area, or
if no marked area, the rest of the file starting at the
line with the cursor on it. The sort field used is all
of a line following the current position of the cursor.
SLED and SLHED Page 6
LOADING AND SAVING FILES
Files to be edited must fit into the main memory of the computer,
as no spill files are used. When all of memory has been used,
only that part of the last file loaded that does fit in memory
will be available for editing. The only limit on the number of
files that can be edited is available memory. The editor cannot
work with lines longer than 16376 (not counting the terminating
carriage-return or line-feed) and splits longer lines.
F3 Load a file for editing. If Enter is pressed in response
to the file name request (no file name) and there is still
some text available from the last Alt-D, then that text
will be loaded.
F4 Save the file being edited using the name displayed on the
F5 List the files on the disk. When prompted for a file name
pattern, just pressing return will display the current
directory. The number in the lower right-hand corner is
the amount of free space on the disk in kilobytes. The
file listing you are given can be edited, and if given a
name with Alt-N, can even be saved on disk.
F7 Finish editing and discard from memory the current file.
You should normally save (F4) files before doing this, if
you've made any changes to the text. If this is the only
file left in memory the editor is terminated and you are
returned to DOS. Use Alt-Q if you are editing more than
one file and are done with all of them.
F8 Flip to another one of the files being edited. The files
can be thought of as being in a circle. F8 takes you
around the circle.
Alt-N Change the name of the file being edited. The new name
will be the one used when you save (F4) the file.
Alt-Y Run a DOS command without exiting the editor. You can
either enter the DOS command when asked for it, or if you
just press Enter, you will be dropped into DOS and will
need to use the DOS EXIT command to return to the editor.
Note: The editor doesn't free memory that it has used
back to DOS, so if you have been editing some large files,
there may not be enough memory to run a DOS command.
SLED and SLHED Page 7
GETTING THE EDITOR TO WORK THE WAY YOU WANT IT TO
Ins Set "Insert" mode, in which typed text "pushes-over"
existing text. If this mode is already set then this key
returns you to the normal mode in which entered text
overwrites existing text. When in "Insert" mode, "Ins" is
displayed on the last line of the screen.
Alt-A Set "auto-indent" mode. In this mode, whenever the cursor
is moved to a newly created blank line, the cursor is put
under the first non-blank character on the previous line.
This allows indented text to be easily entered. If you're
already in auto-indent mode, Alt-A will turn it off.
Alt-G Display the time on the last line, or if already
displayed, hide it.
Alt-E The horizontal scroll step (used by Ctrl-Right-cursor or
Ctrl-Left-cursor) and the vertical scroll step (used by
PgUp and PgDn) are reset to the horizontal and vertical
distance from the top left-hand corner of the screen to
the current position of the cursor. This allows the usual
scrolling values of 22 lines and 60 columns to be changed.
Alt-P Display all the option settings and allow them to be
changed. The number in the lower right-hand corner is the
amount of memory still available in kilobytes. See the
"OPTIONS" section for how to set the options and how to
save them on disk.
Alt-R Display the color, attributes or texture of each area on
the screen, and allow them to be changed. See the "SCREEN
COLORS" section for more information.
Alt-V Display line ends. This makes it easy to see how long
text lines are, especially those ending in spaces. If
the line ends are already displayed, Alt-V will hide them.
These pairs of keys are equivalent:
Shift-F1 and Alt-X Shift-F6 and Alt-M
Shift-F2 and Alt-L Shift-F7 and Alt-D
Shift-F3 and Alt-T Shift-F8 and Alt-U
Shift-F4 and Alt-B Shift-F9 and Alt-N
Shift-F5 and Alt-C Shift-F10 and Ctrl-Enter
F11 and Alt-A F12 and Alt-Q
Shift-F11 and Alt-Y Shift-F12 and Alt-P
Ctrl- and Alt-Fn-key do the same thing as Shift-Fn-key. F11 and
F12 only work on a Tandy 2000 (TM of Tandy Corporation).
SLED and SLHED Page 8
THE MS-DOS COMMAND LINE
Whenever you are at the MS-DOS command prompt, you can run the
editor by entering its name, followed by the names of the files
you wish to edit and the options you wish to set for this editing
session. For example, if the editor is SLED.COM, and you want to
edit files ABC.TXT and PQR.TXT with the "P" and "B" options, enter
SLED ABC.TXT PQR.TXT /P/B
Each of the options described in the "OPTIONS" section below is
represented by a letter, and mentioning it on the command line
reverses the value it would have had by default. In addition, one
of the "S", "M" or "F" options from the "SCREEN COLORS" section
can be used. Each option can be placed anywhere on the command
line after the program name so long as it is preceded by a slash.
The files named on the command line are loaded in the order they
appear on the command line, and the last file named is the first
displayed. If no file names are given, the Help page is displayed.
Because many programming language compilers and communications
programs can invoke a user-specified editor, two other types of
entries can be placed on the command line. It's expected that
these entries will be generated by the program calling the editor
rather than by the user. One or two numbers, each preceded by a
slash, represent the initial line and column position of the
cursor in the last file loaded. A double quote (") after a slash
causes the rest of the command line to be used as a message at the
bottom of the first screen of text displayed. So for example, the
following command would load ABC.TXT, place the cursor on line 53
and in column 9, and start out by displaying "This is the spot".
ED ABC.TXT /53/9/"This is the spot
Each option is represented by a letter as described in the
previous section. As well as appearing on the command line, the
values of all these options can be viewed and changed using Alt-P.
After pressing Alt-P and changing some of the settings, you can
press F4 to save the current setup on disk. Pressing F4 creates
a new editor, to be used in place of the old one, with the options
as you have set them. When asked for a new name for the editor,
enter it without an extension, as ".COM" is added to the name.
The new editor not only incorporates the option settings of the
current session, but also scrolling steps set by Alt-E, the margin
setting (Alt-W), the filling character (Alt-I), screen colors,
line-end and non-text filling characters, the border color and
the screen writing speed (Alt-R). These become the default values
of the new editor. Using the new editor with options on the
command line will reverse the values of these new defaults.
SLED and SLHED Page 9
The meanings of the option letters are as follows:
A Auto-indent mode. See Alt-A.
B Treat Ctrl-Z as text when loading a file. Normally Ctrl-Z
is used to mark the end a file.
C Add a carriage-return character to the end of each line of
text saved by F4. DOS files usually have both a
carriage-return and a line-feed at the end of each line.
CP/M files just have a carriage-return and Unix files just
have a line-feed. You can edit non-text files by leaving
G Display clock. See Alt-G.
H When loading a file, ignore the high-order bit of each
character. This option is useful for reading the files
created by some word processors that leave formatting
information in their files, but shouldn't be used with
most DOS text files.
I Insert mode. See Ins key.
K Display the status of the Caps Lock and NumLock keys. If
this option is set, the part of the last line of the
screen that normally displays "Ins" when the Insert key is
toggled on, instead displays one character for each of the
Insert key (blank if off, "I" if on), the Caps Lock key
("a" if off, "A" if on), and the NumLock key (blank if
off, "#" if on).
L Add a line-feed character to the end of each line of text
saved by F4.
P Set tab stops every 4 columns instead of the usual 8.
Q Don't compress spaces to tabs inside 'single quotes' or
"double quotes" even if the T option is set on.
R Restore the screen when leaving the editor. This option
must be in effect when the editor is started (by default
or using /R) or no screen will be saved to be restored.
As the "slow" option (/S) implies a low level of PC
compatibility, it must also imply that the usual methods
of screen saving don't work, and so when it is in effect,
the "R" option is interpreted to mean that the user wishes
to retain the screen colors used by the editor when the
T Use tabs to compress spaces out of files saved by F4.
Tabs are placed in lines on the assumption that there is a
tab stop every 8 columns, no matter what the P option is
V Display line ends. See Alt-V.
W Treat every character read when loading a file as text.
This includes carriage-returns, line-feeds, tabs and
Ctrl-Zs. The text is broken after each 128 characters
unless a margin has been set by Alt-W, in which case it is
used as the width. This option should only be used to
load binary files.
X Remove trailing spaces on each line saved by F4.
Z Add a Ctrl-Z to the end of a file saved by F4. This
option should usually be set for DOS and CP/M, but not for
Unix. It shouldn't be set when editing non-text files.
SLED and SLHED Page 10
Pressing Alt-R displays a menu with eight different sets of
colors. The hexadecimal number of each foreground (F) and
background (B) color as well as that of the border (X) is shown.
Different colors are available on different types of monitors.
You select one of eight display fields by pressing a digit from 1
to 8 or with the up-cursor and down-cursor keys. The digit in
front of the currently selected field is highlighted so you can
see what you are doing. Once a field has been selected, its
color (or on monochrome monitors, its attributes) can be changed.
The F and B keys cycle through the available foreground and
background colors. A background color from 8 to "F" causes the
text to blink. The X key cycles through the border colors. If
the border isn't to be set then a dash replaces the color number.
Setting the border has no effect on a monochrome TTL monitor.
For a monochrome TTL monitor only the following combinations of
foreground (F) and background (B) are distinct and usable:
7 0 is normal text, F 0 is bright text,
1 0 is underlined text, 9 0 is underlined bright text, and
0 7 is reversed text.
For a blinking field, set the background to 8 instead of 0, or F
instead of 7.
There are three different ways for the editor to write text to the
screen. You choose one by repeatedly pressing "S" when in the
Alt-R menu or by using /S, /M or /F on the command line:
- "slow" video speed (/S) uses the machine's ROM BIOS to write
all characters. It will work on many MS-DOS machines with
display adapters incompatible with those on a standard PC.
- "med." (medium) video speed (/M) writes directly to the
screen but synchronizes with screen refreshing to avoid
the appearance of "snow" on the IBM Color Graphics Adapter.
- "fast" video speed (/F) writes directly, not synchronized.
If you have a Composite monitor attached to a Color Graphics
Adapter, press M to select whether it will be fed a color or
monochrome signal. This option has no effect on an RGB color
monitor or on a monochrome TTL monitor.
For the editor that runs in graphics mode on a Hercules Graphics
adapter or compatible, there are the six possible combinations of
solid(W), black(B) and shaded(G) text. The X key (instead of F
and B) cycles through these six distinct textures.
For all types of monitors, pressing the letter T while field 2
(visible line ends) or 5 (non-text filler) is selected allows you
to change the character used as a visible line end or that used to
fill the parts of the screen that are empty of text respectively.
You should have both marked and unmarked text on the screen when
Alt-R is invoked with visible line ends displayed, so that the
effect of changing the colors of these fields can be seen.
SLED or SLHED can run either from a floppy disk or from
your hard disk. To install, simply copy the appropriate
.COM file to the disk.
On hard disks, copy the files to a directory contained in
the PATH command in your AUTOEXEC.BAT file. When you run
SLED or SLHED, it looks for its Text files in your current
directory, which greatly simplifies its use.
When specifying a file for the editor to use, you may include
any DOS drive and path information, as you do with any DOS