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

DEC Text Processing Utility Reference Manual


Previous Contents Index


SET (OUTPUT_FILE)


Format

SET (OUTPUT_FILE, buffer, string)


Parameters

OUTPUT_FILE

A keyword that indicates that SET is to control creation of an output file for the contents of a buffer after execution of a QUIT or EXIT statement.

buffer

The buffer whose contents are written to the specified file.

string

The file specification for the file being written out. The default output file is the input file name and the highest existing version number for that file plus 1.

Description

The SET (OUTPUT_FILE) procedure specifies a file to be written out for the contents of the buffer. DECTPU does not write out the contents of a buffer after execution of a QUIT or EXIT statement if the buffer has not been modified.

If a buffer is set to NO_WRITE, a file is not written out after execution of a QUIT or EXIT statement even though you specified a file specification for the contents of the buffer with SET (OUTPUT_FILE).

Signaled Errors

TPU$_TOOFEW ERROR SET (OUTPUT_FILE) requires three parameters.
TPU$_TOOMANY ERROR You specified more than three parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_BADKEY ERROR You specified an invalid keyword.

Example

The following example causes the output file for paste_buffer to be NEWFILE.TXT:

SET (OUTPUT_FILE, paste_buffer, "NEWFILE.TXT") 
 
      


SET (OVERSTRIKE)


Format

SET (OVERSTRIKE, buffer)


Parameters

OVERSTRIKE

A keyword that specifies that SET is to control the mode of text entry. OVERSTRIKE means that the characters that you add to the buffer replace the characters in the buffer starting at the editing point and continuing for the length of the text that you enter. The default mode of text entry is INSERT.

See also the description of the SET (INSERT) built-in procedure. For information on how to control overstrike behavior in tabs, see SET (PAD_OVERSTRUCK_TABS).

buffer

The buffer whose mode of text entry you want to set.

Description

The SET (OVERSTRIKE) procedure sets the mode of text entry to OVERSTRIKE.

Signaled Errors

TPU$_TOOFEW ERROR SET (OVERSTRIKE) requires two parameters.
TPU$_TOOMANY ERROR You specified more than two parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_BADKEY ERROR You specified an invalid keyword.

Example

The following example sets the mode for text entry in my_buffer to overstrike. Characters that you enter replace characters already in the buffer, starting at the editing point and continuing for the length of the text that you enter.

SET (OVERSTRIKE, my_buffer) 
 
      


SET (PAD)


Format

SET (PAD, window, )


Parameters

PAD

A keyword that indicates that SET is to control whether screen lines are padded with blanks. This keyword determines whether SET pads out the left and right ends of lines beyond the text on the line. When video attributes are applied to a padded window, the window has an even or "boxed" appearance.

window

The window in which lines are padded.

ON, 1

Causes DECTPU to display blanks after the last character of a record so that the screen line extends to the right side of the window. If there are not enough lines in a buffer to fill an entire window, DECTPU displays blank lines (according to the video setting of the window) from the end-of-buffer line to the end of the window.

OFF, 0

Causes the display of lines on the screen to stop at the last character of a record. When video attributes are applied to the window, the window has a ragged appearance on the sides.

Description

The SET (PAD) procedure pads the number of display lines on the screen. By default, DECTPU ends a line on the screen at the end of a record, without adding padding blanks. The default behavior of not padding the screen gives maximum editing performance. You can change the default with SET (PAD) for special visual effects. The records in the buffer are not padded; only the display lines have the padding.

Signaled Errors

TPU$_TOOFEW ERROR SET (PAD) requires three parameters.
TPU$_TOOMANY ERROR You specified more than three parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_BADKEY ERROR The keyword must be ON or OFF.
TPU$_UNKKEYWORD ERROR You specified an unknown keyword.

Example

In the following example, the first statement causes second_window to be padded with blanks. The second statement causes second_window to be displayed in reverse video. The window has an even right and left margin when displayed.

SET (PAD, second_window, ON); 
SET (VIDEO, second_window, REVERSE); 
 
      


SET (PAD_OVERSTRUCK_TABS)


Format

SET (PAD_OVERSTRUCK_TABS, )


Parameters

PAD_OVERSTRUCK_TABS

Determines what happens when you overstrike a tab and when you overstrike with a tab.

ON, 1

SET PAD_OVERSTRUCK_TABS ON functions differently depending on whether you are overstriking a tab character with another character or overstriking another character with a tab character.

OFF, 0

SET PAD_OVERSTRUCK_TABS OFF functions differently depending on whether you are overstriking a tab character with another character or overstriking another character with a tab character.

Description

The SET (PAD_OVERSTRUCK_TABS) procedure controls how DECTPU handles tabs in overstrike mode. When earlier versions of DECTPU overstruck a tab, DECTPU inserted spaces, if necessary, to preserve the cursor position within the tab, and then replaced the tab with the character that was being entered. This behavior is preserved when PAD_OVERSTRUCK_TABS is set OFF.

When PAD_OVERSTRUCK_TABS is set ON, DECTPU inserts spaces as necessary to preserve the cursor position within the tab of the first character of the text, and then inserts the text. The tab is replaced only when it occupies a single column.

When SET (PAD_OVERSTRUCK_TABS) is set to ON and you overstrike a tab, DECTPU does the following:

When SET (PAD_OVERSTRUCK_TABS) is set to ON and you overstrike with a tab, DECTPU replaces multiple characters. The characters to the right of the tab do not move their column position. They are overstruck.

When SET (PAD_OVERSTRUCK_TABS) is set to OFF and you overstrike a tab, DECTPU does the following:

When SET (PAD_OVERSTRUCK_TABS) is set to OFF and you overstrike with a tab, the characters in the text get replaced by the tab character. This may move characters to the right on the screen.

Signaled Errors

TPU$_TOOFEW ERROR The SET (PAD_OVERSTRUCK_TABS) built-in requires two parameters.
TPU$_TOOMANY ERROR You specified more than two parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_BADKEY WARNING Only ON and OFF are allowed.

Examples

The following example shows what happens when PAD_OVERSTRUCK_TABS is set to OFF. In this example, a right angle (>) represents the tab, a period (.) represents one column of white space, and an underscore (_) represents the cursor.

Suppose a buffer contains the following text, with the cursor in the middle of white space created by a tab:


abc>....def 

If you insert the asterisk (*) while PAD_OVERSTRUCK_TABS is set to OFF, the white space to the left of the * is preserved. The tab character is removed, and the white space to the right of the * is not preserved. The text to the right of the collapsed white space moves leftward. The result is as follows:


abc..*def 

The cursor is on the d. Given the same initial text, if you type the string "xyzzy" while PAD_OVERSTRUCK_TABS is set to OFF, the tab is removed. The text to the right of the tab moves to the left. Your new string, xyzzy, is written over the old text. The result is as follows:


abc..xyzzy

When PAD_OVERSTRUCK_TABS is set to ON, the text to the right of the tab does not move to the left when text is inserted within the tab. Instead of removing the tab, DECTPU places the tab to the right of the inserted text if the inserted text is shorter than the length of the tab. The newly placed tab creates only enough white space to preserve the original column position of the text to the right of the tab.

The following example shows what happens when PAD_OVERSTRUCK_TABS is set to ON. In this example, a right angle (>) represents the tab, a period (.) represents one column of white space, and an underscore (_) represents the cursor.

Suppose a buffer contains the following text, with the cursor in the middle of white space created by a tab:


abc>....def 

If you insert an asterisk (*) while PAD_OVERSTRUCK_TABS is set to ON, the white space to the left of the * is preserved. The tab is inserted after the * character. The result is as follows:


abc..*>.def 

Given the same initial text, if you insert the string "xyzzy" while PAD_OVERSTRUCK_TABS is set to ON, to preserve the original position of the text to the right of the tab, DECTPU fills the white space created by the tab with characters from the new string. When the white space is filled, DECTPU writes the new characters over the old characters. Thus, the old text does not move left or right, but rather is overwritten by the new text. The result is as follows:


abc..xyzzyf 


SET (PERMANENT)


Format

SET (PERMANENT, buffer)


Parameters

PERMANENT

Specifies that a buffer cannot be deleted. By default, buffers can be deleted; they are not permanent.

buffer

The buffer that is not to be deleted.

Description

With the SET (PERMANENT) procedure, you can make a buffer permanent. Once you use SET (PERMANENT), you cannot reset the buffer so that it can be deleted.

Signaled Errors

TPU$_TOOFEW ERROR SET (PERMANENT) requires two parameters.
TPU$_TOOMANY ERROR You specified more than two parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_BADKEY ERROR You specified an invalid keyword.

Example

The following example causes master_buffer to become a permanent buffer:

SET (PERMANENT, master_buffer) 
 
      


SET (POST_KEY_PROCEDURE)


Format

SET (POST_KEY_PROCEDURE, string1 )


Parameters

POST_KEY_PROCEDURE

The action taken after the code or learn sequence bound to a key is executed.

string1

A quoted string, or a variable name representing a string constant, that specifies the key map list for which this procedure is called.

buffer

The buffer that contains DECTPU statements specifying the action to be taken after the code or learn sequence bound to a key is executed. SET (POST_KEY_PROCEDURE) compiles the statements in the buffer and stores the resulting program in the specified key map list.

learn_sequence

The learn sequence that specifies the action to be taken after the code or learn sequence bound to a key is executed. The contents of a variable of type learn do not require compilation. SET (POST_KEY_PROCEDURE) stores the learn sequence in the specified key map list.

program

The program that specifies the action to be taken after the code or learn sequence bound to a key is executed. The contents of a variable of type program do not require compilation. SET (POST_KEY_PROCEDURE) stores the program in the specified key map list.

range

The range that contains DECTPU statements specifying the action to be taken after the code or learn sequence bound to a key is executed. SET (POST_KEY_PROCEDURE) compiles the statements in the range and stores the resulting program in the specified key map list.

string2

The string that contains DECTPU statements specifying the action to be taken after the code or learn sequence bound to a key is executed. SET (POST_KEY_PROCEDURE) compiles the statements in the string and stores the resulting program in the specified key map list.

Description

The SET (POST_KEY_PROCEDURE) procedure enables an editor to perform some specified action before and after execution of code bound to a key. If you do not specify the third parameter, the postkey procedure for the specified key map list is deleted.

Prekey and postkey procedures interact with learn sequences in the following order:

  1. When you press the key or key sequence to which the learn sequence is bound, DECTPU executes the prekey procedure of that key if a prekey procedure has been set.
  2. For each key in the learn sequence, DECTPU executes procedures or programs in the following order:
    1. DECTPU executes the prekey procedure of that key if a prekey procedure has been set.
    2. DECTPU executes the code bound to the key itself.
    3. DECTPU executes the postkey procedure of that key if a postkey procedure has been set.
  3. When all keys in the learn sequence have been processed, DECTPU executes the postkey procedure, if one has been set, for the key to which the entire learn sequence was bound.

You can use the following calls to the GET_INFO built-in procedure to find the prekey and postkey procedures bound to a key map list:


GET_INFO (key_map_list_name, "pre_key_procedure") 
GET_INFO (key_map_list_name, "post_key_procedure") 

By default, newly created key map lists do not have postkey procedures.

Signaled Errors

TPU$_TOOFEW ERROR The SET (POST_KEY_PROCEDURE) built-in requires at least two parameters.
TPU$_TOOMANY ERROR You specified more than three parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_COMPILEFAIL ERROR Compilation aborted because of syntax errors.
TPU$_NOKEYMAPLIST WARNING Attempt to access an undefined key map list.

Example

The following example displays a message after the code bound to a key is executed:

SET (POST_KEY_PROCEDURE, "tpu$key_map_list", 
         'MESSAGE ("Key " + GET_INFO (LAST_KEY, "name") + " Executed")'); 
 
 
      


SET (PRE_KEY_PROCEDURE)


Format

SET (PRE_KEY_PROCEDURE, string1 )


Parameters

PRE_KEY_PROCEDURE

The action taken before the code or learn sequence bound to a key is executed.

string1

A quoted string, or a variable name representing a string constant, that specifies the key map list for which this procedure is called.

buffer

The buffer that contains DECTPU statements specifying the action to be taken before the code or learn sequence bound to a key is executed. SET (PRE_KEY_PROCEDURE) compiles the statements in the buffer and stores the resulting program in the specified key map list.

learn_sequence

The learn sequence that specifies the action to be taken before the code or learn sequence bound to a key is executed. The contents of a variable of type learn do not require compilation. SET (PRE_KEY_PROCEDURE) stores the learn sequence in the specified key map list.

program

The program that specifies the action to be taken before the code or learn sequence bound to a key is executed. The contents of a variable of type program do not require compilation. SET (PRE_KEY_PROCEDURE) stores the program in the specified key map list.

range

The range that contains DECTPU statements specifying the action to be taken before the code or learn sequence bound to a key is executed. SET (PRE_KEY_PROCEDURE) compiles the statements in the range and stores the resulting program in the specified key map list.

string2

The string that contains DECTPU statements specifying the action to be taken before the code or learn sequence bound to a key is executed. SET (PRE_KEY_PROCEDURE) compiles the statements in the string and stores the resulting program in the specified key map list.

Description

The SET (PRE_KEY_PROCEDURE) procedure enables an editor to perform some specified action before the execution of code bound to a key. If you do not specify the third parameter, the prekey procedure for the specified key map list is deleted.

Prekey and postkey procedures interact with learn sequences in the following order:

  1. When you press the key or key sequence to which the learn sequence is bound, DECTPU executes the prekey procedure of that key if a prekey procedure has been set.
  2. For each key in the learn sequence, DECTPU executes procedures or programs in the following order:
    1. DECTPU executes the prekey procedure of that key if a prekey procedure has been set.
    2. DECTPU executes the code bound to the key itself.
    3. DECTPU executes the postkey procedure of that key if a postkey procedure has been set.
  3. When all keys in the learn sequence have been processed, DECTPU executes the postkey procedure, if one has been set, for the key to which the entire learn sequence was bound.

You can use the following calls to the GET_INFO built-in procedure to find the prekey and postkey procedures bound to a key map list:


GET_INFO (key_map_list_name, "pre_key_procedure"); 
GET_INFO (key_map_list_name, "post_key_procedure"); 

By default, newly created key map lists do not have prekey procedures.

Signaled Errors

TPU$_TOOFEW ERROR The SET (PRE_KEY_PROCEDURE) built-in requires at least two parameters.
TPU$_TOOMANY ERROR You specified more than three parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_COMPILEFAIL ERROR Compilation aborted because of syntax errors.
TPU$_NOKEYMAPLIST WARNING Attempt to access an undefined key map list.

Example

The following example displays a message before the code bound to a key is executed:

SET (PRE_KEY_PROCEDURE, "tpu$key_map_list", 
         'MESSAGE ("Working...")'); 
 
      


SET (PROMPT_AREA)


Format

SET (PROMPT_AREA, integer1, integer2, )


Parameters

PROMPT_AREA

An area on the screen in which the prompts generated by the built-in procedure READ_LINE are displayed. By default, there is no prompt area.

integer1

The screen line number at which the prompt area starts.

integer2

The number of screen lines in the prompt area.

NONE

Applies no video attributes to the characters in the prompt area.

BOLD

Causes the characters in the prompt area to be bolded.

BLINK

Causes the characters in the prompt area to blink.

REVERSE

Causes the characters in the prompt area to be displayed in reverse video.

UNDERLINE

Causes the characters in the prompt area to be underlined.

Description

The SET (PROMPT_AREA) procedure sets an area on the screen where prompts generated by the READ_LINE procedure are displayed. Except in Motif DECwindows, if the prompt area overlaps a line of a window that is visible on the screen, the line is erased when the READ_LINE is executed. When the execution of READ_LINE is completed, the line is restored. If the prompt area does not overlap any windows, the prompt area continues to display the READ_LINE prompt and your input until new information is sent to the prompt area.

If you have a multiple-line prompt area and your terminal has hardware scrolling capabilities, the first prompt appears on the last line of the prompt area. As subsequent prompts are issued, the previous prompts scroll up to make room for new ones. If there are more prompts than there are prompt-area lines, the extra prompts are scrolled out of the window.

If your terminal does not have hardware scrolling capabilities, prompts are displayed starting at the first line in the prompt area. When the prompt area is filled, display starts again at the first line in the prompt area.

Signaled Errors

TPU$_TOOFEW ERROR SET (PROMPT_AREA) requires four parameters.
TPU$_TOOMANY ERROR You specified more than four parameters.
TPU$_INVPARAM ERROR One or more of the specified parameters have the wrong type.
TPU$_BADKEY ERROR The keyword must be NONE, BOLD, BLINK, REVERSE, or UNDERLINE.
TPU$_UNKKEYWORD ERROR You specified an unknown keyword.
TPU$_BADFIRSTLINE WARNING Prompt area must not start off screen or be less than one line long.
TPU$_BADPROMPTLEN WARNING Prompt area must not extend off screen.

Example

The following example causes the prompt area to be screen line number 24. It is one line and is displayed in reverse video.

SET (PROMPT_AREA, 24, 1, REVERSE) 
 
      


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
6020PRO_031.HTML