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

     Specifies the code to be executed when the TPU main input loop
     detects that the current cursor position is detached (that is, that the
     cursor position cannot accurately represent the editing point in the
     current window).

  Syntax

     SET (DETACHED_ACTION, SCREEN [, {buffer | learn | program |
                                      range | string}]

  Parameters

     DETACHED_ACTION      A keyword indicating that the SET built-in is
                          being used to designate the detached cursor action
                          routine.

     SCREEN               A keyword indicating that the detached action
                          routine is being set for all buffers and windows
                          used during the session.

     buffer               The buffer containing the detached cursor action
                          routine.

     learn                The learn sequence that is executed as the
                          detached cursor action routine.

     program              The program containing the detached cursor action
                          routine.

     range                The range containing the detached cursor action
                          routine.

     string               The string containing the detached cursor action
                          routine.

  Comments

     If you do not specify the optional third parameter, SET
     (DETACHED_ACTION) deletes the current detached action routine.

     To fetch the current detached action routine, use GET_INFO (SCREEN,
     "detached_action").  To find out which of the five possible detached
     states the cursor is in, use GET_INFO (SCREEN, "detached_reason").

  Example

     The following procedure is a simple detached cursor action routine:

     PROCEDURE detached_routine

     LOCAL rightmost_column,
           the_offset;

     rightmost_column := GET_INFO (CURRENT_WINDOW, "right", VISIBLE_TEXT);

     the_offset := GET_INFO (CURRENT_BUFFER, "offset_column");

     IF the_offset > rightmost_column

        THEN SHIFT (CURRENT_WINDOW, the_offset - rightmost_column + 2)

     ENDIF;

     UPDATE (CURRENT_WINDOW);

     ENDPROCEDURE;

     Given this definition of the procedure "detached_routine", the
     following statement designates this procedure as an application's
     detached action routine:

     SET (DETACHED_ACTION, SCREEN, "detached_routine");

  Related Topic

     GET_INFO(SCREEN)
Close Help