Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS User's Manual


Previous Contents Index

8.10 Copying Text

With the COPY command, you can copy text elsewhere. The STORE TEXT command is the same as the COPY command. You can substitute the STORE TEXT command wherever the COPY command is used in the following example.

Tutorial: Copying Text

To copy text when the buffer is set in a forward direction:

  1. Invoke EVE to edit the file RHYMES.DAT.
  2. Move the cursor to the first line of text.
  3. Press the Select key.
  4. Press Ctrl/E to move the cursor to the end of the first line.
  5. Enter the COPY command. The Insert Here buffer now contains a copy of the selected text.
  6. Move the cursor to the line above also with bee,.
  7. Press the Insert Here key. Your buffer should now look as follows:


    She rhymes with tree, 
     
    She rhymes with tree, 
    also with bee, 
    and this one makes three. 
    [End of file] 
    

  8. Move the cursor to the beginning of the first line of text. Use the Select key and then the Remove key to delete the first line of text.
  9. To exit from EVE, press Ctrl/Z.

8.11 Box Editing

You can edit text that has rectangular areas, or boxes, as well as standard linear ranges. For example, you can select a box containing a list or columns in a table, and then cut and paste the box or perform some other editing operation on the box.

8.11.1 Selecting a Box of Text

To select a box of text, follow these steps:

  1. Put the cursor where you want to start the selection---typically, where you want the upper left corner of the box.
  2. Enter the BOX SELECT command.
  3. Move the cursor to where you want the diagonally opposite corner of the box --- typically, moving from upper left to lower right.

As you move the cursor, text that you cross is highlighted in bold video (a regular selection uses reverse video). The box is defined by diagonally opposite corners. If you move from upper left to lower right, the character that the cursor is on is outside the box, that is, the lower right corner of the box is left of the cursor.

You can then edit the box by using any of the editing commands that ordinarily work on a linear or a rectangular range. You need not redefine keys. See the Extensible Versatile Editor Reference Manual for further information.

You can use FIND SELECTED if the selection does not cross lines or OPEN SELECTED. You can also use pending delete.

If you are going to make several box edits---for example, in editing multicolumn tables and lists---use the SET BOX SELECT command. SET BOX SELECT redefines several commands and keys as the corresponding BOX commands and makes other editing operations work on boxes instead of linear ranges.

To cancel a box selection, repeat SELECT or BOX SELECT, or use RESET.

8.11.2 Cutting and Pasting a Box of Text

Cutting a box usually pads the area with spaces to keep the column alignment of text to the right of the box. Pasting a box usually overwrites existing text. Tab characters in the box, or that overlap the box, are converted to spaces to keep the column alignment of text.

Table 8-7 lists the EVE commands for box editing.

Table 8-7 EVE Commands for Box Editing
Command Function
BOX COPY Copies a box of text without removing it, so you can paste it elsewhere.
BOX CUT Cuts a box of text so you can paste it elsewhere, usually padding the area with spaces to keep the column alignment of text to the right of the box.
BOX CUT INSERT Cuts a box, making text to the right of the box "collapse" to the left, closing the gap.
BOX CUT OVERSTRIKE Cuts a box, padding the area with spaces to keep the column alignment of text to the right of the box.
BOX PASTE Pastes a box of text you copied or cut, usually overwriting existing text.
BOX PASTE INSERT Pastes a box, pushing existing text to the right.
BOX PASTE OVERSTRIKE Pastes a box, overwriting existing text.
BOX SELECT Selects a box of text. Typically, you start at the upper left corner of the box and move the cursor to where you want the lower right corner.
RESTORE BOX SELECTION Puts back (undeletes) a box erased with pending delete, usually overwriting existing text.
SET BOX NOPAD Disables padding and overstriking for box editing unless the buffer is in overstrike mode.
SET BOX NOSELECT Default setting. Disables box selection, cutting, and pasting. Commands such as SELECT, COPY, and REMOVE use standard linear ranges. To edit boxes, use BOX commands.
SET BOX PAD Default setting. Enables automatic padding and overstriking for box editing, regardless of the buffer mode.
SET BOX SELECT Enables box selection, making commands such as SELECT, REMOVE, and INSERT HERE the same as the corresponding BOX commands, without having to redefine keys.

Tutorial: Cutting and Pasting Text

To select and then cut and paste a box of text:

  1. Invoke EVE to create the buffer CITIES.DAT and enter the following text:


          Rome    Paris   New York 
          London  Tunis   Boston 
          Tokyo   Bonn    Lisbon
    

  2. Move the cursor to the left of the letter P in the word Paris. Enter the BOX SELECT command.
  3. Move the cursor two spaces to the right of the second letter n in the word Bonn---the diagonally opposite corner of the box. The text that you cross is highlighted in bold video. Enter the BOX CUT command.
    EVE removes the box of text.
  4. Move the cursor to the right of the column that begins with the words New York.
  5. Enter the BOX PASTE command.
    EVE pastes the box of text into a new column, as follows:


        Rome        New York     Paris 
        London      Boston       Tunis 
        Tokyo       Lisbon       Bonn 
    [End of file] 
    

8.11.3 SET BOX SELECT Commands

Table 8-8 lists the SET BOX SELECT commands.

Table 8-8 SET BOX SELECT Commands
Command Effect with SET BOX SELECT
INSERT HERE or PASTE BOX PASTE
REMOVE or CUT BOX CUT
RESTORE SELECTION RESTORE BOX SELECTION
SELECT BOX SELECT
STORE TEXT or COPY BOX COPY

You can then select, cut, and paste a box by using the Select, Remove, and Insert Here keys, without having to redefine the keys.

8.12 Using Pending Delete

You can use pending delete to erase selected text. Pending delete refers to erasing a selection by typing new text, pressing the space bar, or by using delete (typically, pressing the Delete key).

With a box selection, pending delete works like BOX CUT, usually padding the area with spaces to keep the column alignment of text to the right of the box.

Pending delete gives you an alternative way of cutting and pasting text because pending delete does not use the Insert Here buffer. For more information about pending delete, see the EVE online help topic called Pending Delete.

8.12.1 Erasing a Selection with Pending Delete

To erase a selection using pending delete, follow these steps:

  1. Invoke a file in EVE.
  2. To enable pending delete, use the SET PENDING DELETE command. The default setting is SET NOPENDING DELETE.
  3. Select the text you want to erase. You can use SELECT or BOX SELECT. (You cannot use SELECT ALL.)
  4. Type new text or use the DELETE command.

8.12.2 Restoring a Selection That Was Erased with Pending Delete

To put back (restore) the text you erased with pending delete, follow these steps:

  1. Put the cursor where you want to restore the text. If restoring a box selection, put the cursor where you want the upper left corner of the box to be.
  2. Use RESTORE SELECTION. If a box selection was erased with pending delete, use RESTORE BOX SELECTION. If you used SET BOX SELECT, you can use RESTORE SELECTION (without having to redefine a key).

Restoring a box works like BOX PASTE, usually overwriting existing text. When using the SET BOX NOPAD command, the effects of box editing depend on the mode that the buffer is in (insert or overstrike, as shown in the status line):

The buffer mode also affects erasing a box with pending delete and restoring an erased box.

8.13 Finding and Replacing Text

With EVE commands, you can search for specific text in a buffer. You can search for every occurrence of specific text, and you can search for text that is on a single line or spans a line break. Also, you can search for text using wildcards. This section describes methods for searching and replacing text.

Table 8-9 describes the EVE commands that locate text in a buffer.

Table 8-9 EVE Commands for Locating Text in a Buffer
Command Function
FIND Searches the current buffer for the text string you specify and highlights the found text. The text that is highlighted is called the found range.
FIND NEXT Searches for the string of text you last specified with the FIND, REPLACE, or WILDCARD FIND command.
FIND SELECTED Searches for a string of text you have selected, rather than for a typed string. The selection cannot cross more than one line.
SET FIND CASE EXACT Enables case-exact searches. This is particularly useful to find or replace search strings in lowercase letters only.
SET FIND CASE NOEXACT Default setting. Disables case-exact searches so that EVE finds any occurrence if you enter a search string in all lowercase letters.
SET FIND NOWHITESPACE Default setting. Sets FIND and WILDCARD FIND commands to match tabs and spaces exactly as you specify in the search string and to search for strings that are entirely on one line.
SET FIND WHITESPACE Sets FIND and WILDCARD FIND commands to treat spaces, tabs, and up to one line break as "white space" so you can search for strings of two or more words regardless of how they are separated.
SET WILDCARD VMS Default setting on OpenVMS. Enables OpenVMS patterns for WILDCARD FIND.
SHOW WILDCARDS Lists the wildcard patterns you can use with WILDCARD FIND.
WILDCARD FIND Searches for a pattern of text, using wildcards.

8.13.1 Finding Text

Use the FIND command to locate specific text in the current buffer. By default, EVE defines the E1 key (Find key on VT200, VT300, and VT400 series terminals and the PF1 key on VT100 series terminals) as the FIND command.

If the search string contains all lowercase letters, EVE disregards the case of letters and locates any occurrence of the string. Thus, the search string the matches the, THE, THe, and thE. If the search string contains one or more uppercase letters, EVE finds only the occurrences of the string in which the case of each letter is exactly the same. Therefore, the only match for the search string tHis is tHis. For example:

  1. Enter the FIND command.
  2. Type the text (called the search string) that you want to locate.

The current direction of the buffer determines whether EVE first searches in a forward or reverse direction.

If EVE cannot find the string in the current direction but finds it in the opposite direction, EVE prompts you to change direction.

To search in the opposite direction, type YES (Y) and press the Return key. EVE moves the cursor to the first occurrence of the string in the opposite direction. The current direction in the highlighted status line does not change, however.

8.13.1.1 When a Search String Is Found

When EVE finds the search string, the editor highlights it and moves the cursor to the first letter of the string. See the Extensible Versatile Editor Reference Manual for a listing of the editing commands you can use on a highlighted search string.

To cancel the highlighting, move the cursor off the search string or use the RESET command.

To find the next occurrence of the search string, press the Find key twice or enter the FIND NEXT command.

8.13.2 Setting Case-Exact Searches

If you want to match the case of your search exactly when searching for lowercase occurrences of a string, enter the SET FIND CASE EXACT command. Then when you enter a search string in all lowercase letters, EVE searches only for lowercase occurrences, skipping occurrences that contain uppercase letters.

The setting applies to the FIND, REPLACE, and WILDCARD FIND commands. You can save the setting in your section file or command file for future editing sessions. The default setting is SET FIND CASE NOEXACT.

EVE is sensitive to diacritical (accent) marks and locates only those occurrences of the string in which the diacritical marks are exactly the same. For example, in searching for ë, EVE does not find occurrences of e, é, è, or ê.

In the following example, the commands enable case-exact searching and then find digital when it appears in lowercase only, skipping occurrences such as Digital or DIGITAL:


Command: SET FIND CASE EXACT
Command: FIND digital

Tutorial: Finding Text

To use the FIND command with the existing file RHYMES.DAT:

  1. Invoke EVE to edit RHYMES.DAT. The cursor appears on the first letter of the first line of the buffer, and the current direction is forward.
  2. Press the Find key, type the letters ree, and press the Return key. The cursor moves to the letter r in the word tree and highlights the letters ree.
  3. Press the Find key twice to find the next occurrence of the string ree. The cursor moves to the letter r in the word three and highlights the letters ree.
    When a search string is found and highlighted, you can use any command that works on a selected or found range except SPELL. Also, you cannot use a pending delete operation on a found range.
  4. Enter the UPPERCASE WORD command.
    The UPPERCASE WORD command changes the case of the highlighted letters from lowercase to uppercase, as shown in the following example:


    She rhymes with tree, 
    also with bee, 
    and this one makes thREE. 
    [End of file] 
    

Tutorial: Using the FIND SELECTED Command

To use FIND SELECTED to search for a string that is particularly complicated or is easily misspelled or mistyped:

  1. Copy the text (from the previous tutorial) so that it is displayed twice in the buffer.
  2. Move the cursor to the beginning of the string rhymes with tree, on the first line.
  3. Enter the SELECT command.
  4. Move the cursor to highlight the string and select text. Note that the selection cannot span more than one line.
  5. Enter the command FIND SELECTED.
    The cursor moves to the next occurrence of the string rhymes with tree,. The selection is canceled and the found string appears in bold video.

8.13.3 Using Wildcards

You can use wildcards to search for text. The SHOW WILDCARDS command displays wildcard patterns for the current wildcard setting.

Tutorial: Using Wildcards

To learn how to use wildcards:

  1. Position the cursor at the beginning of the buffer.
  2. Enter the command WILDCARD FIND *ee to search for text strings ending in ee.


    She rhymes with tree, 
    also with bee, 
    and this one makes thREE.
    [End of file] 
    

    EVE puts the cursor at the beginning of the line containing the r in tree.

8.13.4 Including White Space in a Search

Use the SET FIND WHITESPACE and SET FIND NOWHITESPACE commands to specify how the WILDCARD FIND and FIND commands treat the blank spaces between words, such as spaces, tabs, and line breaks.

The SET FIND NOWHITESPACE command enables the commands to search for multiword strings on a single line, matching spaces and tabs exactly as they are found. SET FIND NOWHITESPACE is the default search behavior.

The SET FIND WHITESPACE command enables the WILDCARD FIND and FIND commands to search for a string of two or more words regardless of how they are separated. It enables the FIND commands to search for a string that contains a single line break and more than one space or tab between words.

8.13.5 Marking Locations in Text

The MARK and GO TO commands are useful for editing a large file and then returning to a specific location later in the editing session. The following table describes the MARK and GO TO commands:
Command Function
MARK Puts an invisible mark at the current cursor position. The mark exists for the rest of an editing session or until you change it; it is not saved when you exit.
GO TO Returns the cursor to the location labeled by the MARK command. If the labeled location is found in another buffer, EVE moves the cursor to the other buffer and puts that buffer into the current window.

To mark your position, enter the MARK command followed by a label name of your choice. The label name can be one or more printable characters, including alphanumeric and punctuation characters, spaces, and tab characters. To return the cursor to the marked location, enter the GO TO command followed by the label name.

8.13.6 Replacing Text

With the REPLACE command, you can replace a text string in the current buffer with another text string. This is useful if you have spelled a word incorrectly throughout a long file and you want to fix every occurrence of the misspelled word.

8.13.6.1 REPLACE Command and Case Sensitivity

The REPLACE command is case sensitive. If the old string has any uppercase letters, EVE searches for exact case matches. If the old string is all lowercase, EVE searches for any occurrence of the string regardless of its case. If the new string has any uppercase letters, EVE replaces the string exactly. If the old and new strings are all lowercase, EVE replaces the string according to the following rules:

The following table shows how EVE uses the case of the strings:
Old String New String Highlight Replacement
butter margarine butter margarine
    Butter Margarine
    BUTTER MARGARINE
    BUtteR margarine
       
Butter margarine Butter margarine
       
butter Margarine butter Margarine
    Butter Margarine
    BUTTER Margarine
    BUtteR Margarine
       
Butter Margarine Butter Margarine

If you want to find or replace only lowercase occurrences of a string, enter the SET FIND CASE EXACT command. Then if you enter a search string in all lowercase, EVE searches for only lowercase occurrences, skipping occurrences that contain uppercase letters. The setting applies to FIND, REPLACE, and WILDCASE FIND commands.

The following table shows how EVE searches for and replaces only lowercase strings when you enter the SET FIND CASE EXACT command:
Old String New String Highlight Replacement
butter margarine butter margarine

The default case setting is SET FIND CASE NOEXACT.


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
6489PRO_016.HTML