beautypg.com

6 marker data type – Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual

Page 48

background image

DEC Text Processing Utility Data Types
3.5 Learn Data Type

To enable your user-written DECTPU procedures to work successfully with
learn sequences, you must observe the following coding rules when you write
procedures that you or someone else can bind to a key:

The procedure should return true or false, as needed, to indicate whether
execution of the procedure completed successfully.

The procedure should invoke the LEARN_ABORT built-in in case of error.

These practices help prevent a learn sequence from finishing if the learn sequence
calls the user-written procedure and the procedure is not executed successfully.

A procedure that does not explicitly return a value returns 0 by default, thus
aborting a learn sequence.

Note

Learn sequences do not include mouse input or characters inserted in a
widget.

Note

If, while recording a learn sequence, a margin action routine is executed
(such as EVE’s word wrap), the routine may not be executed during the
replay of the sequence.

3.6 Marker Data Type

A marker is a reference point in a buffer. You can think of a marker as a ‘‘place
holder.’’ To create a marker, use the MARK built-in procedure.

The following example assigns a value of the marker data type to the variable x:

x := MARK (NONE);

After this statement is executed, the variable x contains the character position
where the editing point was located when the statement was executed. The
editing point is the point in a buffer at which most editing operations are carried
out.

You can cause a marker to be displayed with varying video attributes (BLINK,
BOLD, REVERSE, UNDERLINE). The NONE keyword in the preceding example
specifies that the marker does not have any video attributes.

When you use the MARK built-in, DECTPU puts the marker on the buffer’s
editing point. The editing point is not necessarily the same as the window’s
cursor position.

A marker can be either free or bound. Free markers are useful for establishing
place marks in locations that do not contain characters, such as locations before
the beginning of a line, after the end of a line, in the white space created by a
tab, or below the end of a buffer. By placing a free marker in such a location, you
make it possible to establish the editing point at that location without inserting
padding space characters that could complicate later operations such as FILL.

3–8 DEC Text Processing Utility Data Types