home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
- Chapter 9.
-
- The X-DOS Full Screen Editor
-
-
- Included with X-DOS is ED, a full screen text editor. This is
- ideal for creating and editing AUTOEXEC.BAT and CONFIG.SYS files
- and other batch files used by X-DOS. Because of its advanced
- features, however, it can be used for much more complicated tasks
- usually requiring the use of a separate word processor. With
- features such as automatic line wrap, the ability to set left and
- write margins, justification of text and manipulation of blocks
- of text, ED is perfect for writing and editing all kinds of text
- files. Also, because it creates pure ASCII files, files created
- in Ed can easily be downloaded into any other word processor or
- text editor.
-
- ED was briefly introduced in Chapter 6., The X-DOS Command
- Reference, and in this chapter we explain all the features of ED
- in more detail.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 9-1
-
-
-
-
- RUNNING ED
-
- To start ED, simply type ED at the DOS prompt. The full syntax of
- the ED command is:
-
- ED [d:][path][filename] [/W]
-
- Where: d:path is the drive and path to a file you want to
- load into ED.
-
- filename is the name of a file to load into ED.
- /W enables ED to edit files in ⌐Wordstar format¬.
-
- The Structure of ED
-
- ED is based on a menu interface which makes it very easy to use.
- ED is a full-screen editor that always displays a large amount of
- text on the screen and has the ability to manipulate this text in
- blocks. These are strong features that will save time and make
- it much less demanding to use than a line editor.
-
- When running ED, you are placed in the editing-mode where text is
- entered or altered by input from the keyboard. The combination
- of the menu interface and the hot keys add powerful editing
- facilities. If you are a first-time user the menu interface can
- be utilized right away. When you have acquired a better
- understanding of the features in ED, all the menu commands can be
- accessed faster by using hot keys. In addition to saving time,
- the hot keys also incorporate block editing facilities and other
- powerful features, not accessible from the menu interface.
-
- Options for Starting ED
-
- There are several commands available to ED from the DOS prompt.
- By invoking ED with the optional /W switch, files in Wordstar
- format can be edited in ED. This is done by stripping all
- control characters from the file before it is displayed on the
- screen. If you have a Wordstar format file called TEXT.WS which
- you want to edit in ED, you should type the following command at
- the DOS command line:
-
- ED TEXT.WS /W
-
- The SET ED= command gives you a range of possibilities to
- customize ED for your particular needs. ED recognizes five
- switches with the SET ED= command. These are W (Wordwrap), T
- (Tab), I (Indent), L (Left Margin), and R (Right Margin).
- The SET command could look something like this:
-
- SET ED=W,T5,I5,L5,R75
-
- This SET command would put ED into wordwrap mode, set the space
-
-
-
-
- 9-2
-
-
-
-
- between the tabs to 5, indent every paragraph 5 spaces, set the
- left margin to 5, and set the right margin to 75. Normally you
- will have a preferred setting for ED. If you use the SET ED=
- command in your AUTOEXEC.BAT file, your settings will always be
- selected when booting your computer. It is not necessary to use
- all the switches in the SET command. Do not use spaces between
- any of the parameters with the SET ED= command. You can also use
- the X-DOS installation program to install these settings in your
- AUTOEXEC.BAT file.
-
- The Status Line
-
- The bottom line on the screen always functions as a status line.
- The status line displays basic information that is very useful
- when editing text; especially larger text files.
- The name of the file currently being edited or created, is
- displayed with the complete path. If a name is not specified at
- startup, ED will display ⌐new file¬ until the file is saved under
- another name.
-
- [I/C/N/W]
- This set of square brackets contains important information on the
- current status of the keyboard. The following information is
- displayed:
-
- I Insert mode is active
- C CapsLock is active
- N NumLock is active
- W Wordwrap at the end of the line
-
- [I/ / / ]
- When the I switch is ON, the Insert mode is in effect. In Insert
- mode, all text after the cursor is pushed to the right when new
- text is entered. If the I switch is OFF, ED is in Overwrite mode
- and overwrites text to the right of the cursor. To toggle this
- switch ON or OFF, press the <> key on your keyboard.
-
- [ /C/ / ]
- When the C switch is ON, the <> key is in effect. Thus, all
- letters will be entered in upper-case, unless the <> key is
- pressed, in which case they will be in lower-case.
-
- [ / /N/ ]
- When the N switch is ON, the <> key is in effect, which means
- that the keypad can be used to enter digits.
-
- [ / / /W]
- When the W switch is ON, ED is in wordwrap mode. When the cursor
- reaches the right margin (default right margin is column 78), ED
- automatically wraps the text to the next line. Toggle the
- wordwrap mode ON or OFF with the W hot key.
-
-
-
-
-
- 9-3
-
-
-
-
- F10=Menu
- A reminder that the main menu is activated by pressing the <>
- function key.
-
- Line: n
- Shows the line number where the cursor is at, counting from the
- start of the file.
-
- Col.: m
- Shows the number of the column where the cursor is at.
-
- The Menu Interface
-
- To ease the use of ED, the command has a menu interface. Most
- items in the menu are used for manipulation of text files. To
- access the main menu from the editing screen press the <>
- function key.
-
- Use the <> and <> arrow keys to move between the different menu
- items or a mouse if you have one installed. To select an item,
- highlight your choice and press <>. You can also use the
- highlighted quick keys to select a menu item. Most of the main
- menu items prompts you with a sub-menu so you to define the
- action to take place. If, for instance, you choose the Load File
- menu, you will be prompted with a sub-menu, asking you to enter
- the name of the file. To leave the main menu without choosing
- any options, press the <> key. Everywhere in the menu system,
- choices are made by pressing the <> key. The <> key always
- brings you one level back in the menus. Following is a
- description on each of the main menu options. You can get help
- on any of the main menu items by pressing the <> function key
- when a menu item is highlighted.
-
- Load File
- If you choose Load File from the main menu (see below), you are
- prompted for the name of the file to load into ED.
- Type the name of an already existing file to edit this file or
- write the name of a non-existing file to create a new file with
- that particular name. If you want to edit a file that does not
- reside in the default directory, you have to specify the complete
- path for that file, like this:
-
- C:\DIFFDIR\MYTEXT.DOC
-
- If you try to load a file that does not reside in the default
- directory without specifying a pathname, ED assumes that you want
- to create a new file with the specified name. If you are not
- sure that the file you want to edit is in the default directory,
- you can use the Directory menu item from the main menu to find
- the file.
-
- Write File
-
-
-
-
- 9-4
-
-
-
-
- The function of this menu is to save your text file onto a
- diskette or hard disk. It is always recommended that you save
- your file often during text editing to prevent loss of data due
- to system crash or power failure. If you are editing a file that
- you previously loaded into ED with the Load File item or from the
- command line, ED will display the name of the file and you only
- need to press <> to save it to the disk(ette). If you are
- creating a new file, ED prompts you for a filename like this:
-
- New File
- By choosing this menu item from the main menu, you clear all text
- currently residing in ED. Use this command very carefully, since
- it will erase any data you already have in ED. ED has a built-in
- safe guard which will prompt you to save any unsaved data when
- you choose this menu item. If you have not saved the text in ED
- before issuing this command, you must acknowledge that you want
- to start a new text file, without first saving the old file.
-
- Search Pattern
- In larger text files it is quite easy to forget where a
- particular part of text is located. The Search Pattern menu item
- prompts you with an entry box in which you can specify a string
- of text up to 20 characters long as a search pattern. You must
- enter a word or part of a word which you know is included in the
- text you are looking for.
-
- The search pattern you specify can be any part of a word but it
- cannot include any spaces. Therefore, it is not possible to
- specify a search pattern consisting of more than one word.
- The search pattern is case-sensitive so you will have to enter
- the search pattern exactly as it appears in the text. You also
- have to tell ED which way to search. This is done in the second
- entry of the Search Pattern entry box. Type 'D' to search down
- (read forward) in the text file from your current cursor position
- or type 'U' to search up (read backwards). You can tell ED
- exactly how may occurrences of the specified search pattern to
- skip before stopping on a matching text pattern. This is done in
- the Occurrence entry of the Search Pattern entry box. You can
- use the S hot key to continue the search each time ED has found a
- matching string.
-
- Change Pattern
- The function of this menu item is quite similar to that of the
- Search Pattern menu item. In addition to finding a particular
- string, the Change Pattern menu item also lets you specify a
- replacement string. This enables you to change a word all the
- way through a text file without missing any occurrences if you
- specify a `*' in the How many (*) entry. The search is case-
- sensitive.
-
- Go to Line
- This menu item lets you specify a line number where you want to
-
-
-
-
- 9-5
-
-
-
-
- position the cursor. This is a fast and efficient way to get
- around in large text files.
- If you specify a line number larger than the existing number of
- lines, ED gives the error message ⌐Wrong line number¬ and lets
- you specify a new line number.
-
- Insert File
- This menu item lets you combine multiple text files into one
- file. You will be prompted to type the name of the file you want
- to insert. ED places the inserted file at the current cursor
- position, automatically moving all text after the current cursor
- position to the end of the inserted file. This allows you to
- insert other text files anywhere in your text file just by moving
- the cursor to the position where you want the new text to be
- inserted and select the Insert File menu item.
-
- Directory
- If you choose this menu item from the main menu, ED will display
- a list of all the files in the default directory. If the default
- directory holds more files than is displayed in the directory
- list, you can use the arrow keys and the <> and <> keys to scroll
- back and forth in the list.
-
- Print
- This command lets you print all or part of the text file you are
- currently editing. When you select the Print menu item you are
- prompted with an entry box.
-
- By default ED assumes that you want to print the entire document
- and has therefore already filled out the first two entries of the
- Print File entry box with the first and the last line of your
- document. By specifying different values in the From line and To
- line entries, you can make ED print only part of a text file.
- The entry Page Break (Y/N) breaks the text file into pages of 60
- lines if you input a 'Y' here. The last entry, With header
- (Y/N), gives you the option to have a header printed on the top
- of each printed page of your text file (the default is without a
- header). The header looks similar to the following:
- FILENAME : myfile.doc DATE : 02/23/90 TIME : 17:01:11 PAGE:1
-
- Exit
- This is the option to choose if you want to leave ED. If unsaved
- text still resides in ED, you will be prompted with a menu from
- which you can choose to go back to ED, exit without saving, or
- write the file (save it) before exiting ED.
-
- Gateway to DOS
- This menu item lets you leave ED temporarily to run a X-DOS
- command or to run another program while still keeping ED in
- memory. Whatever text you had in ED before using the Gateway to
- DOS menu item will still be there when you return to ED. You can
- return to ED by typing 'EXIT' at the command line followed by
-
-
-
-
- 9-6
-
-
-
-
- pressing the <> key.
-
- Help on Editor
- This menu item displays all of the editing facilities available
- in ED together with the associated hot keys. The windows of
- commands can be paged through one by one using the <> and <> keys
- on your keyboard.
-
- Block Commands
-
- ED has five commands for manipulating blocks of text. These
- commands are invoked by the use of hot keys.
-
- Mark Block
- Place the cursor at the beginning or at the end of the block of
- text that you want to mark and press <>M to define the beginning
- of the marked text. Use the <> and <> arrow keys and the <> and
- <> keys to expand the block of marked text. The marked text will
- become highlighted. Once you have highlighted the text you want
- to manipulate, use one of the three block commands <>B, <>Q, <>R
- or <>J. If you decide not to perform any actions on the block of
- text you have marked, press the <>M hot key again to unmark the
- text.
-
- Copy Block to Paste Board (<>B)
- This command copies the marked block of text and stores it in an
- area of memory called the Paste Board. This command is ideal for
- making copies of the same text for use in different places of
- your document.
-
- Delete Block to Paste Board )<>Q)
- This command deletes the marked block of text and stores it in
- the paste board. This command is an easy way to move text around
- in a text file.
-
- Insert Paste Board Contents (<>R
- This command places the contents of the paste board at the
- current cursor position in your text file. You can perform this
- operation as many times as you want. It is important to note
- that only one block of text is kept in the paste board at any
- time.
-
- Justify Block (<>J)
- This command right-justifies a paragraph of marked text by
- inserting spaces between words in each line. This gives your
- text a nice, even look. It is suggested that you justify only
- one paragraph at a time, to avoid unintentional justification.
-
- Margins and Wordwrap
-
- Besides right justification, ED also gives you the capability to
- set the right and left margins from within the text file. The
-
-
-
-
- 9-7
-
-
-
-
- default margin settings are displayed by two triangle marks at
- the bottom of the screen, pointing up just above the status line.
- These margins can be set with the SET ED= command at the command
- line. If you type in text without changing the default margin or
- wordwrap settings, the text will start in column 0 and will
- continue across the page until you press <>. To make the text
- wrap around to the next line, you must enable the wordwrap
- function. To do this from within ED, press the W hot key.
-
- The default right margin for the wordwrap function is column 78
- if no margin settings are defined. You can set the margins with
- the SET command or from within ED by using the L hot key to set
- the left margin and the R hot key to set the right margin. To
- set the margins from within ED, place the cursor in the column
- you want to set as the left margin and press L and then place the
- cursor in the column you want to set as the right margin and
- press R.
-
- The <>J command (Justify Block) will right justify a marked
- paragraph of text within the specified margins.
-
- Delete/Undelete Functions
-
- Delete until End of Line (<>E)
- By issuing this command you delete all text from the current
- cursor position until the end of the line.
-
- Delete Current Line (<>D)
- This command deletes the entire line in which the cursor is
- located.
-
- Undelete Line (<>U)
- If you accidentally delete a line with the Delete Current Line
- (<>D) command, you can use Undelete Line command to undo the
- deletion. ED remembers the most recent deleted line. This
- command, together with the Delete Current Line command, can be
- used to move lines in your text file.
-
- Quick Command Reference
-
- All editing commands can be accessed directly by a single
- keystroke or by the use of the <> or key in combination with
- another key. To use the <>/ key commands, the <> or key must be
- held down while the other key is pressed. See the table below
- for a list of all the hot key combinations.
- <Home> Places the cursor at the beginning of the
- line.
-
- <End> Places the cursor at the end of the line.
-
- <Ctrl><Home> Places the cursor at the beginning of the
- text file.
-
-
-
-
- 9-8
-
-
-
-
-
- <Ctrl><End> Places the cursor at the end of the text
- file.
-
- <Ins> Switches between Insert and Overwrite modes.
-
- <Del> Deletes the character at the current cursor
- position.
-
- <PgDn> Shows the next screen of text.
-
- <PgUp> Shows the previous screen of text.
-
- <Down>Arrow Moves the cursor down one line.
-
- <Up>Arrow Moves the cursor up one line.
-
- <Left>Arrow Moves the cursor one character left.
-
- <Right>Arrow Moves the cursor one character right.
-
- <Backspace> Deletes the character to the left of the
- cursor.
-
- <Enter> Adds a new line after the current line.
-
- <Alt>B Copies a marked block of text to the paste
- board.
-
- <Alt>C Changes a string of text with another string
- of text.
-
- <Alt>D Deletes current line.
-
- <Alt>E Deletes characters from current position to
- end of the line.
-
- <Alt>G Gateway to X-DOS. Exits you to the command
- line
-
- <Alt>H Help on ED. Displays summary of available
- hot keys.
-
- <Alt>I Inserts another text file at the current
- cursor position.
-
- <Alt>J Right justifies a marked block of text.
-
- <Alt>L Loads a new file into ED.
-
- <Ctrl>L Sets the left margin at the current cursor
- position.
-
-
-
-
- 9-9
-
-
-
-
-
- <Alt>M Marks a block of text. Use cursor keys
-
- <Alt>N Starts new file. Will prompt if current file
- not saved.
-
- <Alt>O Places the cursor at a specified line number.
-
- <Alt>Q Deletes a marked block of text to the paste
- board.
-
- <Alt>R Inserts text in paste board at the current
- cursor position.
-
- <Ctrl>R Sets the right margin at the current cursor
- position.
-
- <Alt>S Searches the text file for a specified string
- of text.
-
- <Ctrl>S Searches for the next occurrence of a text
- string.
-
- <Alt>U Undeletes text deleted with the <Alt>D hot
- key.
-
- <Alt>V Displays the contents of the default
- directory.
- You can select a file to load or insert into
- an existing text file by pressing <Alt> on
- any one of the displayed files and then press
- <Alt>L or <Alt>I.
-
- <Alt>W Writes the current text file to the disk.
-
- <Ctrl>W Toggles wordwrap mode ON or OFF.
-
- <Alt>X Exits ED.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 9-10