TL02.TXT 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. TURBO-LESSONS - A Pascal Tutorial Version 1.01 Page 10
  2. TURBO-LESSON 2: EDITING PROGRAMS
  3. OBJECTIVES - In lesson 2 you will learn about:
  4. 1. Starting an edit session
  5. 2. Ending an edit session
  6. 3. Moving the cursor to desired location
  7. 4. Inserting/replacing text
  8. 5. Deleting text
  9. 6. Auto-tabbing for readable programs
  10. TURBO-LESSON 2 uses a slightly different approach than most of
  11. the other TURBO-LESSONs. Much of the tutorial material of this
  12. lesson is in PROG2. PROG2 is not really a program, but a
  13. tutorial itself. After starting the editor with PROG2, you will
  14. learn to edit by editing PROG2 in ways suggested within the
  15. "program".
  16. ******* NOTE: BE SURE YOU HAVE A BACK-UP COPY OF THE TURBO-
  17. LESSONS AND SAMPLE PROGRAMS. MANY OF THE LESSONS WILL DIRECT YOU
  18. TO MAKE CHANGES IN THE PROGRAMS. A BACK-UP COPY WILL PROVIDE A
  19. NEW COPY OF THE ORIGINAL PROGRAMS WHENEVER THEY ARE NEEDED.
  20. 1. Starting an edit session.
  21. There are two ways to start an edit session. One way is to
  22. invoke the editor yourself when you wish to write a new program
  23. or modify an old one. The other way is automatic. When TURBO
  24. compiles your program and finds an error, it switches to the edit
  25. mode by itself and highlights the probable error. More about
  26. that later. This lesson covers only the first method. You start
  27. an edit session by typing E at the main menu.
  28. ##### DO:
  29. Type E.
  30. Computer responds: "Work file name:".
  31. Type PROG2.
  32. PROG2 will appear on the screen with the Editor "status line" at
  33. the top of the screen.
  34. Œ
  35. TURBO-LESSONS - A Pascal Tutorial Version 1.01 Page 11
  36. 2. Ending an edit session.
  37. One of the first things you learn when learning to drive a car is
  38. how to stop. When editing a program, you need to know how to
  39. get out of the editor and back to the main menu. To exit the
  40. editor and save the edited file, type ctrl-k followed by either d
  41. or ctrl-d. (Ctrl-k means: hold down the control key while
  42. depressing k). Note that the editor has no provision for
  43. abandoning an edited file - if you need to abandon a file, exit
  44. the editor and reload the work file from disk without first
  45. saving the edited version.
  46. ##### DO:
  47. Type ctrl-k, d.
  48. Computer responds: Main menu.
  49. 3. - 6. Objectives 3 to 6 are covered in PROG2. To begin,
  50. ##### DO:
  51. Type E.
  52. Computer responds: Edit session is started with PROG2.
  53. After working through the tutorial contained in PROG2, you may
  54. want to load and run PROG2A. PROG2A prints the cursor movement
  55. reference table referred to in the tutorial. To run PROG2A:
  56. ##### DO:
  57. Type W.
  58. Computer responds: "Work file name".
  59. Type PROG2A.
  60. Type R.
  61. PROG2A executes, printing a short summary of the cursor movement
  62. keys used by the TURBO editor.
  63. Œ