[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 (RECORD_ATTRIBUTE)


Format

SET (RECORD_ATTRIBUTE, , , )



or

SET (RECORD_ATTRIBUTE, MODIFIABLE, )


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).

When you set an attribute for multiple records, each record gets the same value. For example, if you specify a range of records and a value for the left margin attribute, all records in the range receive the same left margin value.

You cannot change the left margin of an unmodifiable record. You can change the display value of a record at any time.

Signaled Errors


Examples

The following example uses statements that change buffer modifiability and record modifiability independently. You can turn on the modifiability of a record or range of records even when the buffer's modifiability is turned off.
#1

SET (MODIFIABLE, buf1, OFF); 
r1:= CREATE_RANGE (BEGINNING_OF(buf1), END_OF(buf1), REVERSE); 
SET (RECORD_ATTRIBUTE, r1, MODIFIABLE, OFF); 
SET (RECORD_ATTRIBUTE, r1, MODIFIABLE, ON); 
SET (MODIFIABLE, buf1, ON); 
 
      

The following example makes the records in the range select_range invisible in the current window:

#2

SET (DISPLAY_VALUE, CURRENT_WINDOW, 0); 
SET (RECORD_ATTRIBUTE, SELECT_RANGE, DISPLAY_VALUE, -1);           
 
      


SET (RECORD_MODE)


Format

[keyword1 :=] SET (RECORD_MODE), , keyword2


Parameters

buffer

The buffer whose output record mode should be changed.

SYSTEM

A keyword that indicates that all new buffers created with no input file have the new record mode.

keyword2

The keyword that specifies the new record mode. It can be any of the following:
Keyword2 Record Format Record Attributes
VARIABLE_NONE fab$c_var 0
VARIABLE_FTN fab$c_var fab$m_ftn
VARIABLE_CR fab$c_var fab$m_cr
STREAM fab$c_stm fab$m_cr
STREAM_CR fab$c_stmcr fab$m_cr
SYSTEM_DEFAULT fab$c_var fab$m_cr
SYSTEM_DEFAULT fab$c_stmlf fab$m_cr
UNSPECIFIED Use the record mode of the input file if supported; otherwise use the current system default. Valid only for buffers.

Return Value


Optionally returns a keyword for the previous record mode setting or the UNSPECIFIED keyword, if none.

Description

The SET (RECORD_MODE) procedure sets the record mode for a buffer or for all new buffers created without an associated input file. Record mode specifies the record format and record attributes for files written from the buffer.

This built-in does not affect journal files, work files, or section files. A buffer created with no input file gets the current system default record mode. A buffer created with an input file gets the record mode from the input file if it is supported. If not supported, the buffer's record mode is left unspecified, and the output file takes the input file record mode.

Record modes are specific to file systems. Setting the record mode to a value not supported by your file system may result in your buffer being written to the disk in an unusable format.

Signaled Errors


Examples

The following example sets the record mode of buffer my_buffer to STREAM_LF. Writing my_buffer to a file creates a file with STREAM_LF record format and carriage return record attributes.
#1

SET (RECORD_MODE, my_buffer, STREAM_LF); 
 
      

The following example sets the default record mode for all new buffers created with no input file. Files written from these buffers will have variable length record format and carriage return record attributes.

#2

SET (RECORD_MODE, SYSTEM, VARIABLE_CR); 
      


SET (RESIZE_ACTION)


Format

SET (RESIZE_ACTION )


Parameters

RESIZE_ACTION

A keyword that directs DECTPU to set an attribute related to a resize action routine.

buffer

The buffer that specifies the actions that DECTPU should take whenever it is notified of a resize event.

learn_sequence

The learn sequence that specifies the actions that DECTPU should take whenever it is notified of a resize event.

program

The program that specifies the actions that DECTPU should take whenever it is notified of a resize event.

range

The range that specifies the actions that DECTPU should take whenever it is notified of a resize event.

string

The string that specifies the actions that DECTPU should take whenever it is notified of a resize event.

NONE

A keyword that directs DECTPU to delete the resize action routine. If you specify this keyword or do not specify the parameter at all, the application is not notified when a resize event occurs.

Description

The SET (RESIZE_ACTION) procedure specifies code to be executed when a resize event has occurred. Specifying a resize action routine overrides any previous resize action routines that have been defined.

Signaled Errors


Example

The following example specifies the procedure EVE$$RESIZE_ACTION as the resize routine. To see this statement used in an initializing procedure, see the example in the description of the SET (SCREEN_LIMITS) built-in procedure.

SET (RESIZE_ACTION, "eve$$resize_action"); 
 
      


SET (REVERSE)


Format

SET (REVERSE, buffer)


Parameters

REVERSE

The direction of the buffer. REVERSE means to go toward the beginning of the buffer. The default direction for a buffer is forward.

buffer

The buffer whose direction you want to set.

Description

Interfaces use the SET (REVERSE) procedure to keep track of direction for searching or movement.

Signaled Errors


Example

The following example causes the direction of the buffer to be toward the beginning of the buffer:

SET (REVERSE, my_buffer) 
 
      


SET (RIGHT_MARGIN)


Format

SET (RIGHT_MARGIN, buffer, integer)


Parameters

RIGHT_MARGIN

The right margin of a buffer.

buffer

The buffer in which the right margin is being set.

integer

The column at which the right margin is set.

Description

With the SET (RIGHT_MARGIN) procedure, you can change only the right margin of a buffer.

Newly created buffers receive a right margin of 80 if a template buffer is not specified on the call to the CREATE_BUFFER built-in procedure. If a template buffer is specified, the right margin of the template buffer is used.

Use SET (RIGHT_MARGIN) to override the default right margin.

The buffer margin settings are independent of the terminal width or window width settings. The FILL built-in procedure uses these margin settings when it fills the text of a buffer.

The SET (RIGHT_MARGIN) built-in procedure controls the buffer margin setting even if the terminal width or window width is set to something else.

The value of the right margin must be less than the maximum record size for the buffer and greater than the left margin value. You can use the GET_INFO (buffer, "record_size") built-in procedure to find out the maximum record size of a buffer.

If you want to use the margin settings of an existing buffer, in a user-written procedure, the statements GET_INFO (buffer, "left_margin") and GET_INFO (buffer, "right_margin") return the values of the margin settings in the specified buffer.

Signaled Errors


Examples

The following example causes the right margin of the buffer represented by the variable my_buffer to be changed. The right margin of the buffer is set to 132. The left margin is unchanged.
#1

SET (RIGHT_MARGIN, my_buffer, 132) 
 
      

The following example causes the right margin of the current buffer to be changed to 70. The left margin is unchanged.

#2

SET (RIGHT_MARGIN, CURRENT_BUFFER, 70) 
 
      


SET (RIGHT_MARGIN_ACTION)


Format

SET (RIGHT_MARGIN_ACTION, buffer1 )


Parameters

RIGHT_MARGIN_ACTION

Refers to the action taken when you press a self-inserting key while the cursor is to the right of a buffer's right margin. A self-inserting key is one that is associated with a printable character.

buffer1

The buffer in which the right margin action routine is being set.

buffer2

A buffer that contains the DECTPU statements to be executed when you press a self-inserting key while the cursor is to the right of a buffer's right margin.

learn_sequence

A learn sequence that is to be replayed when you press a self-inserting key while the cursor is to the right of a buffer's right margin.

program

A program that is to be executed when you press a self-inserting key while the cursor is to the right of a buffer's right margin.

range

A range that contains DECTPU statements that are to be executed when you press a self-inserting key while the cursor is to the right of a buffer's right margin.

string

A string that contains DECTPU statements that are to be executed when you press a self-inserting key while the cursor is to the right of a buffer's right margin.

Description

With the SET (RIGHT_MARGIN_ACTION) procedure, you can specify an action to be taken when you attempt to insert text to the right of the right margin of a line. If the third parameter is not specified, the right margin action routine is deleted. If no right margin action routine has been specified, the text is inserted at the current position after any necessary padding spaces.

Newly created buffers do not receive a right margin action routine if a template buffer is not specified on the call to the CREATE_BUFFER built-in procedure. If a template buffer is specified, the right margin action routine of the template buffer is used.

The right margin action routine affects only text entered from the keyboard or a learn sequence. Using the COPY_TEXT or MOVE_TEXT built-in procedures to insert text into a buffer to the right of the right margin does not trigger the right margin action routine.

Signaled Errors

TPU$_TOOFEW ERROR The SET (RIGHT_MARGIN_ACTION) 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.

Examples

The following example causes the procedure FILL_CURRENT_LINE to be executed when you attempt to type a character to the right of the right margin of the current line. A typical right margin action routine invokes the FILL built-in procedure to fill the current line and force text to the right of the right margin to a new line.
#1

SET (RIGHT_MARGIN_ACTION, CURRENT_BUFFER, "fill_current_line") 
 
      

The following example deletes any right margin action routine that may be defined for the current buffer. If you attempt to type a character to the right of the right margin of the current line, the text is inserted with spaces padding the text from the end of the line.

#2

SET (RIGHT_MARGIN_ACTION, CURRENT_BUFFER) 
      


SET (SCREEN_LIMITS)


Format

SET (SCREEN_LIMITS, array)


Parameters

SCREEN_LIMITS

A keyword that directs DECTPU to pass hints to the DECwindows window manager about screen size.

array

An integer-indexed array that specifies hints for the minimum and maximum screen width and length. The second pair of elements are optional. The array indices and their corresponding elements are as follows:

Description

The SET (SCREEN_LIMITS) procedure specifies the minimum and maximum allowable sizes for the DECTPU screen during resize operations. DECTPU passes these limits to the DECwindows window manager, which is free to use or ignore the limits.

Signaled Errors


Example

The following procedure sets up screen size limits. It is part of the EVE$$DECWINDOWS_MODULE_INIT procedure. The original version is in SYS$EXAMPLES:EVE$DECWINDOWS.TPU.

! Module Initialization 
 
LOCAL   temp_array; 
 
eve$x_decwindows_active := GET_INFO (SCREEN, "decwindows"); 
 
!  . 
!  . 
!  . 
 
IF NOT eve$x_decwindows_active 
THEN 
    RETURN (FALSE) 
ENDIF; 
 
! The following statements set up to handle resize actions. 
 
temp_array := CREATE_ARRAY (4); 
temp_array {1} := 20;   ! Minimum width. 
temp_array {2} := 6;    ! Minimum height. 
! Don't set max for Motif DECwindows so the maximize button will 
! make the window fill the screen. 
 
SET (SCREEN_LIMITS, temp_array); 
SET (RESIZE_ACTION, "eve$$resize_action"); 
SET (ENABLE_RESIZE, ON); 
 
!  . 
!  . 
!  . 
 
ENDMODULE; 
      


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