Document revision date: 30 March 2001

## DEC Text Processing Utility Reference Manual

Previous | Contents | Index

## GET_INFO (any_keyword)

### Format

> string := GET_INFO (any_keyword, "name")

### Parameter

> #### "name"

> Returns the string equivalent of the specified keyword.

> You can use GET_INFO (any_keyword, "name") to obtain the string equivalent of a key name. This is useful for displaying screen messages about keys. For example, to obtain the string equivalent of the key name PF1, you could use the following statement:

>     the_string := GET_INFO (PF1, "name");

> If a key name is created using several key modifiers, the built-in returns the string representations of all the keywords used to create the key name. For more information on creating key names, see the description of the KEY_NAME built-in procedure.

### Return Value

Returns the requested information about the string you specify.

### Description

> The GET_INFO (any_keyword) procedure returns the string representation of the keyword specified in the first parameter to GET_INFO.

> For general information about using all forms of GET_INFO built-in procedures, see the description of GET_INFO. See also the description of GET_INFO (integer_variable).

### Example

> The following example shows one possible use of GET_INFO (any_keyword, "name"). The first statement creates a DECTPU key name for the key sequence produced by pressing the Ctrl key, the Shift key, and the 4 key on the keypad all at once. The new key name is assigned to the variable key_name. The IF clause of the statement shows how to test whether a key name was created using one or more key modifier keywords. (This statement does not detect whether a key name was created using the SHIFT_KEY keyword. The GET_INFO (any_keyname, "key_modifiers") built-in returns 0 even if the key name was created using SHIFT_KEY.) The THEN clause shows how to fetch the key modifier keyword or keywords used to create a key name. The final statement displays the string KEY_NAME (KP4, SHIFT_MODIFIED, ALT_MODIFIED) in the message buffer.

    new_key := KEY_NAME (KP4, SHIFT_MODIFIED, CTRL_MODIFIED);
    !    .
    !    .
    !    .
    IF GET_INFO (new_key, "key_modifiers") <> 0
    THEN
        the_name := GET_INFO (new_key, "name")
    ENDIF;
    MESSAGE (STR (the_name));

## GET_INFO (any_variable)

### Format

> keyword := GET_INFO (any_variable, "type")

### Parameter

> #### "type"

> Returns a keyword that is the data type of the variable specified in any_variable.

### Return Value

Returns the requested information about the keyword you specify.

### Description

> The GET_INFO (any_variable) procedure returns a keyword that specifies the data type of the variable.

> For general information about using all forms of GET_INFO built-in procedures, see the description of GET_INFO.

### Example

> The following example tests whether the variable select_popup has been assigned a value of type widget. If not, the code causes a message to be displayed on the screen.

    IF  GET_INFO (select_popup, "type") <> WIDGET
        THEN
            MESSAGE ("Select_popup widget not created.")
    ENDIF;

## GET_INFO (ARRAY)

### Format

> array := GET_INFO (ARRAY,{"current"|"first"|"last"|"next" |"previous"})

### Parameters

> #### "current"

> Returns the current array in DECTPU's internal list of arrays. You must use either GET_INFO (ARRAY, "first") or GET_INFO (ARRAY, "last") before you can use GET_INFO (ARRAY, "current"). If you use these built-ins in the wrong order or if no arrays have been created, GET_INFO (ARRAY, "current") returns 0.

> #### "first"

> Returns the first array in the DECTPU internal list of arrays; returns 0 if no arrays are defined.

> #### "last"

> Returns the last array in the DECTPU internal list of arrays; returns 0 if no arrays are defined.

> #### "next"

> Returns the next array in DECTPU's internal list of arrays. This parameter is valid whenever GET_INFO (ARRAY, "current") would return an array. That is, the intended usage of this parameter is that you use GET_INFO (ARRAY, "first") before you can use GET_INFO (ARRAY, "next").

> Returns 0 if you use this parameter immediately after GET_INFO (ARRAY, "last"), or if you have not created an array.

> #### "previous"

> Returns the previous array in DECTPU's internal list of arrays. The intended usage of this parameter is that you use either GET_INFO (ARRAY, "current") or GET_INFO (ARRAY, "last") before you use GET_INFO (ARRAY, "previous").

> Returns 0 if you use this parameter immediately after GET_INFO (ARRAY, "first"), or if you have not created an array.

### Return Value

Returns the requested information about the array you specify.

### Description

> The GET_INFO (ARRAY) procedure returns an array in DECTPU's internal list of arrays.

> For general information about using all forms of GET_INFO built-in procedures, see the description of GET_INFO.

## GET_INFO (array_variable)

### Format

> {array |buffer |integer |keyword |marker |process |range |string |widget |window}:= GET_INFO (array_variable,{"current" |"first" |"high_index" |"last" |"low_index" |"next" |"previous"})

### Parameters

> #### "current"

> Returns the index value of the current element of the specified array, whether the index is of type integer or some other type. Returns any type except program, pattern, or learn. Returns the UNSPECIFIED keyword if there is no current element.

> You must use either GET_INFO (array_variable, "first") or GET_INFO (array_variable, "last") before you can use GET_INFO (array_variable, "current").

> #### "first"

> Returns the index value of the first element of the specified array, whether the index is of type integer or some other type. Returns any type except program, pattern, or learn. Returns the UNSPECIFIED keyword if there is no first element.

> #### "high_index"

> Returns an integer that is the highest valid integer index for the static predeclared portion of the array. If the GET_INFO call returns a high index lower than the low index, the array has no static portion.

> #### "last"

> Returns the index value of the last element of the specified array, whether the index is of type integer or some other type. Returns any type except program, pattern, or learn. Returns the UNSPECIFIED keyword if there is no last element.

> #### "low_index"

> Returns an integer that is the lowest valid integer index for the static predeclared portion of the array. If the GET_INFO call returns a high index lower than the low index, the array has no static portion.

> #### "next"

> Returns the index value of the next element of the specified array, whether the index is of type integer or some other type. Returns any type except program, pattern, or learn. Returns the UNSPECIFIED keyword if there is no next element.

> You must use GET_INFO (array_variable, "first") before you can use GET_INFO (array_variable, "next").

> #### "previous"

> Returns the index value of the previous element of the specified array, whether the index is of type integer or some other type. Returns any type except program, pattern, or learn. Returns the UNSPECIFIED keyword if there is no previous element.

> You must use either GET_INFO (array_variable, "current") or GET_INFO (array_variable, "last") before you can use GET_INFO (array_variable, "previous").

### Return Values

> #### array

> Returns requested information about the array you specify.

> #### buffer

> Returns requested information about the buffer you specify.

> #### integer

> Returns requested information about the integer you specify.

> #### keyword

> Returns requested information about the keyword you specify.

> #### marker

> Returns requested information about the marker you specify.

> #### process

> Returns requested information about the process you specify.

> #### range

> Returns requested information about the range you specify.

> #### string

> Returns requested information about the string you specify.

> #### widget

> Returns requested information about the widget you specify.

> #### window

> Returns requested information about the window you specify.

### Description

> The GET_INFO (array_variable) procedure returns information about a specified array.

> For general information about using all forms of GET_INFO built-in procedures, see the description of GET_INFO.

## GET_INFO (BUFFER)

### Format

> buffer := GET_INFO (BUFFER[[S]] {"current" |"find_buffer", buffer_name |"first" |"last" |"next" |"previous"})

### Parameters

> #### "current"

> Returns the current buffer in DECTPU's internal list of buffers; returns 0 if there is no current buffer.

> GET_INFO (BUFFER[[S]], "current") always returns the current buffer, regardless of whether you have first used GET_INFO (BUFFER[[S]], "first") or GET_INFO (BUFFER[[S]], "last"). Thus, GET_INFO (BUFFER[[S]], "current") is equivalent to the CURRENT_BUFFER built-in procedure.

> #### "find_buffer", buffer_name

> Returns the buffer whose name you specify (as a string) as the third parameter; returns 0 if no buffer with the name you specify is found.

> #### "first"

> Returns the first buffer in DECTPU's internal list of buffers; returns 0 if there is none.

> #### "last"

> Returns the last buffer in DECTPU's internal list of buffers; returns 0 if there is none.

> #### "next"

> The next buffer in DECTPU's internal list of buffers; returns 0 if there are no more.

> #### "previous"

> Returns the preceding buffer in DECTPU's internal list of buffers; returns 0 if there is none.

### Return Value

Returns the requested information about the buffer you specify.

### Description

> The GET_INFO (BUFFER) procedure returns a buffer in DECTPU's internal list of buffers.

> For general information about using all forms of GET_INFO built-in procedures, see the description of GET_INFO.

## GET_INFO (buffer_variable)

### Format

> {integer |keyword |learn_sequence |marker |program |range |string} := GET_INFO (buffer_variable,

> {"before_bol" |"beyond_eob" |"beyond_eol" |"bound" |"character" |"direction" |"eob_text" |"erase_unmodifiable" |"file_name" |"first_marker" |"first_range" |"journaling" |"journal_file" |"journal_name" |"key_map_list" |"left_margin" |"left_margin_action" |"line" |"map_count" |"max_lines" |"middle_of_tab" |"mode" |"modifiable" |"modified" |"move_vertical_context" |"name" |"next_marker" |"next_range" |"no_write" |"offset" |"offset_column" |"output_file"}

> {"permanent" |"read_routine", GLOBAL_SELECT |"record_count" |"record_number" |"record_size" |"right_margin" |"right_margin_action" |"safe_for_journaling" |"system" |"tab_stops" |"unmodifiable_records"})

### Parameters

> #### "before_bol"

> Returns an integer (1 or 0) that indicates whether the editing point is located before the beginning of a line.

> #### "beyond_eob"

> Returns an integer (1 or 0) that indicates whether the editing point is located beyond the end of a buffer.

> #### "beyond_eol"

> Returns an integer (1 or 0) that indicates whether the editing point is located beyond the end of a line.

> #### "bound"

> Returns an integer (1 or 0) that indicates whether the marker that is the specified buffer's editing point is bound to text. For more information about bound markers, see the Guide to the DEC Text Processing Utility.

> #### "character"

> Returns a string that is the character at the editing point for the buffer.

> #### "direction"

> Returns the FORWARD or REVERSE keyword. Use the SET (FORWARD) and SET (REVERSE) built-in procedures to establish or change this parameter.

> #### "eob_text"

> Returns a string that represents the end-of-buffer text. Use the SET (EOB_TEXT) built-in procedure to establish or change this parameter.

> #### "erase_unmodifiable"

> Returns 1 if unmodifiable records can be erased from the specified buffer and returns 0 if the records cannot be erased.

> #### "file_name"

> Returns a string that is the name of a file given as the second parameter to CREATE_BUFFER. Returns the null string if none was specified.

> #### "first_marker"

> Returns the first marker in DECTPU's internal list of markers for the buffer. Returns 0 if there is none. You must use GET_INFO (buffer_variable, "first_marker" before the first use of GET_INFO (buffer_variable, "next_marker"). If you do not follow this rule, GET_INFO (buffer_variable, "next_marker") returns 0.

> There is no corresponding "last_marker or "prev_marker" parameter.

> Do not write code that relies on DECTPU storing markers in one particular order. Creating markers or ranges may alter the internal order.

> #### "first_range"

> Returns the first range in DECTPU's internal list of ranges for the buffer. Returns 0 if there are none. You must use GET_INFO (buffer_variable, "first_range") before you use GET_INFO (buffer_variable,"next_range") or the "next_range" parameter returns 0.

> There is no corresponding "last_range" or "prev_range" parameter.

> Do not write code that relies on DECTPU storing ranges in one particular order. Creating markers or ranges may alter the internal order.

> #### "journaling"

> Returns 1 if the specified buffer is being journaled or returns 0 if it is not.

> #### "journal_file"

> Returns a string that is the name of the journal file for the specified buffer. If the buffer is not being journaled, the call returns 0.

> #### "journal_name"

> Converts a buffer's name to a journal file name by using the DECTPU default journal file name algorithm. DECTPU converts the buffer name to a journal file name regardless of journaling status. The GET_INFO call does not require journaling to be turned on for the specified buffer. For more information on this algorithm, see the Guide to the DEC Text Processing Utility.

> #### "key_map_list"

> Returns a string that is the key map list bound to the buffer. Use the SET built-in procedure to establish or change this parameter.

> #### "left_margin"

> Returns an integer that is the current left margin setting. Use the SET (LEFT_MARGIN) built-in procedure to establish or change this parameter.

> #### "left_margin_action"

> Returns a program or learn sequence that specifies what DECTPU should do if you try to insert text to the left of the left margin. Returns the UNSPECIFIED keyword if no left margin action routine has been set. Use the SET (LEFT_MARGIN_ACTION) built-in procedure to establish or change this parameter.

> #### "line"

> Returns a string that is the line of text at the editing point for the buffer.

> #### "map_count"

> Returns an integer that is the number of windows associated with the buffer.

> #### "max_lines"

> Returns an integer that is the maximum number of records (lines) in the buffer. Use the SET built-in procedure to establish or change this parameter.

> #### "middle_of_tab"

> Returns an integer (1 or 0) that indicates whether the editing point is located in the white space within a tab.

> #### "mode"

> Returns the INSERT or OVERSTRIKE keyword. Use the SET (INSERT) and SET (OVERSTRIKE) built-in procedures to establish or change this parameter.

> #### "modifiable"

> Returns an integer (1 or 0) that indicates whether the buffer is modifiable.

> #### "modified"

> Returns an integer (1 or 0) that indicates whether the buffer has been modified.

> #### "move_vertical_context"

> Returns the encoded integer that describes the column where DECTPU attempts to position the cursor during MOVE_VERTICAL operations. See the SET (MOVE_VERTICAL_CONTEXT) built-in procedure for more information.

> #### "name"

> Returns a string that is the name given to the buffer when it was created.

> #### "next_marker"

> Returns the next marker in DECTPU's internal list of markers for the buffer. Returns 0 if there are no more. You must use GET_INFO (buffer_variable, "first_marker") before you use GET_INFO (buffer_variable, "next_marker") or the "next_marker" parameter returns 0.

> There is no corresponding "last_marker" or "prev_marke" parameter.

> Do not write code that relies on DECTPU storing markers in one particular order. Creating markers or ranges may alter the internal order.

> #### "next_range"

> Returns the next range in DECTPU's internal list of ranges for the buffer. Returns 0 if there are no more. You must use GET_INFO (buffer_variable, "first_range") before you use GET_INFO (buffer_variable, "next_range") or the "next_range" parameter returns 0.

> There is no corresponding "last_range" or "prev_range" parameter.

> Do not write code that relies on DECTPU storing ranges in one particular order. Creating markers or ranges may alter the internal order.

> #### "no_write"

> Returns an integer (1 or 0) that indicates whether the buffer should be written to a file at exit time. DECTPU writes the buffer to a file only if the buffer has been modified during the editing session. Use the SET (NO_WRITE) built-in procedure to establish or change this parameter.

> #### "offset"

> Returns an integer that is the number of characters between the left margin and the editing point. The left margin is counted as character 0. A tab is counted as one character, regardless of width. Window shifts have no effect on the value returned when you use "offset". The value returned has no relation to the visible screen column in which a character is displayed.

> #### "offset_column"

> Returns an integer that is the screen column in which DECTPU displays the character at the editing point. When calculating this value, DECTPU does not take window shifts into account; DECTPU assumes that any window mapped to the current buffer is not shifted. The value returned when you use "offset_column" reflects the location of the left margin and the width of tabs preceding the editing point. In contrast, the value returned when you use "offset" is not affected by the location of the left margin or the width of tabs.

> #### "output_file"

> Returns a string that is the name of the file used with the SET (OUTPUT_FILE) built-in procedure. Returns 0 if there is no output file associated with the specified buffer. Use the SET (OUTPUT_FILE) built-in procedure to establish or change this parameter.

> #### "permanent"

> Returns an integer (1 or 0) that indicates whether the buffer is permanent or can be deleted. Use the SET (PERMANENT) built-in procedure to establish or change the parameter.

> #### "read_routine"

> Use with DECwindows only.

> Returns the program or learn sequence that DECTPU executes when it owns a global selection and another application has requested information about that selection. If the application has not specified a global selection read routine, 0 is returned.

> GLOBAL_SELECT is a keyword indicating that the built-in is to return the global selection read routine. When you use "read_routine" as the second parameter to this built-in, you must use the GLOBAL_SELECT keyword as the third parameter, as follows:

> `GET_INFO (buffer_variable, "read_routine", GLOBAL_SELECT)`

> #### "record_count"

> Returns an integer that is the number of records (lines) in the buffer. GET_INFO (buffer, "record_count") does not count the end-of-buffer text as a record, but GET_INFO (marker, "record_number") does if the specified marker is on the end-of-buffer text. Thus, the maximum value returned by GET_INFO (buffer, "record_count") is one less than the maximum value returned by GET_INFO (marker, "record_number") if the specified marker is on the end-of-buffer text.

> #### "record_number"

> Returns the record number of the editing point.

> #### "record_size"

> Returns an integer that is the maximum length for records (lines) in the buffer.

> #### "right_margin"

> Returns an integer that is the current right margin setting. Use the SET (RIGHT_MARGIN) built-in procedure to establish or change the parameter.

> #### "right_margin_action"

> Returns a program or learn sequence that specifies what DECTPU should do if you try to insert text to the right of the right margin. Returns the UNSPECIFIED keyword if the buffer does not have a right margin action.

> Use the SET (RIGHT_MARGIN_ACTION) built-in procedure to establish or change the parameter.

> #### "safe_for_journaling"

> Returns 1 if the specified buffer is safe for journaling or returns 0 if it is not. "Safe for journaling" means that you can use the SET (JOURNALING) built-in procedure to turn on journaling. A buffer is safe for journaling if it is empty, has never been modified, or has not been modified since the last time it was written to a file.

> #### "system"

> Returns an integer (1 or 0) that indicates whether the buffer is a system buffer. Use the SET (SYSTEM) built-in procedure to establish or change the parameter.

> #### "tab_stops"

> Returns either an integer or a string. Use the SET (TAB_STOPS) built-in procedure to determine the data type of the return value. If you specify a return value of type string, the GET_INFO (buffer_variable, "tab_stops") built-in procedure returns a string representation of all the column numbers where tab stops are set. The column numbers are separated by spaces. If you specify a return value of type integer, the return value is the number of columns between tab stops.

> #### "unmodifiable_records"

> Returns 1 if the specified buffer contains one or more unmodifiable records. The call returns 0 if no unmodifiable records are present in the specified buffer.

### Return Values

> #### integer

> Returns requested information about the integer you specify.

> #### keyword

> Returns requested information about the keyword you specify.

> #### learn_sequence

> Returns requested information about the learn_sequence you specify.

> #### marker

> Returns requested information about the marker you specify.

> #### program

> Returns requested information about the program you specify.

> #### range

> Returns requested information about the range you specify.

> #### string

> Returns requested information about the string you specify.

### Description

> The GET_INFO (buffer_variable) procedure returns information about a specified buffer.

> For general information about using all forms of GET_INFO built-in procedures, see the description of GET_INFO.

Previous | Next | Contents | Index

| privacy and legal statement |
6020PRO_011.HTML