home *** CD-ROM | disk | FTP | other *** search
- EDIT.COM Multiple Utility Program
- ---------------------------------
-
- Version 1.1 adapted for the PX8 by Ken Madell
- 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.
-
- Other uses of EDIT are for TYPEing Wordstar document files, adding
- comments to LISP programs created with a structure editor, maintaining
- a quick reference card file (using the Find label command) or notepad,
- backing up files to cassette, and patching hardware configurable
- programs. I have also found the disassembled EDIT useful for quickly
- learning about CP/M BDOS calls and Z80, 8080 assembler mnemonics.
- There are a number of useful subroutines which can be transplanted
- into your own programs. (km)
-
- 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
-
- I HAVE INSTALLED EDIT FOR THE PX8 and have made a number of enhancements
- to the original. The screen size is set to 6 lines of text followed
- by a blank line followed by the Command line. During screen redraw, the
- keyboard is constantly scanned for additional commands ( like Wordstar ).
- This is very important on the PX8 since redraw of even 8 lines takes
- forever. Of the text editting commands, F and Z have been modified
- from the original and H has been omitted since it serves no useful
- purpose on the PX8. (km)
-
-
- Instruction
-
- 1. Copying files - an example
-
-
- EDIT B:FILINK.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.
-
-
- 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) 'N'
- (hop up six 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
- six 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 extract a block of text from a file, use the T
- and Z commands. The Z command deletes everything from the beginning
- of the file up to the line on the top of the screen. The T command
- deletes everything from the top line on the screen to the end of the
- file. Since block deletion is pretty drastic, Zap will first ask you to
- confirm your choice with a 'Y' or 'N'. When only the block you want
- to extract is left, enter Q to save the file. The original full file
- will have a .BAK extension. You may rename the files at this point
- if you wish. (km)
-
- 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.
-
- The Find command searches for a match starting from the top of the
- screen (but not including the first letter of the screen). You can
- make a notefile or card filee by using a special character to code
- the note or card subject. For example a recipe file could have the
- name of each recipe preceded by a '@' character; then F @ would step
- through the recipes, or F @ Chicken would step ahead to the next
- Chicken recipe. (km)
-
- @ Chicken soup
- 1 chicken
- 2 tbs salt
- 2 chopped onions
-
- @ Lasagna
- 1 cup chopped meat
- 1 cup tomato sauce
- 12 cooked noodles
-
- etc. (km)
-
-
- 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
- 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 to top of screen
- 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
- (asks for label to search for)
- J - JUNK changes, leave disk f