Compaq AA-PWCBD-TE Computer Accessories User Manual


 
DEC Text Processing Utility Data Types
3.6 Marker Data Type
ERASE_LINE
MOVE_HORIZONTAL
MOVE_TEXT
MOVE_VERTICAL
SELECT
SELECT_RANGE
SPLIT_LINE
Example 3–1 shows how to suppress padding while using these built-ins. The
example assumes that the editing point is free. The code in this example assigns
the string representation of the current line to the variable bat without adding
padding blanks to the buffer.
Example 3–1 Suppressing the Addition of Padding Blanks
x := MARK (FREE_CURSOR); ! Places a marker at the
! detached editing point
POSITION (SEARCH_QUIETLY ("",FORWARD)); ! Moves the active editing
! point to the nearest
! text character
bat := CURRENT_LINE; ! Assigns the string
! representation of the
! current line to bat without
! adding padding blanks
POSITION (x); ! Returns the active editing
! point to the free marker
To remove a marker, use the DELETE built-in procedure with the marker as a
parameter. For example, the following statement deletes the marker mark1:
DELETE (mark1);
You can also set all variables referring to the marker to refer to something else,
for example, tpu$k_unspecified or 0. The following statement sets the variable
mark1 to 0:
mark1 := 0;
If mark1 were the only variable referring to a marker, that marker would be
deleted upon execution of the previous statement.
The marker data type is returned by the MARK, SELECT, BEGINNING_OF,
END_OF, and GET_INFO built-in procedures.
3.7 Pattern Data Type
A pattern is a structure that DECTPU uses when it searches for text in a buffer.
You can think of a pattern as a template that DECTPU compares to the searched
text, looking for a match between the pattern and the searched text. You can use
a variable whose data type is the pattern data type when you specify the first
parameter to the SEARCH and SEARCH_QUIETLY built-in procedures.
3–10 DEC Text Processing Utility Data Types