\section{Scope Commands}
\label{Scope Commands}

     The {\tt W} command (scope {\em WATCH}) is present in most  implementations
     of  TECO.   There  are two different variations of the {\tt W} command.
     Neither, one, or both may be present.  {\tt ET}  flag  Bits  9  and  10
     indicate which variation(s) are configured and can be used.


\subsection{Video Terminal Scope Commands}
\label{Video Terminal Scope Commands}

     If the VT support  is  present  and  your  terminal  is  a  video
     terminal  (such  as a VT05, VT52, or VT100), {\tt ET} flag Bit 9 (value
     512) will be on.

\begin{table}[h]
\caption{Video Terminal Watch Commands}
\end{table}
\nopagebreak

\begin{list}{}{\labelsep 20pt}

     \item[{\em COMMAND}]        {\em FUNCTION}

     \item[{\tt -1W}]       Refresh the terminal's screen to show the  
	contents  of
               the text buffer.

     \item[{\tt -nW}]       Tell the video terminal screen refresher that  
		the  top
               {\tt n}-1  lines of the screen have been altered.  The screen
               refresher will completely redraw the top {\tt n}-1  lines  of
               the screen upon the next {\tt -1W} command.

     \item[{\tt nW}]        Place the default cursor line at line {\tt n} of 
		the  screen.
               The  initial  default  cursor  line  is  line 16.  This
               command makes the  window  support  forget  the  screen
               image  and  any special associated modes ({\tt SEEALL}, 
		{\tt MARK}, {\tt HOLD}).

     \item[{\tt 0W}]        Equivalent to {\tt 16W}.

     \item[{\tt W}]         Forget screen image and special scope modes.

\iftecoelevenonly
     \item[{\tt -1000W}]    Forget that output was done.   Normally,  if  the  
		user
               outputs  to the terminal with a command such as {\tt T}, 
		{\tt n}\caret{\tt T},
               or  \caret{\tt A},  TECO  will  believe  that  the  window   
		needs
               updating,  and  upon  the  next  {\tt -1W} command, TECO will
               refresh the entire window display.  Issuing the  {\tt -1000W}
               command  informs  TECO  that the output command did not
               destroy the window.
               {\em [TECO-11 only]}
\fi

     The {\tt :W} commands are used to interrogate and set (see {\tt m,n:W}
	 below)
     video  terminal  status information, as well as implement some of
     the  more  advanced  features  of  the  video  terminal   {\em WATCH}
     functions.
\end{list}

\begin{table}[h]

\label{Video Terminal Status Commands}
\caption{\bf{Video Terminal Status Commands}}

\end{table}
\nopagebreak

\begin{list}{}{\labelsep 20pt}

     \item[{\em COMMAND}]        {\em FUNCTION}

     \item[{\tt 0:W}]       Return a number representing the type of scope  
		in  use
               as the editing terminal.  Current values are:

	\begin{list}{}{\labelsep 10pt}

               \item[{\tt 0}]         VT52
\iftecotenonly
               \item[{\tt 1}]         VT61 [TECO-10 only]
\fi
               \item[{\tt 2}]         VT100 in VT52 mode
               \item[{\tt 4}]         VT100 in ANSI mode
               \item[{\tt 6}]         VT05
               \item[{\tt 8}]         VT102 in ANSI mode
               \item[{\tt 10}]        VK100 (GIGI)
	\end{list}
                
     \item[{\tt :W}]        Equivalent to {\tt 0:W}

     \item[{\tt 1:W}]       Return or set the horizontal size of the user's 
		editing
               scope.   This number represents the number of character
               positions available horizontally along the face of  the
               scope.

               If  this  value  is  changed  (see  {\tt m,n:W}  below),  the
               operating  system  is  automatically  informed  of  the
               terminal's  new  width  setting,  and  the  appropriate
               control  sequence  is  issued  to physically change the
               terminal's screen mode (80 versus 132 column  mode)  if
               needed.

     \item[{\tt 2:W}]       Return or set the vertical size of the  user's  
		editing
               scope.   This  number represents the number of lines of
               text that can appear on the  screen  of  the  terminal.
               This  number  is  affected  by use of the {\tt m,7:W} command
               (set scrolling region).

     \item[{\tt 3:W}]       Return or set SEEALL mode.  0  represents  off  
		and  -1
               represents on.  In SEEALL mode, a visible indication is
               shown in the  window  for  every  character,  including
               characters that normally don't print.

     \item[{\tt 4:W}]       Return or set ``mark'' status of window support.  
		0 means
               that  no  mark has been set.  A value of {\tt n} means that a
               mark has been set at buffer {\em dot} position {\tt n}-1.  This
               status is used by software that uses the window support
               and by the support itself in the case  of  scopes  that
               support reverse video.

     \item[{\tt 5:W}]       Return or set the hold mode indicator.  0 means 
		off, -1
               means hold whole screen, and a positive value, {\tt n}, means
               hold all but top and bottom {\tt n} lines.  If hold  mode  is
               on,  then  scrolling  is  inhibited until the cursor is
               about to run off either end of the screen.  This  makes
               the  window  display  more  palatable on terminals on a
               slow line.  If hold mode is on, the window support will
               scroll  the  window  as necessary in an attempt to keep
               the cursor centered.

     \item[{\tt 6:W}]       Returns buffer pointer position of character  
		that  was
               in  the  upper left hand corner of the window as of the
               last {\tt -1W }command.

     \item[{\tt 7:W}]       Return or set the number  of  lines  in  the  
		scrolling
               (command  dialogue)  portion  of  the  screen.  If {\tt n} is
               zero, then split screen scrolling  is  disabled.   When
               split   screen   scrolling  is  enabled,  {\tt n}  lines  (as
               specified) are reserved at the bottom of the screen  to
               scroll  the terminal interaction.  The remainder of the
               screen is used  as  a  display  window  into  the  text
               buffer,   and   is   automatically   updated   by  TECO
               immediately before each command prompt.   This  feature
               functions  only  on  terminals  capable of split screen
               scrolling, such as  members  of  the  VT100  and  VT200
               families.

               The value of {\tt n} must be greater than 1, and scope height
               minus {\tt n} must be greater than 9.

               Whenever the scrolling region's size is modified  (that
               is, whenever an {\tt m,7:W} command is executed), TECO alters
               the scope's height ({\tt 2:W}) accordingly.  For example,  if
               {\tt 2:W}  is currently returning a value of 24, then after a
               {\tt 5,7:W} command {\tt 2:W} will return a value of 19.  
		Executing
               a {\tt 0,7:W} will restore {\tt 2:W} to 24.

     \item[{\tt m,n:W}]     Sets the entity represented by {\tt n:W} to 
		{\tt m} and  returns  a
               value.   If  the  new  setting  has  been accepted, the
               returned value is {\tt m}.  Elsewise, the returned  value  is
               either  the  old  value associated with {\tt n:W} or whatever
               new setting  was  actually  set.   In  all  cases,  the
               returned   value  reflects  the  new  current  setting.
               Specific operating systems may put restrictions on  the
               valid values for {\tt m}.

               Note that each {\tt m,n:W} command returns a value,  even  if
               your only intent is to set something.  Good programming
               practice suggests following any command which returns a
               value with {\tt <DELIM>} or \caret{\tt [} if you don't intend 
		that value
               to be passed to the following command.
\end{list}

\subsection{Refresh Scope Commands}
\label{Refresh Scope Commands}

     If refresh scope support  is  present  and  a  refresh  scope  is
     available  (such  as  a VS60 or a VR12), bit value 1024 of the ET
     flag will be on.


\begin{table}[h]
\caption{\bf{Refresh Scope Watch Commands}}
\label{Refresh Scope Watch Commands}
\end{table}
\nopagebreak

\begin{list}{}{\labelsep 20pt}

     \item[{\em COMMAND}]        {\em FUNCTION}

     \item[{\tt W}]         Update the refresh scope screen to reflect the 
		contents
               of   the  text  buffer  surrounding  the  text  pointer
               ({\em dot}).

     \item[{\tt 0W}]        Turn off the refresh scope display.

     \item[{\tt nW}]        Set the number of lines to be displayed around 
		the text
               pointer to {\tt n}.
\end{list}
