home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Format 14
/
Disk14-1.iso
/
SEDH.EXE
/
SED.DOC
next >
Wrap
Text File
|
1989-07-09
|
6KB
|
155 lines
SED.EXE is a small notepad like editor which uses familiar WordStar/
Sidekick commands. It is designed to be run both on its own, and from other
programs. The program accepts several parameters to affect operation.
SED is called as follows:-
C:\> sed <file> <options>
where <file> is any dos text file, using standard naming (a path may be
specified, but no wildcards are allowed). If a file name is not entered then
SED assumes "NONAME" as a default file name.
examples:-
sed --- invokes editor to edit a new file, "NONAME"
sed file.ext --- invokes editor to edit "file.ext"
It is also possible to supply further parameters on the command line which
instruct the editor to change any of several default settings. An options
parameter looks like this:-
-IAWA
where the '-' must precede the start of an options lists, and the several
characters which follow each set one option. The individual options are:-
I -- Insert mode should be initially OFF (defaults to ON)
A -- Auto-Indent mode should be initially OFF (defaults to ON)
W -- Word Wrap mode should be initially OFF (defaults to ON)
B -- Editor should not create .BAK files (it does by default)
J -- Justified Right Margin (defaults to OFF, ie ragged)
M -- Set Right Margin (see below)
C -- Colour overrides (see below)
D -- Display Window overrides (see below)
S -- Suppress Clear Screen when leaving editor.
example:-
sed file.ext -AWB
calls the editor to edit file "file.ext". Auto indent will be initially off,
as will word wrap and .BAK file creation.
Right Margin Setting
--------------------
The right margin normally defaults to the full window width, however you can
set your own right margin by supplying an M parameter. The syntax of this
option is:-
sed file.ext -M[rr]
where "rr" is the column number which the right margin should be set to. For
example,
sed file.ext -m[70]
sets the right margin to column 70.
Colour Overrides.
-----------------
The editor uses a default set of colours for various titles etc. These can
be overridden using the command line option mentioned briefly above. The
syntax of this option is as follows:-
sed file.ext -C[nn,bb,ee,ii]
nn,bb,ee and ii are the colour attributes to use for (respectively) normal
text, marked blocks, error messages and the information line. For example:-
sed file.ext -C[7,112,112,112]
tells the editor to use attribute 7 for normal text (7 = light gray on black)
and attribute 112 for all other prompts (112 = black on light gray, eg
reverse).
The following table helps you to calculate which attribute to use:-
ForeGround Colour Background Colour
Black = 0 Black = 0
Blue = 1 Blue = 1
Green = 2 Green = 2
Cyan = 3 Cyan = 3
Red = 4 Red = 4
Magenta = 5 Magenta = 5
Brown = 6 Brown = 6
LightGray = 7 LightGray = 7
DarkGray = 8
LightBlue = 9
LightGreen = 10
LightCyan = 11
LightRed = 12
Light Magenta = 13
Yellow = 14
White = 15
To calculate an IBM PC colour attribute, take the number of the background
colour you want and multiply it by 16. Then add the number of the
foreground colour. The result is the attribute value in decimal which you
use in the colour override option of the editor. Note that you cannot use
high intensity foreground colours (unless you want to fiddle with the blink
bit externally).
Display Window Override.
------------------------
The editor normally takes over the entire display for its own use, however
it can be told to restrict itself to a defined region of the display using
this option. The syntax is the same as for the colour overrides, but with a
different initial letter, ie:-
sed file.ext -D[xx,yy,ww,hh]
Where xx,yy,ww and hh are (respectively) the x-position of the window origin,
(0-79), the y position of the window origin (0-24), the window width, and the
window height.
Note: A window is just a rectangular portion of the display. The editor does
not draw boxes etc around this region. The idea is that you use this option
from a program, and that program draws its own box using your own flavour of
frame etc. If you do this then the window dimensions you pass to sed should
define a rectangular portion of the screen which does not overwrite the left,
right or bottom of the window frame, but which *does* overwrite the top of
the window frame (sed will put it's information line there).
A full example:-
sed file.ext -IAWBS -C[7,112,112,112] -D[5,5,70,15]
Edits file "FILE.EXT", insert mode is off, as is auto-indent, word wrap and
.BAK file creation, screen clearing is suppressed on exit, and colour
settings and the window region are overridden.
The SED editor is entirely my own work, written in Modula-2 using the JPI M2
compiler. SED.EXE and this document are hereby placed entirely in the public
domain. Do with it as you will.
Don Milne.
86 Leadside Road.,
Aberdeen
AB2 4TU.
CIX-id : mpack
BIX-id : mpack
22nd May 1989.