home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG090.ARC
/
EDIT.DOC
< prev
next >
Wrap
Text File
|
1979-12-31
|
12KB
|
292 lines
EDIT.COM Multiple Utility Program
---------------------------------
Version 1.1
Introduction
EDIT is a utility program which performs many different functions
often needed in daily computing, put together in a single small
program which is easy to use. Functions include text editing,
disk file size and free space reports, file printing, file copy-
ing, 'dumping' of a file in binary format, and alteration of
machine code files. Even if only one of EDIT's functions is used,
the program is still smaller than comparable single-function
utilities.
An example of a typical use is with dBase II. EDIT will enable
the user to write and modify command files, check on the disk
space left, copy files for backup, list command files on his
printer, and even (assuming enough knowledge) examining and
repairing 'broken' files.
EDIT is unique in that all of these functions are within a single
program only 2K in length. Operation is fast and easy with single
letter commands for editing, and prompting where required. EDIT
will replace PIP, STAT, XDIR, and ED for most users needs.
One of the reasons for EDIT's small size and fast operation is
its method of handling files. The entire file is read into memory
at one time, and re-written only after the desired changes are
made. For safety EDIT never changes the original file, always
writing a new modified copy. However, the tradeoff is that the
entire file must fit in the 'TPA' of your computer. For most 64K
machines, this means that you can use EDIT on files up to about
50K in size, which is more than adequate for most applications.
EDIT won't damage a file too large - it simply won't work with
it.
System Requirements
EDIT will work with any CP/M 2.2 or 3.0 computer. If the machine
is a CP/M Plus system with bank switching, the amount of disk
free space reported will be incorrect, but all other functions
work normally. A specific amount of RAM is not required.
Installation
EDIT is easily installed using only EDIT itself. Follow the
following steps.
1. Copy EDIT onto a disk with CP/M on it, using whatever method
your computer outlines for copying files. Put the original EDIT
disk away with your backup disks.
2. Find out the 'hex code' your computer or terminal uses to èclear its screen. If you don't know this or can't find it in your
manual, ask your dealers technician. Be sure it is in 'hex'. For
example, an Osborne's code is '1A hex'. A Z-19 terminal would use
'1B hex, 45 hex', two codes.
3. With your EDIT disk in the computer type EDIT EDIT.COM C
<Return>. EDIT will respond with the question ADDRESS?
which you answer 855 <Return> . EDIT will respond with
BYTE=00h CHANGE TO: . Enter your first hex code. (For Osborne
this would be 1A.)
4. If you have more than one hex code to enter (each one is two
digits) repeat the above process for addresses 856, and 857 if
needed. Then when you are done and EDIT is still asking ADDRESS?,
just hit <Return> and EDIT will rewrite the changed file, in this
case itself.
Now look at the disk. You should have EDIT.COM and EDIT.BAK.
EDIT.BAK is the original file and EDIT.COM is your newly instal-
led version.
Instruction
To get used to EDIT, we suggest making a special disk for prac-
tice. Prepare yourself a work disk with CP/M on it (check your
computer manual if you don't know how to do this.) Then put your
empty work disk in drive A: and a disk with EDIT on it in drive
B:.
1. Copying files
First we will learn how to copy files using EDIT. Type B:
<Return> so that we are on the B: drive (where EDIT is now). To
copy EDIT onto our work disk type EDIT EDIT.COM A: <Return> .
EDIT will copy itself to drive A:. Then we can type A:<Return>
to go back to the A: drive. Type DIR<Return> to see that EDIT is
there. Here is what we did:
EDIT EDIT.COM A: <Return>
(starts EDIT) (tells EDIT what) (tells EDIT what) (tells EDIT to)
( file to copy ) (drive to put it) ( get going! )
( on )
2. Make a test file
Now we are going to make a test file for us to practice on. Type
EDIT TEST.TXT <Return> . EDIT will inform you that this is a
new file and ask for a command. We want to insert text, so press
I for Insert. (You don't have to hit Return!) Your screen will
clear (if you installed EDIT properly).
Now type in whatever you want, say part of the newspaper. Put in èenough so that you fill up more than the screen can display at
once. When you are ready to stop inserting, type / <Return> at
the beginning of a new line. When we do this character at the
beginning of a line EDIT knows that we want to stop inserting.
EDIT will now ask for another command.
We're done for now so type Q for Quit. (Again, no Return.)
EDIT will save the file we made onto the disk. When CP/M gives
you the A> prompt, type TYPE TEST.TXT<Return> , and you
should see the words we just entered. Try copying TEST.TXT to the
B: drive (the command is EDIT TEST.TXT B: <Return> ).
3. File size and Free Space
Now try typing EDIT <Return> . We should get a list of all
files (in this case just EDIT.COM and TEST.TXT) with their sizes,
and a report on how much room is left on the disk. Keep trying
this as we create more files, and see how useful it is. Try
typing EDIT B: <Return> and you will get a list of files on
the B: drive.
4. Hex Dump
Many users won't have much need for this function, but it is fun.
A 'hex dump' is a display of the digital codes that are inside a
file. Type EDIT TEST.TXT D <Return> . You should see on your
screen a complete list of all the digital codes inside TEST.TXT.
Over on the right is a list of the letter that goes with that
code, if any. (If no letter goes with that code we just put a
period there.) It is easy to stop the display from scrolling when
you want to examine something - just type a Control-S to freeze
the display. Then when you are done, type any key to start it
again. (A CP/M Plus computer needs Control-Q to start again.)
While this function is mostly useful to programmers, it can
sometimes help to locate a bad byte in a 'broken' file. Try doing
a hex dump of other files and see whats inside them.
5. Printing
EDIT can send files to the printer for you. Get your printer
ready to go, and type EDIT TEST.TXT P <Return> . The text you
entered earlier is now sent to the printer. When the printing is
done and you are back at the A> prompt, type EDIT - <Return) .
This will make you printer formfeed to the next page stop. (Some-
times this can be easier than reaching your printer!)
6. Text editing
To edit our test file, type EDIT TEST.TXT <Return> . EDIT will
load TEST.TXT into memory and display the first 22 lines on the
screen.è
First we will try the commands for moving around. All of these
commands are just one letter - no Return needed.
'U' and 'D' are the commands for moving the text on the screen up
or down one line. 'H' is a special kind of up that hops five
lines. 'P' and 'N' will jump the screen to the previous or next
whole screen. Finally, 'B' or 'E' will move you to the beginning
or the end of the file. Try each one of these commands until they
are understood fully.
Now we will insert some text. Push 'B' (to the beginning) 'H'
(hop up five lines) and 'I' (insert). Your screen will blank.
Type some recognizable line such as 'This is the inserted text.'
and hit return. Now type / <Return> to stop the insert mode.
You should see the line you inserted at the top of the screen.
Hit 'B' (go to beginning) and you will see your inserted line
five lines down.
The important thing to note here is that the text was inserted
before the line that was at the top of the screen when you pushed
'I' (insert). The line at the top of the screen is the 'active
line', i.e., most things will happen at that place in the file.
Now use 'U' to move the line you inserted to the top of the
screen. Hit 'K' for kill. This command deletes the line at the
top of the screen. Hit 'B' (beginning) and you will see that the
inserted line is now gone. If you ever want to kill an entire
screen of text, use the 'Z' (zap) command. Because deleting a
whole screen is pretty drastic, Zap will first ask you to confirm
your choice with a 'Y' or 'N'.
EDIT is what is called a 'line editor'; this means that you must
insert or delete an entire line when you make changes. This is
part of the reason why EDIT is so small.
One last word on inserting: If you ever have an entirely seperate
text file that you would like to include in the one you are
working on you can use the 'R' (read file) command. This will ask
you for a filename, go get the file, and insert the whole thing
at the top of the screen.
There are two commands for you to use when you are done editing.
One is 'Q' for quit. This saves your edited file, and renames
your original file to filename.BAK, for backup. The other command
is for when you have decided not to save your work, and want the
files on the disk to remain just as they originally were. This
command is 'J', for 'junk changes'. Just as with the Zap command,
abandoning a file can lose important work, so before we go
through with a Junk you are asked to confirm the choice with a
'Y' or a 'N'.
The last command to learn is the 'F' (find) command. This works a
little differently than most other editors, and is intended
primarily for programmers.è
Look ahead in your test file for a word which is the first word
on a line. Then use 'B' to move away from it. Hit 'F' and EDIT
will ask you what label to find. Give it the word you saw and a
<Return>. EDIT will search the file for a line starting with that
word and position that line at the top of the screen. If no word
is found, EDIT positions the file at the beginning.
Caution: the word must match the case of the original - if one is
upper case and one is lower case, the word will not be found.
Quick Reference - EDIT.COM Version 1.1
---------------------------------------
Function commands (entered at the A> and followed by Return)
All commands can be upper or lower case
EDIT - gives XDIR report for current disk
EDIT B: - gives XDIR report for specified disk
EDIT filename.typ - Edits file, creates file if new
EDIT B:filename.typ - Edits file on specific drive, creates
file if new
EDIT filename.typ C - allows changing a byte in any file
EDIT filename.typ D - dumps file to screen
EDIT filename.typ P - Sends file to the printer
- expands tabs and provides page breaks
EDIT - - Sends formfeed to printer
EDIT filename.typ B: - Copies file from current disk to B:
EDIT A:filename.typ B: - Copies file from A: to B:
EDIT B:filename.typ A: - Copies file from B: to A:
Text editing commands (not followed by pressing Return)
è U - moves text UP a line
H - HOPs text up 5 lines
D - moves text DOWN a line
P - moves to the PREVIOUS screen
N - moves to the NEXT screen
B - moves to the BEGINNING of the file
E - moves to the END of the file
I - INSERT text mode
/ - / <CR> at start of new line to stop inserting
R - READ in file and block insert into current file
K - KILL line at top of screen
T - TRUNCATE file from top of screen
Z - ZAP entire page
F - FIND line (asks for label to search for)
J - JUNK changes, leave disk file as it was
Q - QUIT and save file. original is named .BAK
Install on specific machine by patching in clear screen codes in
bytes 0855h - 0857h. Set unused bytes to 0.