[OpenVMS documentation]
[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
Updated: 11 December 1998

OpenVMS User's Manual


Previous Contents Index

8.18 Using Buffers

Buffers are storage areas that exist only during an editing session. When you edit an existing file, EVE reads the contents of the file into a buffer. The highlighted status line contains the name of the buffer, its editing status (read-only or write), editing mode (insert or overstrike), and direction (forward or reverse).

Table 8-15 describes the EVE commands used to create, manipulate, and delete buffers.

Table 8-15 EVE Commands to Manipulate Buffers
Command Function
BUFFER Puts the specified buffer into the current window and moves the cursor to the last location it occupied in that buffer. If the specified buffer does not exist, creates a new buffer.
DELETE BUFFER Deletes a buffer you specify by name.
GET FILE
or OPEN
Puts the specified file into the current EVE window, creating a new buffer if necessary. If the file exists, EVE copies it into a new buffer in the current window. If the file does not exist, EVE creates a new, empty buffer, using the file name and file type for the buffer name. If there already is a buffer by that name, EVE asks for a different name to use.
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 that buffer and puts it into the current window. (Section 8.18.5 explains how to use multiple buffers in an editing session.)
INCLUDE FILE Inserts the contents of the specified file into the current buffer at the line above the cursor location. This is useful to combine files.
NEW Creates a new buffer named Main and puts it into the current window. If the buffer Main already exists, EVE asks for a name for the new buffer.
NEXT BUFFER Puts the next buffer (if one exists) into the current window and moves the cursor to the last position it occupied in that buffer. This command lets you move from one buffer to another without specifying a buffer name.
OPEN SELECTED Opens a file whose name you have selected or found. This command is the same as using the GET FILE or OPEN command without having to type the file name.
REMOVE
or CUT
If you are in the Buffer List buffer, same as DELETE BUFFER. Use the REMOVE command as follows to delete a buffer without typing the buffer name: enter the SHOW BUFFERS command (which puts you in the Buffer List buffer), move the cursor to the name of the buffer you want to delete, and enter the REMOVE command.
SAVE FILE Writes the contents of the current buffer to the file associated with the buffer without ending the editing session. If you do not specify a file name with the SAVE FILE command, EVE prompts you for an output file specification. Similar to WRITE FILE.
SAVE FILE AS Writes the contents of the current buffer to the file you specify without ending the editing session. For example, if you are editing a file named FIRST.DAT, you can save it as SECOND.TXT. This command does not change the name of the buffer. It does, however, associate the buffer with the file you name so that any subsequent SAVE FILE, WRITE FILE, or EXIT command writes the buffer to the file you named. This command requires you to supply a file specification.
SELECT
or RETURN
If you are in the Buffer List buffer, selects the buffer you specify. Use the SELECT command as follows to select a buffer without typing the buffer name: enter the SHOW BUFFERS command, move the cursor to the name of the buffer you want to select, and enter the SELECT command.
SET BUFFER Lets you specify the editing status of the buffer: whether the buffer can be modified or can be written to a file when you exit from EVE.
SHOW Displays information about the buffers you have created during the editing session. If more than one buffer is active in your editing session, the SHOW command displays information about the buffer you are currently editing. For information about the other active buffers, press the Do key. To resume editing, press any other key.
SHOW BUFFERS Lists the buffers you have created during an editing session. You can move the cursor through the list and specify a particular buffer for viewing by pressing the Select key.
SHOW DEFAULTS BUFFER Shows information, such as margins, tab stops, direction, mode, and maximum lines, about the EVE system buffer named $DEFAULTS$. These are the default settings used when you create new buffers.
SHOW SYSTEM BUFFERS Lists the system buffers created by EVE, such as the Message buffer, Help buffer, Insert Here buffer, and $RESTORE$ buffer. You can move the cursor through the list and specify a buffer for viewing by pressing the Select key.
WRITE FILE Writes the contents of the current buffer to the file associated with the buffer or to the file you specify on the command line without ending the editing session. If the current buffer does not have a file specification associated with it, EVE prompts you for an output file specification. Similar to SAVE FILE.

8.18.1 Obtaining Buffer Information

To display more information about the current buffer, enter the SHOW command. The information displayed includes whether the buffer has been modified, in addition to the following:

If more than one buffer is active during an editing session, EVE prompts you to press the Do key to get information about other buffers.

8.18.2 Deleting a Buffer

To delete a buffer, enter the DELETE BUFFER command and specify the name of the buffer you want to delete. If the buffer is empty or unmodified, EVE deletes it. If, however, the buffer has been modified, EVE prompts you for a choice. Note that the buffer name must be typed in full; no abbreviations are allowed. If you are viewing a buffer that you want to delete, EVE replaces the buffer with the oldest buffer existing in the editing session.

The following table lists the choices you can enter:
Keyword Effect
DELETE_ONLY Deletes the specified buffer.
WRITE_FIRST Writes out (saves) the specified buffer, then deletes it.
QUIT Default choice. The buffer is not deleted.

In the following example, deletion of the modified buffer MYFILE.TXT is requested:


Command: DELETE BUFFER MYFILE.TXT
That's a modified buffer. Type delete_only, write_first, or quit:

8.18.3 Changing Buffer Status

Use the SET BUFFER command to change the editing status of the buffer; that is, whether the buffer can be modified and whether the buffer will be written to a file after you exit from EVE.

You can specify one of the following SET BUFFER command keywords for each command:
Keyword Effect
MODIFIABLE Default setting. The buffer can be modified. Also restores the previous mode of the buffer (insert or overstrike).
READ_ONLY The buffer is not saved (written out) on exiting, even if it has been modified (opposite of WRITE). Also sets the buffer to unmodifiable. However, you can set it to modifiable.
UNMODIFIABLE The buffer cannot be modified. Also overrides the mode of the buffer (insert or overstrike).
WRITE Default setting. The buffer is saved (written out) on exiting if it has been modified (opposite of READ_ONLY). If a buffer is read-only or unmodifiable, SET BUFFER WRITE makes it modifiable and restores its previous mode (insert or overstrike).

By default, buffer status is set to MODIFIABLE and WRITE, letting you change the contents of a buffer and save the changed buffer in a file.

To change the status of a buffer so that its contents cannot be inadvertently changed, set the buffer to READ_ONLY (which implies unmodifiable) with the following command:


Command: SET BUFFER READ_ONLY

To change the status of a buffer so it becomes a temporary storage area (a "scratchpad"), set the buffer to READ_ONLY and MODIFIABLE with the following commands:


Command: SET BUFFER READ_ONLY
Command: SET BUFFER MODIFIABLE

You then can edit the buffer, but it will not be saved when you exit from EVE.

8.18.4 Displaying the Messages Buffer

EVE uses the message window, which appears at the bottom of the screen, to communicate error and informational messages during an editing session. The message window displays the last message in the Messages buffer.

You can display these messages with the BUFFER command. To display the contents of the Messages buffer, press Do and enter the command BUFFER MESSAGES. To return to the buffer you were editing, press Do and enter the BUFFER command followed by the name of the appropriate buffer.

You can also enter the SHOW BUFFERS command to display the buffers you have created and press the Select key to choose a buffer.

8.18.5 Editing Multiple Buffers

You can use several buffers if you want to edit more than one file or if you want temporary storage areas for manipulating blocks of text. You can use one of the following commands to create a new buffer: GET FILE or OPEN, OPEN SELECTED, or BUFFER.

Using the GET FILE Command

To create a new buffer with a file that already exists, enter the GET FILE (or OPEN) command and the name of the file you want to copy to the new buffer. You can use the asterisk (*) wildcard character as a substitute for all or some of the characters in the file name and file type. You can use the percent sign (%) wildcard character as a substitute for one character in the file name and file type, and you can use the ellipsis ([...]) wildcard as a substitute for a directory specification.

Using the OPEN SELECTED Command

You can also use the OPEN SELECTED command to create a new buffer as follows:

  1. Put the cursor on the name of the file you want to open.
  2. Enter the OPEN SELECTED command.

Using the BUFFER Command

To put a specific buffer into the current EVE window, enter the BUFFER command and the name of the buffer you want to put in the current window. You cannot use wildcard characters in buffer names. The asterisk (*) and percent sign (%) are treated as literal characters in a buffer name. If the buffer you specify does not already exist, EVE creates a new buffer.

If the specified file exists, EVE reads the contents of the file into a new buffer and displays the buffer in the current window. If there is more than one match for a file specification with a wildcard, EVE displays a list of choices in the $CHOICES$ buffer and prompts you to provide a more complete file specification. EVE will open the first file it matches if you use a search list or an ellipsis ([...]) wildcard. Otherwise, EVE creates an empty buffer and displays the buffer in the current window.

To change the buffer in the current window, press the Do key, type BUFFER and the name of the buffer you want to display on the screen, and then press the Return key. If you forget a buffer name, enter the SHOW BUFFERS command to display the names of active buffers in your editing session and specify a buffer with the Select key.

8.18.6 Reading Files into EVE

There are four ways to read a file into an EVE buffer:

8.18.7 Writing Files from EVE

To write the contents of the current buffer to a file, enter the WRITE FILE command. You can include a file specification with the WRITE FILE command. If you do not include a file specification, EVE uses the input file specification to write the file. If you created the current buffer with the BUFFER or NEW command, EVE prompts you for a file specification to which it writes the file.

The following example shows how to use the output file associated with the buffer to write out a buffer:


Command: GET FILE RHYMES.DAT
    . 
    . 
    . 
Command: WRITE FILE
 
3 lines written to WORKDISK:[USER]RHYMES.DAT;2 

8.18.8 Using Windows

During an EVE editing session, the buffer you are editing is displayed on the screen in a window. A highlighted status line appears at the bottom of the window identifying the name, current editing mode, and current direction of the buffer.

EVE lets you view more than one window on your terminal screen at the same time. For example, you can have two windows on the terminal screen to view and edit different sections of the same buffer.

Table 8-16 describes EVE keys used to create and manipulate windows.

Table 8-16 Keys Used with EVE Windows
Key or Key Sequence Function in a Window Environment
GOLD Next Screen Puts the cursor in the next (or other) window. Same as the NEXT WINDOW command. For more information about GOLD key combinations, see Section A.1.8.
GOLD Prev Screen Puts the cursor in the previous (or other) window. Same as the PREVIOUS WINDOW command. For more information about GOLD key combinations, see Section A.1.8.

Table 8-17 describes EVE commands used to create and manipulate windows.

Table 8-17 EVE Window Commands
Command Function in a Window Environment
DELETE WINDOW Deletes the current window, if you are using more than one window.
ENLARGE WINDOW Enlarges the current window by a specified number of lines. For example, ENLARGE WINDOW 5 enlarges the window by five lines. The adjacent window shrinks accordingly.
NEXT WINDOW
or OTHER WINDOW
Puts the cursor in the next (or other) window.
ONE WINDOW Restores the current window as a single, large window. EVE deletes all other windows from the screen. The buffers associated with those windows are not deleted.
PREVIOUS WINDOW Puts the cursor in the previous (or other) window.
SET WIDTH Sets the width of lines displayed on the screen. Specify width as a positive integer. By default, the screen width is your terminal setting (usually 80 columns). If the width is set greater than 80, EVE sets the terminal to 132-column mode for the current editing session. When you exit from EVE, the terminal is restored to the default setting. Setting the width changes the display of text in all windows.
SHIFT LEFT Moves the current window to the left a specified number of columns. You can use the SHIFT LEFT command only to reverse the effect of the SHIFT RIGHT command.
SHIFT RIGHT Moves the current window to the right a specified number of columns, so you can view columns of characters that do not currently appear on the terminal screen.
SHRINK WINDOW Shrinks the current window by a specified number of lines. For example, SHRINK WINDOW 5 shrinks the window by five lines. The adjacent window expands accordingly.
SPLIT WINDOW Splits the current window, forming two smaller windows. You can divide the window into more than two parts by specifying a number with the command. For example, SPLIT WINDOW 3 splits the window into three windows.
TWO WINDOWS Same as the SPLIT WINDOW 2 command.

8.18.9 Viewing Two Sections of One Buffer

To view two sections of a file at the same time, use the SPLIT WINDOW command. EVE splits your screen and creates two identical windows. The cursor maintains its position in the buffer but appears only in the bottom window. The buffer name is the same in both status lines.

Displaying two sections of a long file makes moving text within a file efficient. You can select and remove text from one part of the file and insert it into the other. To move the cursor from one window to the other, enter the NEXT WINDOW command.

To remove the second window from the screen and expand the current window to occupy the whole editing area, press the Do key, enter the command ONE WINDOW, and press the Return key.

8.18.10 Editing Two Buffers

The following procedure describes how to edit two buffers containing different files:
Step Task
1 Create two windows on your screen by entering the SPLIT WINDOW command.

EVE splits your screen and creates two windows. The cursor maintains its position in the buffer but appears only in the bottom window. The buffer name in each of the highlighted status lines is the same.

2 Use the GET FILE, OPEN, or OPEN SELECTED command to put a second file in the current window.

To display a buffer that you created earlier in the editing session in the current window, enter the BUFFER command and the name of the buffer you want to display.

Your terminal screen now displays two different buffers. You can select and remove text from one buffer and insert it into the other buffer. To move the cursor from one window to the other, enter the command NEXT WINDOW.

8.19 Creating a Subprocess

You can create a subprocess to switch between an EVE editing session and DCL command level without terminating your editing session. To create a subprocess, enter the SPAWN command. EVE suspends the current editing session and connects your terminal to a new subprocess. The DCL prompt ($) appears on your terminal screen.

8.19.1 Spawning

The most common reasons to spawn a subprocess are to invoke the Mail utility and to run screen-oriented programs, although your subprocess can invoke any OpenVMS utility or execute any DCL command.

To return to your editing session, log out of the subprocess by entering the DCL command LOGOUT. EVE resumes the editing session, and the cursor appears in the location it occupied before you spawned the subprocess. You can also supply a DCL command as a parameter to the SPAWN command to create a specific subprocess.

In the following example, the Mail utility is spawned from EVE:


[End of file] 
 
 
Buffer: MAIN                           | Write | Insert | Forward 
Command: SPAWN MAIL

The prompt for the Mail utility (MAIL>) appears on the screen. When you exit from Mail, you are automatically logged out of the subprocess and EVE resumes the editing session.


Previous Next Contents Index

[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
[OpenVMS documentation]

Copyright © Compaq Computer Corporation 1998. All rights reserved.

Legal
6489PRO_018.HTML