Document revision date: 30 March 2001
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

DEC Text Processing Utility Reference Manual


Previous Contents Index


SET (PAD)


Format

SET (PAD, window, {ON |OFF |1 |0})


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, {ON |OFF |1 |0})


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 [[{, buffer |, learn_sequence |, program |, range |, string2}]])


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 [[{, buffer |, learn_sequence |, program |, range |, string2}]])


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, {NONE |BOLD |BLINK |REVERSE |UNDERLINE})


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) 
 
      


SET (RECORD_ATTRIBUTE)


Format

SET (RECORD_ATTRIBUTE, {buffer |marker |range}, {DISPLAY_VALUE |LEFT_MARGIN}, {display_setting_integer |margin_setting_integer})



or
SET (RECORD_ATTRIBUTE, {buffer, |marker, |range,}MODIFIABLE, {ON |OFF |1 |0})


Parameters

RECORD_ATTRIBUTE

A keyword that indicates that the SET built-in procedure is being used to specify or change a record attribute.

buffer

The buffer that contains the records for which you want to set an attribute. The record attribute is applied to all records in the buffer.

marker

The marker that indicates the record whose attribute you want to set.

range

The range that contains the records whose attribute you want to set. The record attribute is applied to all records in the range. Records that are partially within the range will be modified.

DISPLAY_VALUE

A keyword that indicates that you want to affect the visibility of the records. If you specify the DISPLAY_VALUE keyword as the third parameter, you must specify for the fourth parameter an integer that provides a display setting.

LEFT_MARGIN

A keyword that indicates that you want to specify the left margin for the specified records. If you specify the LEFT_MARGIN keyword as the third parameter, you must specify for the fourth parameter an integer that provides a left margin value.

display_setting_integer

An integer value from --127 to +127. This is the display setting. To determine whether a record is to be visible or invisible in a given window, DECTPU compares the record's display setting to the window's display setting. (A window's display setting is specified with SET (DISPLAY_VALUE).) If the record's setting is greater than or equal to the window's setting, DECTPU makes the record visible in that window; otherwise, DECTPU makes the record invisible.

margin_setting_integer

An integer that is the column at which the left margin should be set. The value must be between 1 and the value of the right margin minus 1. (The maximum valid value for the right margin is 32767.)

MODIFIABLE

A keyword that indicates that you want to determine whether the specified records are modifiable. If you specify the MODIFIABLE keyword as the third parameter, you must specify either ON or OFF as the fourth parameter.

ON, 1

Makes records modifiable. If a buffer is modifiable, you can use SET (RECORD_ATTRIBUTE) to make a record in the buffer unmodifiable (with OFF keyword). If a buffer is unmodifiable and you use SET (RECORD_ATTRIBUTE) to make a record in the buffer modifiable (with ON keyword), DECTPU marks the record as modifiable but does not allow modifications to the record until the buffer is made modifiable.

OFF, 0

Makes records unmodifiable.

Description

The SET (RECORD_ATTRIBUTE) procedure sets or alters any of three possible attributes for the specified record or records. The attributes you can set for a record are its left margin, its modifiability, and its visibility. With each call to SET (RECORD_ATTRIBUTE), you can set only one attribute. For example, you cannot change visibility and modifiability by using just one call. To set more than one record attribute, use multiple calls to SET (RECORD_ATTRIBUTE).


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