home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / dosutils / xdosman.arj / CHAPT9.DOC < prev    next >
Encoding:
Text File  |  1991-11-28  |  23.5 KB  |  611 lines

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