home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / a / editpxst.lbr / EDITPXST.DZC / EDITPXST.DOC
Encoding:
Text File  |  1993-10-26  |  12.0 KB  |  281 lines

  1.                  EDIT.COM Multiple Utility Program
  2.                  ---------------------------------
  3.  
  4. Version 1.1  adapted for the PX8 by Ken Madell    
  5. Introduction
  6.  
  7. EDIT is a utility program which performs many different functions 
  8. often  needed in daily computing,  put together in a single small 
  9. program  which is easy to use.  Functions include  text  editing,
  10. disk file size and free space reports,  file printing, file copy-
  11. ing,  'dumping'  of  a file in binary format,  and alteration  of 
  12. machine code files. Even if only one of EDIT's functions is used, 
  13. the  program  is still smaller  than  comparable  single-function 
  14. utilities.
  15.  
  16. An  example of a typical use is with dBase II.  EDIT will  enable 
  17. the user  to write  and modify command files,  check  on the disk 
  18. space left,  copy files  for backup,  list command  files  on his
  19. printer,  and  even  (assuming  enough knowledge)  examining  and
  20. repairing 'broken' files.
  21.  
  22. Other uses of EDIT are for TYPEing Wordstar document files, adding
  23. comments to LISP programs created with a structure editor, maintaining
  24. a quick reference card file (using the Find label command) or notepad,
  25. backing up files to cassette, and patching hardware configurable 
  26. programs.  I have also found the disassembled EDIT useful for quickly
  27. learning about CP/M BDOS calls and Z80, 8080 assembler mnemonics.
  28. There are a number of useful subroutines which can be transplanted
  29. into your own programs.  (km)
  30.  
  31. EDIT is unique in that all of these functions are within a single 
  32. program only 2K in length. Operation is fast and easy with single 
  33. letter commands for editing,  and prompting where required.  EDIT 
  34. will replace PIP, STAT, XDIR, and ED for most users needs.
  35.  
  36. One  of  the reasons for EDIT's small size and fast operation  is 
  37. its method of handling files. The entire file is read into memory 
  38. at  one time,  and re-written only after the desired changes  are 
  39. made.  For  safety EDIT never changes the original  file,  always 
  40. writing a new modified copy.  However,  the tradeoff is that  the 
  41. entire file must fit in the 'TPA' of your computer.  For most 64K 
  42. machines,  this  means that you can use EDIT on files up to about 
  43. 50K in size,  which is more than adequate for most  applications. 
  44. EDIT  won't  damage a file too large - it simply won't work  with 
  45. it.
  46.  
  47. System Requirements
  48.  
  49. EDIT will work with any CP/M 2.2 or 3.0 computer.  If the machine 
  50. is  a CP/M Plus system with bank switching,  the amount  of  disk 
  51. free  space reported will be incorrect,  but all other  functions 
  52. work normally. A specific amount of RAM is not required.
  53.  
  54.  
  55. Installation
  56.  
  57. I HAVE INSTALLED EDIT FOR THE PX8 and have made a number of enhancements
  58. to the original.  The screen size is set to 6 lines of text followed
  59. by a blank line followed by the Command line.  During screen redraw, the
  60. keyboard is constantly scanned for additional commands ( like Wordstar ).
  61. This is very important on the PX8 since redraw of even 8 lines takes  
  62. forever.  Of the text editting commands, F and Z have been modified
  63. from the original and H has been omitted since it serves no useful
  64. purpose on the PX8.  (km) 
  65.  
  66.  
  67. Instruction
  68.  
  69. 1. Copying files - an example 
  70.  
  71.  
  72. EDIT          B:FILINK.COM              A:             <Return>
  73.  
  74. (starts EDIT) (tells EDIT what) (tells EDIT what) (tells EDIT to)
  75.               (  file to copy ) (drive to put it) (  get going! )
  76.                                 (       on      )
  77.  
  78. 2. Make a test file
  79.  
  80. Now we are going to make a test file for us to practice on.  Type 
  81. EDIT  TEST.TXT <Return>   .  EDIT will inform you that this is  a 
  82. new file and ask for a command.  We want to insert text, so press 
  83. I  for Insert.  (You don't have to hit Return!) Your screen  will 
  84. clear (if you installed EDIT properly).
  85.  
  86. Now type in whatever you want,  say part of the newspaper. Put in 
  87. enough  so that you fill up more than the screen can  display  at 
  88. once.  When you are ready to stop inserting, type  /  <Return> at 
  89. the  beginning  of a new line.  When we do this character at  the 
  90. beginning  of a line EDIT knows that we want to  stop  inserting. 
  91. EDIT will now ask for another command.
  92.  
  93. We're  done for now so type  Q   for Quit.  (Again,  no  Return.) 
  94. EDIT  will save the file we made onto the disk.  When CP/M  gives 
  95. you  the  A> prompt,  type   TYPE TEST.TXT<Return>    ,  and  you 
  96. should see the words we just entered. 
  97.  
  98.  
  99. 3. File size and Free Space
  100.  
  101. Now try typing     EDIT <Return>   .  We should get a list of all 
  102. files (in this case just EDIT.COM and TEST.TXT) with their sizes, 
  103. and  a report on how much room is left on the disk.  Keep  trying 
  104. this  as  we create more files,  and see how useful  it  is.  Try 
  105. typing     EDIT B:  <Return> and you will get a list of files  on 
  106. the B: drive.
  107.  
  108.  
  109.  
  110. 4. Hex Dump
  111.  
  112. Many users won't have much need for this function, but it is fun. 
  113. A  'hex dump' is a display of the digital codes that are inside a 
  114. file.  Type   EDIT TEST.TXT D <Return>   . You should see on your 
  115. screen a complete list of all the digital codes inside  TEST.TXT. 
  116. Over  on  the right is a list of the letter that goes  with  that 
  117. code,  if  any.  (If no letter goes with that code we just put  a 
  118. period there.) It is easy to stop the display from scrolling when 
  119. you  want to examine something - just type a Control-S to  freeze 
  120. the  display.  Then when you are done,  type any key to start  it 
  121. again.  (A  CP/M  Plus computer needs Control-Q to start  again.) 
  122. While  this  function is mostly useful  to  programmers,  it  can 
  123. sometimes help to locate a bad byte in a 'broken' file. Try doing 
  124. a hex dump of other files and see whats inside them.
  125.  
  126. 5. Printing
  127.  
  128. EDIT  can  send files to the printer for you.  Get  your  printer 
  129. ready to go,  and type   EDIT TEST.TXT P <Return>  . The text you 
  130. entered earlier is now sent to the printer.  When the printing is 
  131. done  and you are back at the A> prompt,  type EDIT - <Return)  . 
  132. This will make you printer formfeed to the next page stop. (Some-
  133. times this can be easier than reaching your printer!)
  134.  
  135.  
  136. 6. Text editing
  137.  
  138. To edit our test file,  type  EDIT TEST.TXT <Return>  . EDIT will 
  139. load  TEST.TXT into memory and display the first 22 lines on  the 
  140. screen.
  141.  
  142. First  we will try the commands for moving around.  All of  these 
  143. commands are just one letter - no Return needed.
  144.  
  145. 'U' and 'D' are the commands for moving the text on the screen up 
  146. or  down  one line.  'H' is a  special kind of up that hops  five 
  147. lines.  'P' and 'N' will jump the screen to the previous or  next 
  148. whole screen.  Finally, 'B' or 'E' will move you to the beginning 
  149. or the end of the file. Try each one of these commands until they 
  150. are understood fully.
  151.  
  152. Now  we  will insert some text.  Push 'B' (to the beginning)  'N' 
  153. (hop  up six lines) and 'I' (insert).  Your screen  will  blank. 
  154. Type  some recognizable line such as 'This is the inserted text.' 
  155. and hit return.  Now type   / <Return>  to stop the insert  mode. 
  156. You  should  see the line you inserted at the top of the  screen. 
  157. Hit  'B'  (go to beginning) and you will see your  inserted  line 
  158. six lines down.
  159.  
  160. The  important thing to note here is that the text  was  inserted 
  161. before the line that was at the top of the screen when you pushed 
  162. 'I'  (insert).  The line at the top of the screen is the  'active 
  163. line', i.e., most things will happen at that place in the file.
  164.  
  165. Now  use  'U'  to move the line you inserted to the  top  of  the 
  166. screen.  Hit  'K' for kill.  This command deletes the line at the 
  167. top of the screen.  Hit 'B' (beginning) and you will see that the 
  168. inserted  line is now gone.  
  169.  
  170. If you ever want to extract a block of text from a file, use the T
  171. and Z commands.  The Z command deletes everything from the beginning
  172. of the file up to the line on the top of the screen.  The T command
  173. deletes everything from the top line on the screen to the end of the
  174. file. Since block deletion is pretty drastic, Zap will first ask you to 
  175. confirm your choice with a 'Y' or 'N'. When only the block you want 
  176. to extract is left, enter Q to save the file.  The original full file 
  177. will have a .BAK extension. You may rename the files at this point 
  178. if you wish.  (km)
  179.  
  180. EDIT is what is called a 'line editor'; this means that you  must
  181. insert or delete an entire line when you  make  changes.  This is
  182. part of the reason why EDIT is so small.
  183.  
  184. One last word on inserting: If you ever have an entirely seperate 
  185. text  file  that  you would like to include in the  one  you  are 
  186. working on you can use the 'R' (read file) command. This will ask 
  187. you for a filename,  go get the file,  and insert the whole thing 
  188. at the top of the screen.
  189.  
  190. There  are two commands for you to use when you are done editing. 
  191. One  is 'Q' for quit.  This saves your edited file,  and  renames 
  192. your original file to filename.BAK, for backup. The other command 
  193. is for when you have decided not to save your work,  and want the 
  194. files  on the disk to remain just as they originally  were.  This 
  195. command is 'J', for 'junk changes'. Just as with the Zap command, 
  196. abandoning  a  file  can lose important work,  so  before  we  go 
  197. through  with a Junk you are asked to confirm the choice  with  a 
  198. 'Y' or a 'N'.
  199.  
  200. The last command to learn is the 'F' (find) command. This works a 
  201. little  differently  than  most other editors,  and  is  intended 
  202. primarily for programmers.
  203.  
  204. Look  ahead in your test file for a word which is the first  word 
  205. on a line.  Then use 'B' to move away from it.  Hit 'F' and  EDIT 
  206. will  ask you what label to find.  Give it the word you saw and a 
  207. <Return>. EDIT will search the file for a line starting with that 
  208. word and position that line at the top of the screen.  If no word 
  209. is found, EDIT positions the file at the beginning.
  210.  
  211. Caution: the word must match the case of the original - if one is 
  212. upper case and one is lower case, the word will not be found.
  213.  
  214. The Find command searches for a match starting from the top of the
  215. screen (but not including the first letter of the screen).  You can
  216. make a notefile or card filee by using a special character to code
  217. the note or card subject.  For example a recipe file could have the 
  218. name of each recipe preceded by a '@' character; then F @ would step
  219. through the recipes, or F @ Chicken would step ahead to the next
  220. Chicken recipe. (km) 
  221.  
  222. @ Chicken soup
  223.     1 chicken
  224.     2 tbs salt
  225.     2 chopped onions
  226.  
  227. @ Lasagna
  228.     1 cup chopped meat
  229.     1 cup tomato sauce
  230.     12 cooked noodles
  231.  
  232. etc.  (km) 
  233.  
  234.  
  235.               Quick Reference - EDIT.COM  Version 1.1
  236.               ---------------------------------------
  237.  
  238. Function commands (entered at the A> and followed by Return)
  239. All commands can be upper or lower case
  240.  
  241. EDIT            - gives XDIR report for current disk
  242. EDIT B:            - gives XDIR report for specified disk
  243.  
  244. EDIT filename.typ       - Edits file, creates file if new
  245. EDIT B:filename.typ    - Edits file on specific drive, creates
  246.                           file if new
  247.  
  248. EDIT filename.typ C    - allows changing a byte in any file
  249.  
  250. EDIT filename.typ D    - dumps file to screen
  251.  
  252. EDIT filename.typ P     - Sends file to the printer
  253.                         - expands tabs and provides page breaks
  254.  
  255. EDIT -            - Sends formfeed to printer
  256.  
  257. EDIT filename.typ B:    - Copies file from current disk to B:
  258. EDIT A:filename.typ B:    - Copies file from A: to B:
  259. EDIT B:filename.typ A:    - Copies file from B: to A:
  260.  
  261.  
  262. Text editing commands (not followed by pressing Return)
  263.  
  264.     U - moves text UP a line
  265.     D - moves text DOWN a line
  266.     P - moves to the PREVIOUS screen
  267.     N - moves to the NEXT screen
  268.     B - moves to the BEGINNING of the file
  269.     E - moves to the END of the file
  270.  
  271.     I - INSERT text mode
  272.     / - / <CR> at start of new line to stop inserting
  273.     R - READ in file and block insert into current file
  274.     K - KILL line at top of screen
  275.         T - TRUNCATE file from top of screen
  276.     Z - ZAP to top of screen
  277.     F - FIND line (asks for label to search for)
  278.     J - JUNK changes, leave disk file as it was
  279.     Q - QUIT and save file. original is named .BAK
  280. (asks for label to search for)
  281.     J - JUNK changes, leave disk f