home *** CD-ROM | disk | FTP | other *** search
/ Lion Share / lionsharecd.iso / utils_mz / xdosman.zip / CHAPT9.DOC < prev    next >
Text File  |  1991-11-28  |  24KB  |  611 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                    Chapter 9.
  9.  
  10.                           The X-DOS Full Screen Editor
  11.  
  12.  
  13.           Included with X-DOS is ED, a full screen text editor. This is
  14.           ideal for creating and editing AUTOEXEC.BAT and CONFIG.SYS files
  15.           and other batch files used by X-DOS. Because of its advanced
  16.           features, however, it can be used for much more complicated tasks
  17.           usually requiring the use of a separate word processor. With
  18.           features such as automatic line wrap, the ability to set left and
  19.           write margins, justification of text and manipulation of blocks
  20.           of text, ED is perfect for writing and editing all kinds of text
  21.           files. Also, because it creates pure ASCII files, files created
  22.           in Ed can easily be downloaded into any other word processor or
  23.           text editor.
  24.  
  25.           ED was briefly introduced in Chapter 6., The X-DOS Command
  26.           Reference, and in this chapter we explain all the features of ED
  27.           in more detail.
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                       9-1
  63.  
  64.  
  65.  
  66.  
  67.      RUNNING ED
  68.  
  69.           To start ED, simply type ED at the DOS prompt. The full syntax of
  70.           the ED command is:
  71.  
  72.                           ED [d:][path][filename] [/W]
  73.  
  74.           Where:      d:path is the drive and path to a file you want to
  75.                       load into ED.
  76.  
  77.                       filename is the name of a file to load into ED.
  78.                       /W enables ED to edit files in ⌐Wordstar format¬.
  79.  
  80.      The Structure of ED
  81.  
  82.           ED is based on a menu interface which makes it very easy to use.
  83.           ED is a full-screen editor that always displays a large amount of
  84.           text on the screen and has the ability to manipulate this text in
  85.           blocks.  These are strong features that will save time and make
  86.           it much less demanding to use than a line editor.
  87.  
  88.           When running ED, you are placed in the editing-mode where text is
  89.           entered or altered by input from the keyboard.  The combination
  90.           of the menu interface and the hot keys add powerful editing
  91.           facilities.  If you are a first-time user the menu interface can
  92.           be utilized right away.  When you have acquired a better
  93.           understanding of the features in ED, all the menu commands can be
  94.           accessed faster by using hot keys.  In addition to saving time,
  95.           the hot keys also incorporate block editing facilities and other
  96.           powerful features, not accessible from the menu interface.
  97.  
  98.      Options for Starting ED
  99.  
  100.           There are several commands available to ED from the DOS prompt.
  101.           By invoking ED with the optional /W switch, files in Wordstar
  102.           format can be edited in ED.  This is done by stripping all
  103.           control characters from the file before it is displayed on the
  104.           screen. If you have a Wordstar format file called TEXT.WS which
  105.           you want to edit in ED, you should type the following command at
  106.           the DOS command line:
  107.  
  108.                                  ED TEXT.WS /W
  109.  
  110.           The SET ED= command gives you a range of possibilities to
  111.           customize ED for your particular needs.  ED recognizes five
  112.           switches with the SET ED= command.  These are W (Wordwrap), T
  113.           (Tab), I (Indent), L (Left Margin), and R (Right Margin).
  114.           The SET command could look something like this:
  115.  
  116.                              SET ED=W,T5,I5,L5,R75
  117.  
  118.           This SET command would put ED into wordwrap mode, set the space
  119.  
  120.  
  121.  
  122.  
  123.                                       9-2
  124.  
  125.  
  126.  
  127.  
  128.           between the tabs to 5, indent every paragraph 5 spaces, set the
  129.           left margin to 5, and set the right margin to 75.  Normally you
  130.           will have a preferred setting for ED.  If you use the SET ED=
  131.           command in your AUTOEXEC.BAT file, your settings will always be
  132.           selected when booting your computer.  It is not necessary to use
  133.           all the switches in the SET command.  Do not use spaces between
  134.           any of the parameters with the SET ED= command.  You can also use
  135.           the X-DOS installation program to install these settings in your
  136.           AUTOEXEC.BAT file.
  137.  
  138.      The Status Line
  139.  
  140.           The bottom line on the screen always functions as a status line.
  141.           The status line displays basic information that is very useful
  142.           when editing text; especially larger text files.
  143.           The name of the file currently being edited or created, is
  144.           displayed with the complete path.  If a name is not specified at
  145.           startup, ED will display ⌐new file¬ until the file is saved under
  146.           another name.
  147.  
  148.           [I/C/N/W]
  149.           This set of square brackets contains important information on the
  150.           current status of the keyboard.  The following information is
  151.           displayed:
  152.  
  153.                I    Insert mode is active
  154.                C    CapsLock is active
  155.                N    NumLock is active
  156.                W    Wordwrap at the end of the line
  157.  
  158.           [I/ / / ]
  159.           When the I switch is ON, the Insert mode is in effect. In Insert
  160.           mode, all text after the cursor is pushed to the right when new
  161.           text is entered. If the I switch is OFF, ED is in Overwrite mode
  162.           and overwrites text to the right of the cursor.  To toggle this
  163.           switch ON or OFF, press the <> key on your keyboard.
  164.  
  165.           [ /C/ / ]
  166.           When the C switch is ON, the <> key is in effect.  Thus, all
  167.           letters will be entered in upper-case, unless the <> key is
  168.           pressed, in which case they will be in lower-case.
  169.  
  170.           [ / /N/ ]
  171.           When the N switch is ON, the <> key is in effect, which means
  172.           that the keypad can be used to enter digits.
  173.  
  174.           [ / / /W]
  175.           When the W switch is ON, ED is in wordwrap mode.  When the cursor
  176.           reaches the right margin (default right margin is column 78), ED
  177.           automatically wraps the text to the next line.  Toggle the
  178.           wordwrap mode ON or OFF with the W hot key.
  179.  
  180.  
  181.  
  182.  
  183.  
  184.                                       9-3
  185.  
  186.  
  187.  
  188.  
  189.           F10=Menu
  190.           A reminder that the main menu is activated by pressing the <>
  191.           function key.
  192.  
  193.           Line: n
  194.           Shows the line number where the cursor is at, counting from the
  195.           start of the file.
  196.  
  197.           Col.: m
  198.           Shows the number of the column where the cursor is at.
  199.  
  200.      The Menu Interface
  201.  
  202.           To ease the use of ED, the command has a menu interface.  Most
  203.           items in the menu are used for manipulation of text files.  To
  204.           access the main menu from the editing screen press the <>
  205.           function key.
  206.  
  207.           Use the <> and <> arrow keys to move between the different menu
  208.           items or a mouse if you have one installed.  To select an item,
  209.           highlight your choice and press <>.  You can also use the
  210.           highlighted quick keys to select a menu item.  Most of the main
  211.           menu items prompts you with a sub-menu so you to define the
  212.           action to take place.  If, for instance, you choose the Load File
  213.           menu, you will be prompted with a sub-menu, asking you to enter
  214.           the name of the file.  To leave the main menu without choosing
  215.           any options, press the <> key.  Everywhere in the menu system,
  216.           choices are made by pressing the <> key.  The <> key always
  217.           brings you one level back in the menus. Following is a
  218.           description on each of the main menu options.  You can get help
  219.           on any of the main menu items by pressing the <> function key
  220.           when a menu item is highlighted.
  221.  
  222.           Load File
  223.           If you choose Load File from the main menu (see below), you are
  224.           prompted for the name of the file to load into ED.
  225.           Type the name of an already existing file to edit this file or
  226.           write the name of a non-existing file to create a new file with
  227.           that particular name.  If you want to edit a file that does not
  228.           reside in the default directory, you have to specify the complete
  229.           path for that file, like this:
  230.  
  231.                              C:\DIFFDIR\MYTEXT.DOC
  232.  
  233.           If you try to load a file that does not reside in the default
  234.           directory without specifying a pathname, ED assumes that you want
  235.           to create a new file with the specified name.  If you are not
  236.           sure that the file you want to edit is in the default directory,
  237.           you can use the Directory menu item from the main menu to find
  238.           the file.
  239.  
  240.           Write File
  241.  
  242.  
  243.  
  244.  
  245.                                       9-4
  246.  
  247.  
  248.  
  249.  
  250.           The function of this menu is to save your text file onto a
  251.           diskette or hard disk. It is always recommended that you save
  252.           your file often during text editing to prevent loss of data due
  253.           to system crash or power failure.  If you are editing a file that
  254.           you previously loaded into ED with the Load File item or from the
  255.           command line, ED will display the name of the file and you only
  256.           need to press <> to save it to the disk(ette).  If you are
  257.           creating a new file, ED prompts you for a filename like this:
  258.  
  259.           New File
  260.           By choosing this menu item from the main menu, you clear all text
  261.           currently residing in ED.  Use this command very carefully, since
  262.           it will erase any data you already have in ED.  ED has a built-in
  263.           safe guard which will prompt you to save any unsaved data when
  264.           you choose this menu item.  If you have not saved the text in ED
  265.           before issuing this command, you must acknowledge that you want
  266.           to start a new text file, without first saving the old file.
  267.  
  268.           Search Pattern
  269.           In larger text files it is quite easy to forget where a
  270.           particular part of text is located.  The Search Pattern menu item
  271.           prompts you with an entry box in which you can specify a string
  272.           of text up to 20 characters long as a search pattern.  You must
  273.           enter a word or part of a word which you know is included in the
  274.           text you are looking for.
  275.  
  276.           The search pattern you specify can be any part of a word but it
  277.           cannot include any spaces.  Therefore, it is not possible to
  278.           specify a search pattern consisting of more than one word.
  279.           The search pattern is case-sensitive so you will have to enter
  280.           the search pattern exactly as it appears in the text.  You also
  281.           have to tell ED which way to search.  This is done in the second
  282.           entry of the Search Pattern entry box.  Type 'D' to search down
  283.           (read forward) in the text file from your current cursor position
  284.           or type 'U' to search up (read backwards).  You can tell ED
  285.           exactly how may occurrences of the specified search pattern to
  286.           skip before stopping on a matching text pattern.  This is done in
  287.           the Occurrence entry of the Search Pattern entry box.  You can
  288.           use the S hot key to continue the search each time ED has found a
  289.           matching string.
  290.  
  291.           Change Pattern
  292.           The function of this menu item is quite similar to that of the
  293.           Search Pattern menu item.  In addition to finding a particular
  294.           string, the Change Pattern menu item also lets you specify a
  295.           replacement string.  This enables you to change a word all the
  296.           way through a text file without missing any occurrences if you
  297.           specify a `*' in the How many (*) entry.  The search is case-
  298.           sensitive.
  299.  
  300.           Go to Line
  301.           This menu item lets you specify a line number where you want to
  302.  
  303.  
  304.  
  305.  
  306.                                       9-5
  307.  
  308.  
  309.  
  310.  
  311.           position the cursor.  This is a fast and efficient way to get
  312.           around in large text files.
  313.           If you specify a line number larger than the existing number of
  314.           lines, ED gives the error message ⌐Wrong line number¬ and lets
  315.           you specify a new line number.
  316.  
  317.           Insert File
  318.           This menu item lets you combine multiple text files into one
  319.           file.  You will be prompted to type the name of the file you want
  320.           to insert.  ED places the inserted file at the current cursor
  321.           position, automatically moving all text after the current cursor
  322.           position to the end of the inserted file.  This allows you to
  323.           insert other text files anywhere in your text file just by moving
  324.           the cursor to the position where you want the new text to be
  325.           inserted and select the Insert File menu item.
  326.  
  327.           Directory
  328.           If you choose this menu item from the main menu, ED will display
  329.           a list of all the files in the default directory.  If the default
  330.           directory holds more files than is displayed in the directory
  331.           list, you can use the arrow keys and the <> and <> keys to scroll
  332.           back and forth in the list.
  333.  
  334.           Print
  335.           This command lets you print all or part of the text file you are
  336.           currently editing.  When you select the Print menu item you are
  337.           prompted with an entry box.
  338.  
  339.           By default ED assumes that you want to print the entire document
  340.           and has therefore already filled out the first two entries of the
  341.           Print File entry box with the first and the last line of your
  342.           document.  By specifying different values in the From line and To
  343.           line entries, you can make ED print only part of a text file.
  344.           The entry Page Break (Y/N) breaks the text file into pages of 60
  345.           lines if you input a 'Y' here.  The last entry, With header
  346.           (Y/N), gives you the option to have a header printed on the top
  347.           of each printed page of your text file (the default is without a
  348.           header).  The header looks similar to the following:
  349.           FILENAME : myfile.doc DATE : 02/23/90  TIME : 17:01:11  PAGE:1
  350.  
  351.           Exit
  352.           This is the option to choose if you want to leave ED.  If unsaved
  353.           text still resides in ED, you will be prompted with a menu from
  354.           which you can choose to go back to ED, exit without saving, or
  355.           write the file (save it) before exiting ED.
  356.  
  357.           Gateway to DOS
  358.           This menu item lets you leave ED temporarily to run a X-DOS
  359.           command or to run another program while still keeping ED in
  360.           memory.  Whatever text you had in ED before using the Gateway to
  361.           DOS menu item will still be there when you return to ED.  You can
  362.           return to ED by typing 'EXIT' at the command line followed by
  363.  
  364.  
  365.  
  366.  
  367.                                       9-6
  368.  
  369.  
  370.  
  371.  
  372.           pressing the <> key.
  373.  
  374.           Help on Editor
  375.           This menu item displays all of the editing facilities available
  376.           in ED together with the associated hot keys.  The windows of
  377.           commands can be paged through one by one using the <> and <> keys
  378.           on your keyboard.
  379.  
  380.      Block Commands
  381.  
  382.           ED has five commands for manipulating blocks of text.  These
  383.           commands are invoked by the use of hot keys.
  384.  
  385.           Mark Block
  386.           Place the cursor at the beginning or at the end of the block of
  387.           text that you want to mark and press <>M to define the beginning
  388.           of the marked text.  Use the <> and <> arrow keys and the <> and
  389.           <> keys to expand the block of marked text.  The marked text will
  390.           become highlighted.  Once you have highlighted the text you want
  391.           to manipulate, use one of the three block commands <>B, <>Q, <>R
  392.           or <>J.  If you decide not to perform any actions on the block of
  393.           text you have marked, press the <>M hot key again to unmark the
  394.           text.
  395.  
  396.           Copy Block to Paste Board (<>B)
  397.           This command copies the marked block of text and stores it in an
  398.           area of memory called the Paste Board.  This command is ideal for
  399.           making copies of the same text for use in different places of
  400.           your document.
  401.  
  402.           Delete Block to Paste Board )<>Q)
  403.           This command deletes the marked block of text and stores it in
  404.           the paste board.  This command is an easy way to move text around
  405.           in a text file.
  406.  
  407.           Insert Paste Board Contents (<>R
  408.           This command places the contents of the paste board at the
  409.           current cursor position in your text file.  You can perform this
  410.           operation as many times as you want.  It is important to note
  411.           that only one block of text is kept in the paste board at any
  412.           time.
  413.  
  414.           Justify Block (<>J)
  415.           This command right-justifies a paragraph of marked text by
  416.           inserting spaces between words in each line.  This gives your
  417.           text a nice, even look.  It is suggested that you justify only
  418.           one paragraph at a time, to avoid unintentional justification.
  419.  
  420.      Margins and Wordwrap
  421.  
  422.           Besides right justification, ED also gives you the capability to
  423.           set the right and left margins from within the text file.  The
  424.  
  425.  
  426.  
  427.  
  428.                                       9-7
  429.  
  430.  
  431.  
  432.  
  433.           default margin settings are displayed by two triangle marks at
  434.           the bottom of the screen, pointing up just above the status line.
  435.           These margins can be set with the SET ED= command at the command
  436.           line.  If you type in text without changing the default margin or
  437.           wordwrap settings, the text will start in column 0 and will
  438.           continue across the page until you press <>.  To make the text
  439.           wrap around to the next line, you must enable the wordwrap
  440.           function.  To do this from within ED, press the W hot key.
  441.  
  442.           The default right margin for the wordwrap function is column 78
  443.           if no margin settings are defined. You can set the margins with
  444.           the SET command or from within ED by using the L hot key to set
  445.           the left margin and the R hot key to set the right margin.  To
  446.           set the margins from within ED, place the cursor in the column
  447.           you want to set as the left margin and press L and then place the
  448.           cursor in the column you want to set as the right margin and
  449.           press R.
  450.  
  451.           The <>J command (Justify Block) will right justify a marked
  452.           paragraph of text within the specified margins.
  453.  
  454.      Delete/Undelete Functions
  455.  
  456.           Delete until End of Line (<>E)
  457.           By issuing this command you delete all text from the current
  458.           cursor position until the end of the line.
  459.  
  460.           Delete Current Line  (<>D)
  461.           This command deletes the entire line in which the cursor is
  462.           located.
  463.  
  464.           Undelete Line  (<>U)
  465.           If you accidentally delete a line with the Delete Current Line
  466.           (<>D) command, you can use Undelete Line command to undo the
  467.           deletion.  ED remembers the most recent deleted line.  This
  468.           command, together with the Delete Current Line command, can be
  469.           used to move lines in your text file.
  470.  
  471.      Quick Command Reference
  472.  
  473.           All editing commands can be accessed directly by a single
  474.           keystroke or by the use of the <> or  key in combination with
  475.           another key.  To use the <>/ key commands, the <> or  key must be
  476.           held down while the other key is pressed.  See the table below
  477.           for a list of all the hot key combinations.
  478.                <Home>         Places the cursor at the beginning of the
  479.                               line.
  480.  
  481.                <End>          Places the cursor at the end of the line.
  482.  
  483.                <Ctrl><Home>   Places the cursor at the beginning of the
  484.                               text file.
  485.  
  486.  
  487.  
  488.  
  489.                                       9-8
  490.  
  491.  
  492.  
  493.  
  494.  
  495.                <Ctrl><End>    Places the cursor at the end of the text
  496.                               file.
  497.  
  498.                <Ins>          Switches between Insert and Overwrite modes.
  499.  
  500.                <Del>          Deletes the character at the current cursor
  501.                               position.
  502.  
  503.                <PgDn>         Shows the next screen of text.
  504.  
  505.                <PgUp>         Shows the previous screen of text.
  506.  
  507.                <Down>Arrow    Moves  the cursor down one line.
  508.  
  509.                <Up>Arrow      Moves the cursor up one line.
  510.  
  511.                <Left>Arrow    Moves the cursor one character left.
  512.  
  513.                <Right>Arrow   Moves the cursor one character right.
  514.  
  515.                <Backspace>    Deletes the character to the left of the
  516.                               cursor.
  517.  
  518.                <Enter>        Adds a new line after the current line.
  519.  
  520.                <Alt>B         Copies a marked block of text to the paste
  521.                               board.
  522.  
  523.                <Alt>C         Changes a string of text with another string
  524.                               of text.
  525.  
  526.                <Alt>D         Deletes current line.
  527.  
  528.                <Alt>E         Deletes characters from current position to
  529.                               end of the line.
  530.  
  531.                <Alt>G         Gateway to X-DOS.  Exits you to the command
  532.                               line
  533.  
  534.                <Alt>H         Help on ED.  Displays summary of available
  535.                               hot keys.
  536.  
  537.                <Alt>I         Inserts another text file at the current
  538.                               cursor position.
  539.  
  540.                <Alt>J         Right justifies a marked block of text.
  541.  
  542.                <Alt>L         Loads a new file into ED.
  543.  
  544.                <Ctrl>L        Sets the left margin at the current cursor
  545.                               position.
  546.  
  547.  
  548.  
  549.  
  550.                                       9-9
  551.  
  552.  
  553.  
  554.  
  555.  
  556.                <Alt>M         Marks a block of text.  Use cursor keys
  557.  
  558.                <Alt>N         Starts new file. Will prompt if current file
  559.                               not saved.
  560.  
  561.                <Alt>O         Places the cursor at a specified line number.
  562.  
  563.                <Alt>Q         Deletes a marked block of text to the paste
  564.                               board.
  565.  
  566.                <Alt>R         Inserts text in paste board at the current
  567.                               cursor position.
  568.  
  569.                <Ctrl>R        Sets the right margin at the current cursor
  570.                               position.
  571.  
  572.                <Alt>S         Searches the text file for a specified string
  573.                               of text.
  574.  
  575.                <Ctrl>S        Searches for the next occurrence of a text
  576.                               string.
  577.  
  578.                <Alt>U         Undeletes text deleted with the <Alt>D hot
  579.                               key.
  580.  
  581.                <Alt>V         Displays the contents of the default
  582.                               directory.
  583.                               You can select a file to load or insert into
  584.                               an existing text file by pressing <Alt> on
  585.                               any one of the displayed files and then press
  586.                               <Alt>L or <Alt>I.
  587.  
  588.                <Alt>W         Writes the current text file to the disk.
  589.  
  590.                <Ctrl>W        Toggles wordwrap mode ON or OFF.
  591.  
  592.                <Alt>X         Exits ED.
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.                                       9-10