 |
DEC Text Processing Utility Reference Manual
GET_INFO (COMMAND_LINE)
Format
{integer|string} := GET_INFO (COMMAND_LINE,
{"character" |"character_set" |"command" |"command_file" |"create"
|"display" |"file_name" |"first_file_name" |"initialization"
|"initialization_file" |"init_file" |"journal" |"journal_file" |"line"
|"modify" |"next_file_name" |"nomodify" |"output" |"output_file"
|"read_only" |"recover" |"section" |"section_file" |"start_character"
|"start_record" |"work" |"work_file" |"write"})
Parameters
"character"
Returns an integer that is the column number of the character position
specified by the /START_POSITION qualifier. This parameter is useful in
a procedure to determine where DECTPU should place the cursor at
startup time. The default is 1 if you do not specify the qualifier or
option. This parameter is the same as the "start_character"
parameter.
"character_set"
Returns a keyword that indicates the character set that you specified
by the /CHARACTER_SET qualifier. DECTPU can return the following
keywords: DEC_MCS (default), ISO_LATIN1, and GENERAL.
"command"
Returns an integer (1 or 0) that indicates whether the /COMMAND
qualifier is active (either by default or because the qualifier or
option was specified when you invoked DECTPU).
"command_file"
Returns a string that is the command file specification from the
/COMMAND qualifier.
"create"
Returns an integer (1 or 0) that indicates whether the /CREATE
qualifier is active (either by default or because the qualifier was
specified when you invoked DECTPU).
"display"
Returns an integer (1 or 0) that indicates whether the /DISPLAY or
/INTERFACE qualifier is active (either by default or because /DISPLAY
or /INTERFACE was specified when you invoked DECTPU).
"file_name"
Returns a string that is the first file specification used as a
parameter when you invoke DECTPU. Returns a null string if you did not
specify an input file name on the command line.
"first_file_name"
Returns a string that is the first file specification used as a
parameter when you invoke DECTPU. Returns 0 if you did not specify any
file name on the command line. There is a single input parameter that
can be a list of comma-separated file specifications. This GET_INFO
returns only the first file specification.
"initialization"
Returns an integer (1 or 0) that indicates whether the /INITIALIZATION
qualifier is active (either by default or because the qualifier was
specified when you invoked DECTPU).
"initialization_file"
Returns a string that is the initialization file specification for the
/INITIALIZATION qualifier.
"init_file"
This is a synonym for GET_INFO (COMMAND_LINE, "initialization_file").
"journal"
Returns an integer (1 or 0) that indicates whether the /JOURNAL
qualifier is active (either by default or because the qualifier was
specified when you invoked DECTPU).
"journal_file"
Returns a string that is the journal file specification for the
/JOURNAL qualifier.
"line"
Returns an integer that is the record number of the line specified by
the /START_POSITION qualifier. This parameter is useful in a procedure
to determine where DECTPU should place the cursor at startup time. The
default is 1 if the qualifier or option is not specified. This
parameter is the same as the "start_record" parameter.
"modify"
Returns an integer (1 or 0) that indicates whether the /MODIFY
qualifier was specified when you invoked DECTPU.
"next_file_name"
Returns the next file name entered on the command line that invoked
TPU. Returns 0 if no file name was specified on the command line, or if
there are no more file names to return.
"nomodify"
Returns an integer (1 or 0) that indicates whether the /NOMODIFY
qualifier was specified when you invoked DECTPU.
"output"
Returns an integer (1 or 0) that indicates whether the /OUTPUT
qualifier is active (either by default or because the qualifier was
specified when you invoked DECTPU).
"output_file"
Returns a string that is the output file specification for the /OUTPUT
qualifier.
"read_only"
Returns an integer (1 or 0) that indicates whether the /READ_ONLY
qualifier was specified when you invoked DECTPU.
"recover"
Returns an integer (1 or 0) that indicates whether the /RECOVER
qualifier was specified when you invoked DECTPU.
"section"
Returns an integer (1 or 0) that indicates whether the /SECTION
qualifier is active (either by default or because the qualifier was
specified when you invoked DECTPU).
"section_file"
Returns a string that is the section file specification for the
/SECTION qualifier.
"start_character"
Returns an integer that is the column number of the character position
specified by the /START_POSITION qualifier. This parameter is useful in
a procedure to determine where DECTPU should place the cursor at
startup time. The default is 1 if you do not specify qualifier. This
parameter is a synonym for "character".
"start_record"
Returns an integer that is the record number of the line specified by
the /START_POSITION qualifier. This parameter is useful in a procedure
to determine where DECTPU should place the cursor at startup time. The
default is 1 if you do not specify the qualifier. This parameter is a
synonym for "line".
"work"
Returns an integer (1 or 0) that indicates whether the /WORK qualifier
is active (either by default or because the qualifier was specified
when you invoked DECTPU).
"work_file"
Returns a string that is the work file specification for the /WORK
qualifier.
"write"
Returns an integer (1 or 0) that indicates whether the /WRITE qualifier
was specified when you invoked DECTPU.
Return Values
integer
Returns requested information about the integer you specify.
string
Returns requested information about the string you specify.
Description
The GET_INFO (COMMAND_LINE) procedure returns information about the
command line used to invoke DECTPU.
For general information about using all forms of GET_INFO built-in
procedures, see the description of GET_INFO.
GET_INFO (DEBUG)
Format
{contents |integer |parameter |string |variable} := GET_INFO (DEBUG,
{"breakpoint" |"examine", variable_name |"line_number" |"local" |"next"
|"parameter" |"previous" |"procedure"})
Parameters
"breakpoint"
Returns a string that is the name of the first breakpoint. This
establishes a breakpoint context for the next and
previous parameters. TPU$_NONAMES is returned if there are no
breakpoints.
"examine", variable_name
Returns the contents of the specified variable. TPU$_NONAMES is
returned if the specified variable cannot be found.
You must specify a string that contains the name of the variable as the
third parameter to GET_INFO (DEBUG, "examine").
"line_number"
Returns an integer that is the line number of the breakpoint within the
procedure. If the procedure is unnamed, 0 is returned.
"local"
Returns the first local variable in the procedure. This establishes a
context for the next and previous parameters.
TPU$_NONAMES is returned if there are no local variables.
"next"
Returns the next parameter, local variable, or breakpoint. Before using
GET_INFO (DEBUG, "next"), you must use one of the following built-ins:
- GET_INFO (DEBUG, "local")
- GET_INFO (DEBUG, "breakpoint")
- GET_INFO (DEBUG, "parameter")
TPU$_NONAMES is returned if there are no more.
"parameter"
Returns the first parameter of the procedure. GET_INFO (DEBUG,
"parameter") causes the DECTPU Debugger to construct a list of all the
formal parameters of the procedure you are debugging. Once this list is
constructed, you can use GET_INFO (DEBUG, "next") and GET_INFO (DEBUG,
"previous"). DECTPU signals TPU$_NONAMES if the procedure you are
debugging does not have any parameters.
"previous"
Returns the previous parameter, local variable, or breakpoint.
TPU$_NONAMES is returned if there are no more.
"procedure"
Returns a string that is the name of the procedure containing the
breakpoint. The null string is returned if the procedure has no name.
Return Values
contents
Returns requested information about the contents you specify.
integer
Returns requested information about the integer you specify.
parameter
Returns requested information about the parameter you specify.
string
Returns requested information about the string you specify.
variable
Returns requested information about the variable you specify.
Description
The GET_INFO (DEBUG) procedure returns information about the status of
a debugging session when you are using the DECTPU Debugger.
For general information about using all forms of GET_INFO built-in
procedures, see the description of GET_INFO.
GET_INFO (DEFINED_KEY)
Format
keyword := GET_INFO (DEFINED_KEY, {"first" |"last" |"next" |"previous"}
, string )
Parameters
"first"
Returns a keyword that is the key name of the first key in the
specified key map or key map list.
"last"
Returns a keyword that is the key name of the last key in the specified
key map or key map list.
"next"
Returns a keyword that is the key name of the next key in the specified
key map or key map list. Returns 0 if last. Use "first" before
"next".
"previous"
Returns a keyword that is the key name of the previous key in the
specified key map or key map list. Returns 0 if first. Use
"last" before "previous".
string
The string that specifies the name of either the key map or key map
list to be searched.
Return Value
Returns the requested information about the keyword you specify.
Description
The GET_INFO (DEFINED_KEY) procedure returns a keyword that is the key
name of a specified key.
"Current" is not valid when the first parameter is DEFINED_KEY
or KEY_MAP, although it is valid when the first parameter is
KEY_MAP_LIST.
For general information about using all forms of GET_INFO built-in
procedures, see the description of GET_INFO.
GET_INFO (integer_variable)
Format
string := GET_INFO (integer, "name")
Parameters
integer
Returns an integer that is the equivalent of a DECTPU keyword. When you
use GET_INFO (integer, "name"), the built-in returns the string
representation of the keyword that is equivalent to the specified
integer.
For example, the following statement assigns the string
process to the variable equiv_string:
equiv_string := GET_INFO (10, "name");
|
(The value 10 is the integer equivalent of the PROCESS keyword.)
You should not use the integer equivalents of keywords in DECTPU code.
Compaq does not guarantee that the existing equivalences between
integers and keywords will always remain the same.
"name"
Returns the string equivalent of the specified integer or keyword.
Return Value
Returns the string representation of any integer that is an equivalent
of a keyword.
Description
The GET_INFO (integer_variable) procedure returns the string
representation of any integer that is an equivalent of a keyword.
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 (any_keyword).
GET_INFO (KEY_MAP)
Format
{integer|string} := GET_INFO (KEY_MAP, {"first" |"last" |"next"
|"previous"}, name_string )
Parameters
"first"
Returns a string that is the name of the first key map in the key map
list; returns 0 if there is none.
"last"
Returns a string that is the name of the last key map in the key map
list; returns 0 if there is none.
"next"
Returns a string that is the name of the next key map in the key map
list; returns 0 if there is none. Use "first" before
"next".
"previous"
Returns a string that is the name of the previous key map in the key
map list; returns 0 if there is none. Use "last" before
"previous".
name_string
The string that specifies the name of either the key map or key map
list to be searched.
Return Values
integer
Returns requested information about the integer you specify.
string
Returns requested information about the string you specify.
Description
The GET_INFO (KEY_MAP) procedure returns information about a key map in
a specified key map list. GET_INFO (KEY_MAP) takes a string as a third
parameter. The string specifies the name of the key map list to be
searched.
The parameter "current" is not valid when the first keyword is
DEFINED_KEY or KEY_MAP, although it is valid when the first keyword is
KEY_MAP_LIST.
For general information about using all forms of GET_INFO built-in
procedures, see the description of GET_INFO.
GET_INFO (KEY_MAP_LIST)
Format
{integer|string} := GET_INFO (KEY_MAP_LIST, {"current" |"first" |"last"
|"next" |"previous"})
Parameters
"current"
Returns a string that is the name of the current key map list; returns
0 if there is none.
"first"
Returns a string that is the name of the first key map list; returns 0
if there is none.
"last"
Returns a string that is the name of the last key map list; returns 0
if there is none.
"next"
Returns a string that is the name of the next key map list; returns 0
if there is none. Use "current" or "first" before
"next".
"previous"
Returns a string that is the name of the previous key map list; returns
0 if there is none. Use "current" or "last" before
"previous".
Return Values
integer
Returns requested information about the integer you specify.
string
Returns requested information about the string you specify.
Description
The GET_INFO (KEY_MAP_LIST) procedure returns information about a key
map list.
The parameter "current" is not valid when the first keyword is
DEFINED_KEY or KEY_MAP, although it is valid when the first keyword is
KEY_MAP_LIST.
For general information about using all forms of GET_INFO built-in
procedures, see the description of GET_INFO.
GET_INFO (marker_variable)
Format
{buffer |integer |keyword} := GET_INFO (marker_variable,
{"before_bol" |"beyond_eob" |"beyond_eol" |"bound" |"buffer"
|"display_value" |"left_margin" |"middle_of_tab" |"offset"
|"offset_column" |"record_number" |"right_margin"
|"unmodifiable_records" |"video" |"within_range", range})
Parameters
marker_variable
The marker for which the information is requested.
"before_bol"
Returns 1 if the specified marker is located before the beginning of a
line; returns 0 if it is not.
"beyond_eob"
Returns 1 if the specified marker is located beyond the end of a
buffer; returns 0 if it is not.
"beyond_eol"
Returns 1 if the specified marker is located beyond the end of a line;
returns 0 if it is not.
"bound"
Returns 1 if the specified marker is attached to a character; returns 0
if the marker is free. For more information on bound and free markers,
see the Guide to the DEC Text Processing Utility.
"buffer"
Returns the buffer in which the marker is located.
"display_value"
Returns the display value of the record in which the specified marker
is located. For more information about display values, see the
descriptions of the SET (DISPLAY_VALUE) and SET (RECORD_ATTRIBUTES)
built-in procedures.
"left_margin"
Returns an integer that is the current left margin setting of the line
containing the marker.
"middle_of_tab"
Returns an integer (1 or 0) that indicates whether the marker is
located in the white space created by a tab.
"offset"
Returns an integer that is the number of characters between the left
margin and the marker. 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 the
character bound to the marker is displayed.
"offset_column"
Returns an integer that is the screen column in which DECTPU displays
the character to which the marker is bound. 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" does reflect 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.
"record_number"
Returns an integer that is the number associated with the record (line)
containing the specified marker.
A record number indicates the location of a record in a buffer. Record
numbers are dynamic. As you add or delete records, DECTPU changes the
number associated with a particular record, as appropriate. DECTPU
counts each record in a buffer, regardless of whether the line is
visible in a window or whether the record contains text. GET_INFO
(marker, "record_number") counts the end-of-buffer text as a record if
the specified marker is on the end-of-buffer text, but GET_INFO
(buffer, "record_count") never counts the end-of-buffer text as a
record. Thus, it is possible for the value returned by GET_INFO
(buffer, "record_count") to be one less than the maximum value returned
by GET_INFO (marker, "record_number").
"right_margin"
Returns an integer that is the current right margin setting of the line
containing the marker.
"unmodifiable_records"
Returns 1 if the record that contains the specified marker is
unmodifiable; returns 0 if the record is modifiable.
"video"
Returns a keyword that is the video attribute of the marker; returns 0
if the marker is a free marker.
"within_range"
Returns an integer (1 or 0) that indicates whether the marker is in the
range specified by the third parameter.
Return Values
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.
Description
The GET_INFO (marker_variable) procedure returns information about a
specified marker.
For general information about using all forms of GET_INFO built-in
procedures, see the description of GET_INFO.
GET_INFO (mouse_event_keyword)
Format
{integer|window} := GET_INFO (mouse_event_keyword, {"mouse_button"
|"window"})
Parameters
"mouse_button"
Returns an integer that is the number of the mouse button specified
with a mouse event keyword.
Table 2-4 lists the valid keywords for the first parameter when you
use "mouse_button" as the second parameter.
Table 2-4 DECTPU Keywords Representing Mouse Events
M1UP
|
M2UP
|
M3UP
|
M4UP
|
M5UP
|
M1DOWN
|
M2DOWN
|
M3DOWN
|
M4DOWN
|
M5DOWN
|
M1DRAG
|
M2DRAG
|
M3DRAG
|
M4DRAG
|
M5DRAG
|
M1CLICK
|
M2CLICK
|
M3CLICK
|
M4CLICK
|
M5CLICK
|
M1CLICK2
|
M2CLICK2
|
M3CLICK2
|
M4CLICK2
|
M5CLICK2
|
M1CLICK3
|
M2CLICK3
|
M3CLICK3
|
M4CLICK3
|
M5CLICK3
|
M1CLICK4
|
M2CLICK4
|
M3CLICK4
|
M4CLICK4
|
M5CLICK4
|
M1CLICK5
|
M2CLICK5
|
M3CLICK5
|
M4CLICK5
|
M5CLICK5
|
"window"
Returns the window in which the downstroke occurred that started the
current drag operation. Returns 0 if no drag operation is in progress
for the specified mouse button when the built-in is executed.
The valid keywords for the first parameter when you use
"window" as the second parameter are M1DOWN, M2DOWN, M3DOWN,
M4DOWN, and M5DOWN.
Return Values
integer
Returns requested information about the integer you specify.
window
Returns requested information about the window you specify.
Description
The GET_INFO (mouse_event_keyword) procedure returns information about
a mouse event. A mouse_event_keyword is a keyword that
represents a single click, multiple clicks, upstroke, downstroke, or
drag of a mouse button.
For general information about using all forms of GET_INFO built-in
procedures, see the description of GET_INFO.
Examples
In the following example, the statement causes DECTPU to assign the
value 3 to the variable x:
#1 |
x := GET_INFO (M3CLICK2, "mouse_button");
|
In the following example, when bound to M1DRAG, that procedure is
called by DECTPU to respond to a drag event by checking whether you
have dragged the mouse across window boundaries; if you have, the
procedure displays a message. If not, the procedure outputs a message
that you are dragging the mouse.
#2 |
PROCEDURE sample_m1_drag
LOCAL the_window,
new_window,
column,
row,
temp;
the_window := GET_INFO (M1DOWN, "window");
IF the_window = 0
THEN
RETURN (FALSE)
ENDIF;
LOCATE_MOUSE (new_window, column, row);
IF the_window <> new_window
THEN
MESSAGE ("Invalid drag of pointer across window boundaries.");
ENDIF;
MESSAGE ("Dragging the mouse...");
ENDPROCEDURE;
|
|