Library /sys$common/syshlp/TPUHELP.HLB  —  SET(MOVE_VERTICAL_CONTEXT)
  SET(MOVE_VERTICAL_CONTEXT)

  Sets a buffer's target column for MOVE_VERTICAL operations when the
  COLUMN_MOVE_VERTICAL setting is turned on.  The target column, or context,
  is an attribute specifying the horizontal region in which DECTPU tries to
  keep the cursor during successive MOVE_VERTICAL operations.  DECTPU
  represents the buffer's context as an encoded integer.

  Syntax

     SET (MOVE_VERTICAL_CONTEXT, buffer, integer)

  Parameters

     MOVE_VERTICAL_CONTEXT   A keyword indicating that the SET built-in is
                             being used to set a buffer's context.  The
                             context controls where, in the horizontal
                             dimension, the cursor can move during
                             MOVE_VERTICAL operations.

     buffer                  The buffer whose context you want to set.

     integer                 An encoded integer representing the context
                             value.  To derive the value representing the
                             buffer's context, DECTPU uses two pieces of
                             information.  One is the screen column in which
                             DECTPU tries to keep the cursor during
                             MOVE_VERTICAL operations.  The other is the
                             status of the cursor at the time the context is
                             set.  The algorithm used to encode the integer
                             is not public.  Do not attempt to specify an
                             actual integer value as a parameter to SET
                             (MOVE_VERTICAL_CONTEXT).  Instead, direct
                             DECTPU to assign the correct integer value to a
                             variable by using the following GET_INFO call:

                             int := GET_INFO (buffer, "move_vertical_context").

                             You can then use the variable to specify the
                             integer parameter to SET (MOVE_VERTICAL_CONTEXT).

  Comments

     Although you can use SET (COLUMN_MOVE_VERTICAL) to keep the editing
     point and cursor in or near one screen column during MOVE_VERTICAL
     operations, the POSITION built-in can interfere with the operation of
     SET (COLUMN_MOVE_VERTICAL).  The POSITION built-in has the side effect
     of resetting the column to which DECTPU tries to position during
     subsequent MOVE_VERTICAL operations.  (The column that DECTPU tries to
     keep the cursor near is called the context.) Because of this side
     effect, programmers need a way to save the value of a buffer's context
     before a POSITION operation and to reset the context to the saved value
     after the POSITION operation.  To save the current context value, use a
     statement similar to the following:

     the_context := GET_INFO (CURRENT_BUFFER, "move_vertical_context");

     To set the context back to that value after using POSITION, use a
     statement similar to the following:

     SET (MOVE_VERTICAL_CONTEXT, CURRENT_BUFFER, the_context);

     Note that you must use the GET_INFO call shown here to obtain the
     buffer's context value before you use POSITION.  There is no way to
     obtain or specify the old context value after you use POSITION.

  Example

     saved_context := GET_INFO (CURRENT_BUFFER, "move vertical_context");
     saved_location := MARK (FREE_CURSOR);
     POSITION (message_buffer);
     COPY_TEXT ("Unless you save the context before you use POSITION,");
     COPY_TEXT ("you cannot restore the context after POSITION changes it.");
     POSITION (saved_location);
     SET (MOVE_VERTICAL_CONTEXT, CURRENT_BUFFER, saved_context);

     This code fragment saves the value of the current buffer's context
     before DECTPU positions the editing point to another buffer.  After
     repositioning to the first buffer, the code sets the buffer's context
     back to its previous value.

  Related topics

     CURRENT_COLUMN    CURRENT_OFFSET    CURSOR_VERTICAL
     GET_INFO(buffer_variable)           GET_INFO(SYSTEM)
     MOVE_VERTICAL     POSITION          SET(COLUMN_MOVE_VERTICAL)
Close Help