HP OpenVMS Systems Documentation

Content starts here

OpenVMS User's Manual


Previous Contents Index

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. Refer to 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 Enter 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:

  • A capitalized version of the old string (first letter uppercase, others lowercase) is replaced by a capitalized version of the new string.
  • An all-uppercase version of the old string is replaced by an all-uppercase version of the new string (otherwise, the old string is replaced by an all-lowercase version of the new string).

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.

8.13.6.2 REPLACE Command Responses

The following table shows the responses and their effect to the REPLACE command query:

Response Effect
Yes Replace this occurrence and find the next one. This is the default response. Press the Enter key.
No Skip this occurrence and find the next one.
All Replace all occurrences (no further prompting unless EVE finds an occurrence in the opposite direction).
Last Replace this occurrence and stop here.
Quit Skip this occurrence and stop here.

8.14 Using Command Line Qualifiers

When you invoke EVE, you can use command line qualifiers to specify advanced EVE editing features. When using the character-cell screen updater, the default insert or overstrike mode is determined by your terminal setting.

Table 8-10 lists the qualifiers that you can use with the EDIT command to invoke EVE.

Table 8-10 EDIT Command Line Qualifiers
Qualifier Default
Command file /COMMAND=TPU$COMMAND.TPU
File creation /CREATE
Debugging package /NODEBUG
Specifying display mode /DISPLAY=CHARACTER_CELL
Initialization file /INITIALIZATION=EVE$INIT.EVE
Journaling /JOURNAL
Modifying main buffer /MODIFY
Specifying output /OUTPUT=output-file
Read-only access /NOREAD_ONLY
Recovery /NORECOVER
Section files /SECTION=TPU$SECTION
Start position /START_POSITION=(1,1)
Work file /WORK=SYS$SCRATCH:TPU$WORK.TPU$WORK

8.14.1 Starting in an Alternate Position

Start position qualifiers determine the row and column where the cursor first appears in the buffer that you specified on the command line.

For EVE, the default start position is 1,1---row 1, column 1, which is the upper left corner of the buffer. Use of start position qualifiers does not affect the initial cursor position when you create another buffer during the editing session and does not limit the buffer size.

The format of the start position qualifier is as follows:


/START_POSITION=(row[,column]

The fields are as follows:

/START_POSITION You must use the /START_POSITION= qualifier to the EDIT command.
row The row that you want the cursor to be at when you invoke EVE.
column The column that you want the cursor to be at when you invoke EVE.

Use the start position qualifier to begin editing at a particular line (or row) or at a particular character position (or column). For example, when you want to skip over a standard heading in a file or if a batch log file or error message tells you there is an error on a given line of a program, you can specify that line number as the starting row so that when you edit the program source file, the cursor moves directly to that line. The following command edits a file named test.com and puts the cursor on line 10, column 5:


$  EDIT TEST.COM /START_POSITION=(10,5)

If you want to start at a particular line in a file, you can omit the second parameter (the column).

8.14.2 Using Work Files

Work file qualifiers determine the work file that is used to swap memory for editing very large files. There is one work file per editing session. The work file is a temporary file that is automatically deleted when you exit.

The default work file is named TPU$WORK.TPU$WORK. EVE creates the work file in SYS$SCRATCH unless you specify otherwise.

There are two ways to specify a different work file:

  • Define the logical name TPU$WORK. This is useful if you want the work file to be created in an area other than SYS$SCRATCH, such as on a larger disk. You can put the definition in your LOGIN.COM file.
  • Use the /WORK= qualifier and specify the work file. This overrides any definition of the TPU$WORK logical name. For example, the following command invokes EVE and specifies the work file to be SYS$SCRATCH:MYWORK.TPU$WORK:


    $  EDIT /WORK=MYWORK
    
If you want the work file to be created in an area other than SYS$SCRATCH, use a complete file specification, including the device (disk) and directory. You cannot use wildcards to specify the work file.

8.14.3 Modifying the Main Buffer

Modifying qualifiers determine whether you can modify the buffers specified on the command line. Modifications do not affect other buffers you create during the editing session.

By default, you can modify the buffer by editing text in it. When you exit, EVE writes out the buffer to a file if the buffer has been modified.

Use /NOMODIFY to examine a file without making any changes. You can then use cursor-movement commands but you cannot change the text.

If you specify neither /MODIFY nor /NOMODIFY, your application determines if you can modify the buffer. EVE's default behavior is to modify the buffer.

Use /MODIFY to override the effect of /READ_ONLY or /NOWRITE. Use /MODIFY with /READ_ONLY or /NOWRITE to practice editing operations without writing a file on exiting. For example, the following command invokes EVE, making the buffer you specified on the command line read-only (or no-write) and making it modifiable:


$  EDIT /READ_ONLY /MODIFY

In EVE, you can set or change the modification attribute of the buffer by using SET BUFFER commands.

8.15 Alternate Methods to Invoke EVE

You can invoke EVE using four different methods: from search lists, with wildcards, with wildcard directory names, or with multiple input files.

8.15.1 Invoking EVE from a Search List

You can use a search list to invoke EVE to edit a file from that search list. For example:


$ DEFINE STAFFMEMOS HIRING.DAT,PROMOTION.LIS,SALARY.TXT
$  EDIT STAFFMEMOS

In the example, if the first file in the search list exists, EVE copies that file (HIRING.DAT) into a buffer and uses the file name and file type as the buffer name. If the file does not exist, EVE tries to get the second file (PROMOTION.LIS), and so on. If none of the files in the search list exist, EVE creates an empty buffer named HIRING.DAT because that is the first file in the search list.

8.15.2 Invoking EVE with Wildcards

When you invoke EVE to edit an existing file, you can use the asterisk (*) wildcard character as a substitute for some or all of the characters in the file name and file type. To use wildcards in EVE, follow the same rules as using wildcards in DCL. You can use the percent sign (%) wildcard character as a substitute for a single character at a time, and you can use the ellipsis ([...]) wildcard character as a substitute for a directory specification. If only one match is made, the file is displayed on your screen. If more than one match is made, EVE displays a list of matching files and prompts you to provide a more complete file specification. If no match is made, EVE creates a buffer named Main.

If more than one file matches your wildcard request, EVE displays the matching files so you can choose the one you want.

If no matching file is found, EVE creates an empty buffer named Main. If you use a search list or wildcard directory to specify an input file, EVE gets the first matching file found without displaying the $CHOICES$ buffer. For information about using the $CHOICES$ buffer, see the EVE online help topic called Choices Buffer.

In the following example, a list of all files with the file type .TXT will be displayed:


$  EDIT *.TXT

If you specify *.TXT, EVE lists the files that match your wildcard request in a second window in a system buffer named $CHOICES$.

8.15.3 Invoking EVE with Wildcard Directory Names

You can use wildcards in a directory name ([...]) to invoke EVE and work either in your current directory or in a subdirectory of the current directory.

This way of handling a search list or wildcard directory applies not only to the EDIT command, but also to EVE commands that use a file specification as a parameter. The following EVE commands use a file specification as a parameter:

@ (at sign)
GET FILE
INCLUDE FILE
OPEN
OPEN SELECTED
RECOVER BUFFER

In the following example, EVE searches through the directory tree and gets the first PINK.TXT file found, if there is one.


$  EDIT [...]PINK.TXT

8.15.4 Invoking EVE with Multiple Input Files

You can specify multiple input files on the command line that invokes EVE. The file names must be separated by commas with optional white space. If wildcard characters are present in the file names, EVE displays the matching files only for the first wildcard file name that has more than one match. For the other ambiguous file names, EVE outputs a warning message.

8.16 Journaling and Recovery

Journal files record your edits so that if a system failure interrupts your editing session, you can recover your work.

Buffer-change journaling creates a separate journal file for each text buffer you create. This is the EVE default. Buffer-change journaling works both on DECwindows and on character-cell terminals. You recover one buffer at a time, typically by using RECOVER BUFFER commands in EVE. You can recover buffers from different editing sessions. The recovery restores only your text---it does not restore settings, key definitions, or the contents of system buffers (such as the Insert Here buffer) before the system failure.

You can disable journaling when you invoke EVE by using the /NOJOURNAL qualifier on your command line. This is useful when you use EVE to examine a file without making any edits or for demonstration sessions.

EVE file backups are disabled and cannot be enabled because the OpenVMS file system provides version numbers; therefore, no EVE mechanism is needed.


Previous Next Contents Index