The buffer mode also affects erasing a box with pending delete and restoring an erased box.
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-4 describes the EVE commands that locate 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. |
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:
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.
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.
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
Use this tutorial to use the FIND command with the existing file RHYMES.DAT:
She rhymes with tree, also with bee, and this one makes thREE. [End of file]
Use this tutorial to use FIND SELECTED to search for a string that is particularly complicated or is easily misspelled or mistyped:
You can use wildcards to search for text. The SHOW WILDCARDS command displays wildcard patterns for the current wildcard setting.
Use this tutorial to learn how to use wildcards:
She rhymes with tree, also with bee, and this one makes thREE. [End of file]
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.
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.
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.
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.
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 Return 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. |
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.
The following table lists the qualifiers that you can use with the EDIT/TPU command to invoke EVE:
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 |
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/TPU 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/TPU 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).
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:
$ EDIT/TPU /WORK=MYWORK
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/TPU /READ_ONLY /MODIFY
In EVE, you can set or change the modification attribute of the buffer by using SET BUFFER commands.
You can invoke EVE using four different methods: from search lists, with wildcards, with wildcard directory names, or with multiple input files.
In the following 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.
$ DEFINE STAFFMEMOS HIRING.DAT,PROMOTION.LIS,SALARY.TXT $ EDIT/TPU STAFFMEMOS
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.
$ EDIT/TPU *.TXT
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/TPU 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:
In the following example, EVE searches through the directory tree and gets the first PINK.TXT file found, if there is one.
$ EDIT/TPU [...]PINK.TXT
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.
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.
Buffer-change journaling creates a journal file for each text buffer. (EVE does not create buffer-change journal files for system buffers such as the Insert Here buffer, DCL buffer, or $RESTORE$ buffer.) As you edit a buffer, the journal file records the changes you make, such as erasing, inserting, or reformatting text. When you exit from EVE or when you delete the buffer, the journal files are deleted. If a system failure interrupts your editing session, the journal files are saved. Your last few keystrokes before the system failure may be lost.
The following table summarizes the EVE commands for buffer-change journaling and recovery:
Command | Function or Effect |
---|---|
RECOVER BUFFER | Recovers a specified buffer by using the journal file for the buffer. You can specify the name of the buffer or file you want to recover or the name of the journal file for the buffer. |
RECOVER BUFFER ALL | Recovers all your text buffers, one at a time, by using the journal files for the buffers, if there are any. |
SET JOURNALING | Enables buffer-change journaling for a buffer that you specify. |
SET JOURNALING ALL | Enables buffer-change journaling for all your buffers. This is the default setting. |
SET NOJOURNALING | Disables buffer-change journaling for a buffer that you specify. |
SET NOJOURNALING ALL | Disables buffer-change journaling for all your buffers. |
Buffer-change journal files are written in a directory defined by the logical name TPU$JOURNAL. By default, this directory is SYS$SCRATCH, which is typically your top-level (login) directory. You can redefine the TPU$JOURNAL logical name to have the journal files written to a different directory. For example, the following commands create a subdirectory called [USER.JOURNAL] and then define TPU$JOURNAL as this subdirectory:
$ CREATE/DIRECTORY [USER.JOURNAL] $ DEFINE TPU$JOURNAL [USER.JOURNAL]You can put the definition in your LOGIN.COM file.
6489P012.HTM OSSG Documentation 22-NOV-1996 13:16:50.97
Copyright © Digital Equipment Corporation 1996. All Rights Reserved.