TPUHELP.HLB  —  POSITION
  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 | BUFFER_BEGIN | BUFFER_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 number of the record where you want DECTPU to position
                the editing point.  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.  In the non-DECwindows version of DECTPU, POSITION
                (MOUSE) is only valid during a procedure that is executed as
                a result of a mouse click.  In the DECwindows version of
                DECTPU, you can use the statement POSITION (MOUSE) at any
                point after the first keyboard or mouse button event.  The
                statement positions the editing point to the location
                occupied by the pointer cursor at the time of the most
                recent keyboard or mouse-button event.

  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.

  BUFFER_BEGIN  A keyword specifying that the cursor is to be moved to line
                1, offset 0 in the current buffer.  This is the first
                position where a character could be inserted, regardless of
                whether there is a character there.  This is the same as the
                point referred to by BEGINNING_OF (CURRENT_BUFFER).  It is
                more efficient to use BUFFER_BEGIN than BEGINNING_OF
                (CURRENT_BUFFER).

  BUFFER_END    A keyword specifying that the cursor is to be moved to the
                last position in the buffer where a character could be
                inserted, regardless of whether there is a character there.
                This is the same as the point referred to by END_OF
                (CURRENT_BUFFER).  It is more efficient to use BUFFER_END
                than END_OF (CURRENT_BUFFER).

  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
Close Help