beautypg.com

Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual

Page 49

background image

DEC Text Processing Utility Data Types

3.6 Marker Data Type

A marker is bound if there is a character in the position marked by the editing
point at the time you create the marker. A bound marker is tied to the character
on which it is created. If you move the character to which a marker is bound, the
marker moves with the character. If you delete the character to which a marker
is bound, DECTPU binds the marker to the nearest character or to the end of the
line if that is closer than any character.

To force the creation of a bound marker, use the MARK built-in with any of its
parameters except FREE_CURSOR. This operation creates a bound marker even
if the editing point is beyond the end of a line, before the beginning of a line, in
the middle of a tab, or beyond the end of a buffer. To create a bound marker in a
location where there is no character, DECTPU fills the space between the marker
and the nearest character with padding space characters.

A marker is usually free if all of the following conditions are true:

You used MARK (FREE_CURSOR) to create the marker.

There was no character in the position marked by the editing point at the
time you created the marker.

Nothing has happened to cause the marker to become bound.

The following paragraphs explain each of these conditions in more detail.

If you use the MARK (FREE_CURSOR) built-in procedure and there is a
character in the position marked by the editing point, the marker is bound even
though you specify otherwise. Once a marker becomes bound, it remains bound
throughout its existence. To determine whether a marker is bound, use the
following GET_INFO call:

GET_INFO (marker_variable, "bound");

DECTPU keeps track of the location of a free marker by measuring the distance
between the marker and the character nearest to the marker. If you move the
character from which DECTPU measures distance to a free marker, the marker
moves too. DECTPU preserves a uniform distance between the character and
the marker. If you collapse white space that contains one or more free markers
(for example, if you delete a tab or use the APPEND_LINE built-in procedure),
DECTPU preserves the markers and binds them to the nearest character.

If you use the POSITION built-in procedure to establish the editing point at a
free marker, the marker remains free and the editing point is also said to be
free; that is, the editing point is not bound to a character. Some operations cause
DECTPU to fill the space between a free marker and the nearest character with
padding space characters, thereby converting the free marker to a bound marker.
For example, if you type text into the buffer when the editing point is detached,
DECTPU inserts padding space characters between the nearest character and the
editing point. Using any of the following built-in procedures when the editing
point is detached also causes DECTPU to perform padding:

APPEND_LINE

COPY_TEXT

CURRENT_CHARACTER

CURRENT_LINE

CURRENT_OFFSET

ERASE_CHARACTER

DEC Text Processing Utility Data Types 3–9