[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

The following example disables the shift key by making the shift key itself a shifted key:
#2

SET (SHIFT_KEY, KEY_NAME (PF1, SHIFT_KEY)) 
 
      

You can substitute the key name of whatever key is the shift key. This technique works regardless of what key is defined as the shift key. You might want to use such a statement if you are creating an editor that does not support user-defined shift key sequences.


SET (SPECIAL_ERROR_SYMBOL)


Format

SET (SPECIAL_ERROR_SYMBOL, string)


Parameters

SPECIAL_ERROR_SYMBOL

A keyword that specifies that you want to use SET to designate a global variable to be set to 0 when a case-style error handler does not return from a Ctrl/C or other error.

string

The name of the global variable that you want DECTPU to set to 0.

Description

The SET (SPECIAL_ERROR_SYMBOL) procedure designates a global variable to be set to 0 when a case-style error handler does not return from a Ctrl/C or other error. Once you designate the variable that is to be the special error symbol, DECTPU sets the variable to 0 if any of the following events occurs:

You can use SET (SPECIAL_ERROR_SYMBOL) only once in a program. You usually use this built-in during initialization. You must declare or create the variable before you use it in the SET statement. DECTPU does not clear the variable in response to noncase-style error handlers.

You can use the variable specified by SET (SPECIAL_ERROR_SYMBOL) to determine whether DECTPU has exited from current procedures and returned to the main loop to wait for a new keystroke.

Signaled Errors


Example

The following example designates the global variable back_to_main as the variable to be cleared if a procedure or program with a case-style error handler fails to handle a Ctrl/C error or other error:

SET (SPECIAL_ERROR_SYMBOL "back_to_main") 
 
      


SET (STATUS_LINE)


Format

SET (STATUS_LINE, window, , string)


Parameters

STATUS_LINE

The last line in a window. You can use the status line to display regular text or you can use it to display status information about the window.

window

The window whose status line you want to modify.

BLINK

Causes the characters on the status line to blink.

BOLD

Causes the characters on the status line to be bolded.

REVERSE

Causes the characters on the status line to be displayed in reverse video.

SPECIAL_GRAPHICS

Causes the characters on the status line to display graphic characters, such as a solid line. These characters are from the DEC Special Graphics Set (also known as the VT100 Line Drawing Character Set). For more information on the special graphics that are available, see the appropriate programming manual for your terminal.

UNDERLINE

Causes the characters on the status line to be underlined.

NONE

Applies no video attributes to the characters on the status line.

string

A string that is the text to be displayed on the status line. To remove a status line, use a null string ("") for this parameter.

Description

With the SET (STATUS_LINE) procedure, you can set the last line in a window. To have a status line, a window must be at least two lines high. You can establish a status line for a window when you create a window. CREATE_WINDOW requires you to specify whether the status line is ON (used for status information) or OFF (used as a regular text line). When you specify ON, the default status line is displayed in reverse video.

The algorithm for determining whether a window is tall enough to be given a status line depends on whether the window is visible or invisible.

If the window to which you want to add a status line is visible, DECTPU checks the length of the visible portion of the window. A visible window can have an invisible portion if the window is partially occluded by another window. The visible portion of the visible window must have at least one text line; that is, at least one line not occupied by a scroll bar.

If the window is invisible, DECTPU checks the full length of the window. The window must have at least one text line.

If the window that you use as a parameter for SET (STATUS_LINE) already has a status line, either because you specified ON for the status line parameter in the CREATE_WINDOW built-in procedure, or because you used a previous SET (STATUS_LINE) for the window, the video attribute that you specify is added to the video attribute of the existing status line unless you specify NONE. NONE overrides the other video keywords and specifies that there are to be no video attributes for the status line. The string you specify as the last parameter replaces the text of an existing status line. Adding a status line to a window that already has a status line does not cause an error.

If there is no status line for a window, the SET (STATUS_LINE) built-in procedure establishes a status line on the last visible screen line of the window. The status line has the video attribute and the text you specify. Adding a status line reduces the number of screen lines available for text by one line.

To remove a status line, use a null string ("") as the last parameter. The status line is removed even if the window is not two lines high at that time.

The default setting for the status line (ON or OFF) is determined by the CREATE_WINDOW built-in procedure.

If a window has a status line, by default the status line contains the name of the buffer associated with the window and the name of the file associated with the buffer, if there is one.

Signaled Errors

TPU$_TOOFEW ERROR SET (STATUS_LINE) 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, UNDERLINE, or SPECIAL_GRAPHICS.
TPU$_UNKKEYWORD ERROR You specified an unknown keyword.
TPU$_STATOOLONG INFO The status line is truncated to the screen width.
TPU$_BADWINDLEN ERROR The window must be at least two lines long.

Examples

The following example displays the status line in my_window in reverse video with the buffer specified as MAIN BUFFER and the file specified as NEWFILE.TXT:
#1

SET (STATUS_LINE, my_window, REVERSE, "MAIN BUFFER, newfile.txt"); 
 
      

The following example creates a window with a status line displayed in special graphics rendition. Because the glyph (member of the DEC Multinational Character Set occupying one column width) having the same value as the character q is a full-width line, the status line appears as a solid line across the screen.

#2

line_text := "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq" + 
     "qqqqqqqqqqqqqqqqqqqqq"; 
line_window := CREATE_WINDOW (1, 20, OFF); 
MAP (line_window, current_buffer); 
SET (STATUS_LINE, line_window, SPECIAL_GRAPHICS, line_text); 
 
      


SET (SUCCESS)


Format

SET (SUCCESS, )


Parameters

SUCCESS

Controls whether DECTPU writes success messages to the message buffer.

ON, 1

Causes the success messages to be written.

OFF, 0

Suppresses the display of success messages.

Description

With the SET (SUCCESS) procedure, you can suppress the display of success messages. By default, DECTPU writes success messages to the message buffer.

See Appendix B for a table of the DECTPU messages and their severity levels.

Signaled Errors

TPU$_TOOFEW ERROR SET (SUCCESS) 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 turns off the display of success messages:

SET (SUCCESS, OFF) 
 
      


SET (SYSTEM)


Format

SET (SYSTEM, buffer)


Parameters

SYSTEM

The status of a buffer. SYSTEM means that it is a system buffer rather than a user buffer.

By default, newly created buffers are user buffers.

buffer

The buffer that is being set as a system buffer.

Description

With the SET (SYSTEM) procedure, programmers who are building an editing interface can distinguish their system buffers from user-created buffers. Once you make a buffer a system buffer, you cannot reset the buffer to be a user buffer. DECTPU does not handle system buffers differently from user buffers. Any distinction between the two kinds of buffers must be implemented by the application programmer.

Signaled Errors

TPU$_TOOFEW ERROR SET (SYSTEM) 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 makes the message buffer a system buffer:

SET (SYSTEM, message_buffer) 
 
      


SET (TAB_STOPS)


Format

SET (TAB_STOPS, buffer, )


Parameters

TAB_STOPS

A keyword that indicates that SET is to control placement of tab stops in a buffer.

buffer

The buffer in which the tab stops are being set.

integer

An integer that specifies the interval between tab stops, measured in column widths. The minimum value for the integer is 1. The maximum value is 65535.

string

A string of numbers that specifies the tab stops. The string represents column numbers at which the tab stops are placed. The minimum value for a tab stop is 1. The maximum value is 65535. The maximum number of tab stops that you can include in the string is 100. The quoted string must list tab stops in ascending order, separating values with a single space (for example, "3 6 9 12").

Description

With the SET (TAB_STOPS) procedure, you can set the tab stops at positions you specify or to establish equal intervals other than the default eight. When a buffer is created, the tabs are set at every eight columns, unless, when the buffer is created, a template buffer with different tab settings is specified.

Tab stops are not saved when you write a file. When you create a buffer, the tabs are set to the default unless, when you create the buffer, you specify a template buffer with different tab settings. For information on creating buffers, see the CREATE_BUFFER procedure.

SET (TAB_STOPS) does not affect the hardware tab settings of your terminal. On any terminals or printers that have tab settings different from those you specify with this built-in, the file does not appear the same as it does when viewed using DECTPU. In addition, if you invoke DECTPU with the /NODISPLAY qualifier, any values you enter for SET (TAB_STOPS) are ignored, and a SHOW (BUFFER) command will show no tab stops for the buffer.

Signaled Errors

TPU$_TOOFEW ERROR SET (TAB_STOPS) requires at least 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$_UNKKEYWORD ERROR You specified an unknown keyword.
TPU$_ARGMISMATCH ERROR The third parameter must be a string or an integer.
TPU$_INVTABSPEC WARNING You specified a bad third argument.

Examples

The following example causes the tab stops in the current buffer to be set at intervals of four columns:
#1

SET (TAB_STOPS, CURRENT_BUFFER, 4); 
 
      

The following example causes the tab stops in the current buffer to be set at 4, 8, 12, and 16 columns:

#2

SET (TAB_STOPS, CURRENT_BUFFER, "4 8 12 16"); 
 
      


SET (TEXT)


Format

SET (TEXT, )


Parameters

TEXT

A keyword that indicates that SET is to control the way text is displayed in a window or to determine the text that is to appear in a widget.

widget

The widget whose text you want to set. SET (TEXT, widget, string) is equivalent to the Toolkit routine S TEXT SET STRING.

You can use widget as the second parameter only if you are using DECwindows DECTPU.

string

The text you want to assign to the simple text widget.

window

The window in which the mode of display is being set.

BLANK_TABS

Displays tabs as blank spaces. This is the default keyword.

GRAPHIC_TABS

Displays tabs as special graphic characters so that the width of each tab is visible.

NO_TRANSLATE

Sends every keystroke from the keyboard to the terminal without any translation. In this mode, the terminal settings, not DECTPU, determine the effect of characters typed from the keyboard.

Digital recommends that you use this mode for sending directives to the terminal but not for editing. DECTPU does not manage margins or window shifts while NO_TRANSLATE mode is enabled. Furthermore, DECTPU does not necessarily update lines of text in the order in which they appear while NO_TRANSLATE mode is enabled.

To send escape sequences from within a DECTPU procedure, you can use SET (TEXT) with the NO_TRANSLATE keyword followed by statements that use the MESSAGE and UPDATE built-in procedures.

For more information on the effect of using various characters and sequences in NO_TRANSLATE mode, see your terminal manual.


Description

With the SET (TEXT) procedure, you control the way text is displayed in a window or determine the text that is to appear in a widget.

Signaled Errors

TPU$_BADKEY WARNING You specified an invalid keyword as a parameter.
TPU$_INVPARAM ERROR One of the parameters was specified with data of the wrong type.
TPU$_NORETURNVALUE ERROR SET (TEXT) cannot return a value.
TPU$_REQUIRESDECW ERROR You have specified widget as the second parameter to SET (TEXT) while using non-DECwindows DECTPU.
TPU$_TOOFEW ERROR Too few arguments passed to the SET (TEXT) built-in.
TPU$_TOOMANY ERROR Too many arguments passed to the SET (TEXT) built-in.
TPU$_WIDMISMATCH ERROR The specified widget is not of class SText.
TPU$_UNKKEYWORD ERROR You specified an unknown keyword.

Examples

In the following example, assuming that the variable user_text_widget has been assigned a text widget, this statement causes the widget to display the text No default string available:
#1

SET (TEXT, user_text_widget, "No default string available."); 
 
      

The following example shows one possible way that a layered application can use the SET (TEXT) widget. The variable eve$x_target stores the string (if one exists) that you specified as the wildcard search string the last time you invoked the wildcard find dialog box. The SET (TEXT) statement directs EVE's wildcard find dialog box widget to display the string assigned to eve$x_target.

#2

wildcard_dialog_box := GET_INFO (WIDGET, "widget_id", 
                          eve$x_wildcard_find_dialog, 
                          "WILDCARD_FIND_DIALOG.WILDCARD_FIND_TEXT"); 
 
status := SET (TEXT, wildcard_dialog_box, eve$x_target); 
       
      


SET (TIMER)


Format

SET (TIMER, [[, string ]])


Parameters

TIMER

Controls the displaying of timed messages in the prompt area.

ON, 1

Causes the message that you specify to be written to the prompt area and displayed at 1-second intervals. By default, the display of the timed message is turned off.

OFF, 0

Turns off the display of timed messages in the prompt area.

string

A string that is displayed in the prompt area. The maximum length of the message is 15 characters. If you specify a string longer than 15 characters, DECTPU truncates the string but does not signal an error. The message is displayed in the last 15 character positions of the prompt area. If ON is specified and a string was never specified for the last argument, the timer puts out the message "working." If ON is specified and a string was specified previously, the saved string is used as the default.

Description

When the SET (TIMER) procedure is set to ON, the timer puts out messages at 1-second intervals while you are executing procedures or editing actions that are bound to a key. The message is written out to the prompt area and then erased to clear the prompt area for the next message. The first display of the timed message does not occur until 3 seconds after you press the key. This eliminates unnecessary timed messages during short editing transactions.

Signaled Errors

TPU$_TOOFEW ERROR SET (TIMER) 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$_BADKEY ERROR The keyword must be ON or OFF.
TPU$_UNKKEYWORD ERROR You specified an unknown keyword.

Example

The following example causes the message "Executing" to be written to the prompt area at 1-second intervals while you are executing a DECTPU procedure:

SET (TIMER, ON, "Executing") 
 
      


SET (TRACEBACK)


Format

SET (TRACEBACK, )


Parameters

TRACEBACK

Determines whether DECTPU displays the sequence of procedures called after an error occurs.

ON, 1

Causes DECTPU to display the procedure calling sequence after an error occurs.

OFF, 0

Prevents DECTPU from displaying the procedure calling sequence after an error occurs.

Description

With the SET (TRACEBACK) procedure, you can determine whether DECTPU provides information on the context in which an error occurs. Turning on the traceback setting can be helpful to a programmer debugging a DECTPU program. The traceback setting is usually turned off during normal editing because end users of editors do not often use the traceback information.

The default setting for TRACEBACK depends on whether a section file was loaded by DECTPU. If a section file was loaded, the default is OFF. If a section file was not loaded, the default is ON.

SET (TRACEBACK) is related to SET (LINE_NUMBER). SET (TRACEBACK, ON) turns on both traceback and line numbers because both are needed for debugging. SET (LINE_NUMBER, OFF) turns off both traceback and line numbers because one feature is not useful without the other.

Allowable settings are as follows:

Signaled Errors

TPU$_TOOFEW ERROR The SET (TRACEBACK) 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 prevents DECTPU from displaying the procedure calling sequence after an error occurs:
#1

SET (TRACEBACK, OFF) 
 
      


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_034.HTML