|
|
Updated:
11 December 1998
|
DEC Text Processing Utility Reference Manual
SET (RECORD_ATTRIBUTE)
Format
SET
(RECORD_ATTRIBUTE, ,
- DISPLAY_VALUE
- LEFT_MARGIN
,
- display_setting_integer
- margin_setting_integer
)
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
-
TPU$_TOOMANY
|
ERROR
|
You specified too many parameters.
|
TPU$_TOOFEW
|
ERROR
|
You specified too few parameters.
|
TPU$_INVPARAM
|
ERROR
|
The third parameter must be a keyword.
|
TPU$_ARGMISMATCH
|
ERROR
|
The second or fourth parameter has an incorrect type.
|
TPU$_BADKEY
|
WARNING
|
You specified an invalid keyword.
|
TPU$_BADDISPVAL
|
WARNING
|
Display values must be between --127 and +127.
|
TPU$_BADMARGINS
|
WARNING
|
You specified an illegal left margin value.
|
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
-
TPU$_INVPARAM
|
ERROR
|
The third parameter to the built-in has the wrong data type.
|
TPU$_TOOFEW
|
ERROR
|
You specified too few parameters.
|
TPU$_TOOMANY
|
ERROR
|
You specified too many parameters.
|
TPU$_BADKEY
|
ERROR
|
You specified an invalid keyword for the second or third parameter.
|
TPU$_ARGMISMATCH
|
ERROR
|
The second parameter must be a buffer of the keyword SYSTEM.
|
TPU$_INVSYSRECMODE
|
ERROR
|
You cannot specify the keyword UNSPECIFIED for the system default
record mode.
|
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 - ,
- buffer
- learn_sequence
- program
- range
- string
- NONE
)
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
-
TPU$_INVPARAM
|
ERROR
|
One of the parameters was specified with data of the wrong type.
|
TPU$_NORETURNVALUE
|
ERROR
|
SET (RESIZE_ACTION) cannot return a value.
|
TPU$_REQUIRESDECW
|
ERROR
|
You can use the SET (RESIZE_ACTION) built-in only if you are using
DECwindows DECTPU.
|
TPU$_TOOFEW
|
ERROR
|
Too few arguments passed to the SET (RESIZE_ACTION) built-in.
|
TPU$_TOOMANY
|
ERROR
|
Too many arguments passed to the SET (RESIZE_ACTION) built-in.
|
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
-
TPU$_TOOFEW
|
ERROR
|
SET (REVERSE) 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 the direction of the buffer to be toward
the beginning of the 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
-
TPU$_TOOFEW
|
ERROR
|
The SET (RIGHT_MARGIN) built-in 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$_BADMARGINS
|
WARNING
|
Right must be greater than left; both must be greater than zero.
|
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 - ,
- buffer2
- learn_sequence
- program
- range
- string
)
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:
- The minimum screen width, in columns. This value must be at least 0
and less than or equal to the maximum screen width. The default value
is 0.
- The minimum screen length, in lines. This value must be at least 0
and less than or equal to the maximum screen length. The default value
is 0.
- The maximum screen width, in columns. This value must be greater
than or equal to the minimum screen width and less than or equal to
255. The default value is 255. This element is optional, but if
present, must be accompanied by the fourth element.
- The maximum screen length, in lines. This value must be greater
than or equal to the minimum screen length and less than or equal to
255. The default value is 255. This element is optional.
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
-
TPU$_BADVALUE
|
WARNING
|
An integer parameter was specified with a value outside the valid range.
|
TPU$_MAXVALUE
|
WARNING
|
You specified a value higher than the maximum allowable value.
|
TPU$_MINVALUE
|
WARNING
|
You specified a value lower than the minimum allowable value.
|
TPU$_EXTRANEOUSARGS
|
ERROR
|
One or more extraneous arguments have been specified for a DECwindows
built-in.
|
TPU$_INVPARAM
|
ERROR
|
One of the parameters was specified with data of the wrong type.
|
TPU$_NORETURNVALUE
|
ERROR
|
SET (SCREEN_LIMITS) cannot return a value.
|
TPU$_REQUIRESDECW
|
ERROR
|
You can use the SET (SCREEN_LIMITS) built-in only if you are using
DECwindows DECTPU.
|
TPU$_TOOFEW
|
ERROR
|
Too few arguments passed to the SET (SCREEN_LIMITS) built-in.
|
TPU$_TOOMANY
|
ERROR
|
Too many arguments passed to the SET (SCREEN_LIMITS) built-in.
|
TPU$_REQARGSMISSING
|
ERROR
|
One or more required arguments are missing.
|
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;
|