POSITION
Moves the active editing point to a new location. POSITION does not
always synchronize the cursor position with the editing point; it does so
only if the current buffer is mapped to a visible window.
Syntax
POSITION ({buffer | marker | range | window | integer | MOUSE
| LINE_BEGIN | LINE_END})
Parameters
buffer The buffer in which you want to establish the editing point
(the last position you occupied in the buffer).
marker The marker at which you want to establish the editing point.
When you position to a marker, the character or location to
which the marker is tied becomes the active point and the
buffer where the marker is located becomes the new current
buffer.
range The range to which you want to move the active point (the
beginning of the range). Also moves to the buffer
containing that range.
window The window in which you want to put the editing point (the
row and column position you last occupied in that window).
The window must be mapped to the screen.
integer The integer value 0. This parameter has been defined as
legal to suppress possible errors from statements such as
POSITION (SEARCH (pattern...)). The statement POSITION (0)
has no effect, but does not generate an error.
MOUSE A keyword specifying that the cursor is to be moved to the
window and buffer pointed to by the mouse. The location of
the mouse becomes the editing point, the window where the
mouse is located becomes the new current window, and the
buffer where the mouse is located becomes the new current
buffer. POSITION (MOUSE) is only valid during a procedure
that is executed as a result of a mouse click.
LINE_BEGIN A keyword specifying that the cursor is to be moved to the
beginning of the current line.
LINE_END A keyword specifying that the cursor is to be moved to the
end of the current line.
Examples
1. user_mark := MARK(NONE);
POSITION (user_mark);
Sets the current character position to the marker associated with the
variable USER_MARK.
2. The following procedure changes position from one window to another
(when there are two windows on the screen):
PROCEDURE user_switch_window_position
IF CURRENT_WINDOW = main_window
THEN
POSITION (extra_window);
ELSE
POSITION (main_window);
ENDIF;
ENDPROCEDURE;
Related topics
CURRENT_BUFFER CURRENT_WINDOW LOCATE_MOUSE MARK UPDATE