home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug090.arc / EDIT.DOC < prev    next >
Text File  |  1979-12-31  |  12KB  |  292 lines

  1.                  EDIT.COM Multiple Utility Program
  2.                  ---------------------------------
  3.  
  4. Version 1.1
  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. EDIT is unique in that all of these functions are within a single 
  23. program only 2K in length. Operation is fast and easy with single 
  24. letter commands for editing,  and prompting where required.  EDIT 
  25. will replace PIP, STAT, XDIR, and ED for most users needs.
  26.  
  27. One  of  the reasons for EDIT's small size and fast operation  is 
  28. its method of handling files. The entire file is read into memory 
  29. at  one time,  and re-written only after the desired changes  are 
  30. made.  For  safety EDIT never changes the original  file,  always 
  31. writing a new modified copy.  However,  the tradeoff is that  the 
  32. entire file must fit in the 'TPA' of your computer.  For most 64K 
  33. machines,  this  means that you can use EDIT on files up to about 
  34. 50K in size,  which is more than adequate for most  applications. 
  35. EDIT  won't  damage a file too large - it simply won't work  with 
  36. it.
  37.  
  38. System Requirements
  39.  
  40. EDIT will work with any CP/M 2.2 or 3.0 computer.  If the machine 
  41. is  a CP/M Plus system with bank switching,  the amount  of  disk 
  42. free  space reported will be incorrect,  but all other  functions 
  43. work normally. A specific amount of RAM is not required.
  44.  
  45.  
  46. Installation
  47.  
  48. EDIT  is  easily  installed using only EDIT  itself.  Follow  the 
  49. following steps.
  50.  
  51. 1.  Copy EDIT onto a disk with CP/M on it,  using whatever method 
  52. your computer outlines for copying files.  Put the original  EDIT 
  53. disk away with your backup disks.
  54.  
  55. 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 
  56. manual,  ask your dealers technician. Be sure it is in 'hex'. For 
  57. example, an Osborne's code is '1A hex'. A Z-19 terminal would use 
  58. '1B hex, 45 hex', two codes.
  59.  
  60. 3.  With  your  EDIT disk in the computer type   EDIT EDIT.COM  C 
  61. <Return>.   EDIT  will  respond  with  the  question     ADDRESS?      
  62. which  you  answer    855 <Return>   .  EDIT  will  respond  with  
  63. BYTE=00h  CHANGE TO:    . Enter your first hex code. (For Osborne 
  64. this would be 1A.)
  65.  
  66. 4.  If you have more than one hex code to enter (each one is  two 
  67. digits)  repeat the above process for addresses 856,  and 857  if 
  68. needed. Then when you are done and EDIT is still asking ADDRESS?, 
  69. just hit <Return> and EDIT will rewrite the changed file, in this 
  70. case itself. 
  71.  
  72. Now  look  at the disk.  You should have EDIT.COM  and  EDIT.BAK. 
  73. EDIT.BAK  is the original file and EDIT.COM is your newly instal-
  74. led version.
  75.  
  76.  
  77.  
  78. Instruction
  79.  
  80. To get used to EDIT,  we suggest making a special disk for  prac-
  81. tice.  Prepare  yourself a work disk with CP/M on it (check  your 
  82. computer  manual if you don't know how to do this.) Then put your 
  83. empty work disk in drive A:  and a disk with EDIT on it in  drive 
  84. B:. 
  85.  
  86. 1. Copying files
  87.  
  88. First  we  will  learn how to copy files  using  EDIT.  Type   B: 
  89. <Return> so that we are on the B:  drive (where EDIT is now).  To 
  90. copy EDIT onto our work disk type   EDIT EDIT.COM A: <Return>   . 
  91. EDIT  will copy itself to drive A:.  Then we can type  A:<Return> 
  92. to go back to the A: drive. Type  DIR<Return> to see that EDIT is 
  93. there. Here is what we did:
  94.  
  95. EDIT             EDIT.COM              A:             <Return>
  96.  
  97. (starts EDIT) (tells EDIT what) (tells EDIT what) (tells EDIT to)
  98.               (  file to copy ) (drive to put it) (  get going! )
  99.                                 (       on      )
  100.  
  101. 2. Make a test file
  102.  
  103. Now we are going to make a test file for us to practice on.  Type 
  104. EDIT  TEST.TXT <Return>   .  EDIT will inform you that this is  a 
  105. new file and ask for a command.  We want to insert text, so press 
  106. I  for Insert.  (You don't have to hit Return!) Your screen  will 
  107. clear (if you installed EDIT properly).
  108.  
  109. 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 
  110. once.  When you are ready to stop inserting, type  /  <Return> at 
  111. the  beginning  of a new line.  When we do this character at  the 
  112. beginning  of a line EDIT knows that we want to  stop  inserting. 
  113. EDIT will now ask for another command.
  114.  
  115. We're  done for now so type  Q   for Quit.  (Again,  no  Return.) 
  116. EDIT  will save the file we made onto the disk.  When CP/M  gives 
  117. you  the  A> prompt,  type   TYPE TEST.TXT<Return>    ,  and  you 
  118. should see the words we just entered. Try copying TEST.TXT to the 
  119. B: drive (the command is  EDIT TEST.TXT B: <Return>    ).
  120.  
  121.  
  122. 3. File size and Free Space
  123.  
  124. Now try typing     EDIT <Return>   .  We should get a list of all 
  125. files (in this case just EDIT.COM and TEST.TXT) with their sizes, 
  126. and  a report on how much room is left on the disk.  Keep  trying 
  127. this  as  we create more files,  and see how useful  it  is.  Try 
  128. typing     EDIT B:  <Return> and you will get a list of files  on 
  129. the B: drive.
  130.  
  131.  
  132.  
  133. 4. Hex Dump
  134.  
  135. Many users won't have much need for this function, but it is fun. 
  136. A  'hex dump' is a display of the digital codes that are inside a 
  137. file.  Type   EDIT TEST.TXT D <Return>   . You should see on your 
  138. screen a complete list of all the digital codes inside  TEST.TXT. 
  139. Over  on  the right is a list of the letter that goes  with  that 
  140. code,  if  any.  (If no letter goes with that code we just put  a 
  141. period there.) It is easy to stop the display from scrolling when 
  142. you  want to examine something - just type a Control-S to  freeze 
  143. the  display.  Then when you are done,  type any key to start  it 
  144. again.  (A  CP/M  Plus computer needs Control-Q to start  again.) 
  145. While  this  function is mostly useful  to  programmers,  it  can 
  146. sometimes help to locate a bad byte in a 'broken' file. Try doing 
  147. a hex dump of other files and see whats inside them.
  148.  
  149. 5. Printing
  150.  
  151. EDIT  can  send files to the printer for you.  Get  your  printer 
  152. ready to go,  and type   EDIT TEST.TXT P <Return>  . The text you 
  153. entered earlier is now sent to the printer.  When the printing is 
  154. done  and you are back at the A> prompt,  type EDIT - <Return)  . 
  155. This will make you printer formfeed to the next page stop. (Some-
  156. times this can be easier than reaching your printer!)
  157.  
  158.  
  159. 6. Text editing
  160.  
  161. To edit our test file,  type  EDIT TEST.TXT <Return>  . EDIT will 
  162. load  TEST.TXT into memory and display the first 22 lines on  the 
  163. screen.è
  164. First  we will try the commands for moving around.  All of  these 
  165. commands are just one letter - no Return needed.
  166.  
  167. 'U' and 'D' are the commands for moving the text on the screen up 
  168. or  down  one line.  'H' is a  special kind of up that hops  five 
  169. lines.  'P' and 'N' will jump the screen to the previous or  next 
  170. whole screen.  Finally, 'B' or 'E' will move you to the beginning 
  171. or the end of the file. Try each one of these commands until they 
  172. are understood fully.
  173.  
  174. Now  we  will insert some text.  Push 'B' (to the beginning)  'H' 
  175. (hop  up five lines) and 'I' (insert).  Your screen  will  blank. 
  176. Type  some recognizable line such as 'This is the inserted text.' 
  177. and hit return.  Now type   / <Return>  to stop the insert  mode. 
  178. You  should  see the line you inserted at the top of the  screen. 
  179. Hit  'B'  (go to beginning) and you will see your  inserted  line 
  180. five lines down.
  181.  
  182. The  important thing to note here is that the text  was  inserted 
  183. before the line that was at the top of the screen when you pushed 
  184. 'I'  (insert).  The line at the top of the screen is the  'active 
  185. line', i.e., most things will happen at that place in the file.
  186.  
  187. Now  use  'U'  to move the line you inserted to the  top  of  the 
  188. screen.  Hit  'K' for kill.  This command deletes the line at the 
  189. top of the screen.  Hit 'B' (beginning) and you will see that the 
  190. inserted  line is now gone.  If you ever want to kill  an  entire 
  191. screen  of text,  use the 'Z' (zap) command.   Because deleting a 
  192. whole screen is pretty drastic, Zap will first ask you to confirm 
  193. your choice with a 'Y' or 'N'.
  194.  
  195. EDIT is what is called a 'line editor'; this means that you  must
  196. insert or delete an entire line when you  make  changes.  This is
  197. part of the reason why EDIT is so small.
  198.  
  199. One last word on inserting: If you ever have an entirely seperate 
  200. text  file  that  you would like to include in the  one  you  are 
  201. working on you can use the 'R' (read file) command. This will ask 
  202. you for a filename,  go get the file,  and insert the whole thing 
  203. at the top of the screen.
  204.  
  205. There  are two commands for you to use when you are done editing. 
  206. One  is 'Q' for quit.  This saves your edited file,  and  renames 
  207. your original file to filename.BAK, for backup. The other command 
  208. is for when you have decided not to save your work,  and want the 
  209. files  on the disk to remain just as they originally  were.  This 
  210. command is 'J', for 'junk changes'. Just as with the Zap command, 
  211. abandoning  a  file  can lose important work,  so  before  we  go 
  212. through  with a Junk you are asked to confirm the choice  with  a 
  213. 'Y' or a 'N'.
  214.  
  215. The last command to learn is the 'F' (find) command. This works a 
  216. little  differently  than  most other editors,  and  is  intended 
  217. primarily for programmers.è
  218. Look  ahead in your test file for a word which is the first  word 
  219. on a line.  Then use 'B' to move away from it.  Hit 'F' and  EDIT 
  220. will  ask you what label to find.  Give it the word you saw and a 
  221. <Return>. EDIT will search the file for a line starting with that 
  222. word and position that line at the top of the screen.  If no word 
  223. is found, EDIT positions the file at the beginning.
  224.  
  225. Caution: the word must match the case of the original - if one is 
  226. upper case and one is lower case, the word will not be found.
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.               Quick Reference - EDIT.COM  Version 1.1
  244.               ---------------------------------------
  245.  
  246. Function commands (entered at the A> and followed by Return)
  247. All commands can be upper or lower case
  248.  
  249. EDIT            - gives XDIR report for current disk
  250. EDIT B:            - gives XDIR report for specified disk
  251.  
  252. EDIT filename.typ       - Edits file, creates file if new
  253. EDIT B:filename.typ    - Edits file on specific drive, creates
  254.                           file if new
  255.  
  256. EDIT filename.typ C    - allows changing a byte in any file
  257.  
  258. EDIT filename.typ D    - dumps file to screen
  259.  
  260. EDIT filename.typ P     - Sends file to the printer
  261.                         - expands tabs and provides page breaks
  262.  
  263. EDIT -            - Sends formfeed to printer
  264.  
  265. EDIT filename.typ B:    - Copies file from current disk to B:
  266. EDIT A:filename.typ B:    - Copies file from A: to B:
  267. EDIT B:filename.typ A:    - Copies file from B: to A:
  268.  
  269.  
  270. Text editing commands (not followed by pressing Return)
  271. è    U - moves text UP a line
  272.     H - HOPs text up 5 lines
  273.     D - moves text DOWN a line
  274.     P - moves to the PREVIOUS screen
  275.     N - moves to the NEXT screen
  276.     B - moves to the BEGINNING of the file
  277.     E - moves to the END of the file
  278.  
  279.     I - INSERT text mode
  280.     / - / <CR> at start of new line to stop inserting
  281.     R - READ in file and block insert into current file
  282.     K - KILL line at top of screen
  283.         T - TRUNCATE file from top of screen
  284.     Z - ZAP entire page
  285.     F - FIND line (asks for label to search for)
  286.     J - JUNK changes, leave disk file as it was
  287.     Q - QUIT and save file. original is named .BAK
  288.  
  289.  
  290. Install on specific machine by patching in clear screen codes in
  291. bytes 0855h - 0857h. Set unused bytes to 0.
  292.