\section{Page Manipulation Commands}
\label{Page Manipulation Commands}

     The following commands permit text  to  be  read  into  the  text
     buffer  from  an  input  file  or written from the buffer onto an
     output file.

     All of the input commands listed in this table  assume  that  the
     input  file  is  organized  into  pages  small enough to fit into
     available memory.  If any page of the input  file  contains  more
     characters than will fit into available memory, the input command
     will continue reading characters into the  buffer  until  a  line
     feed  is  encountered when the buffer is about 3/4 full.  See the
     appendices for more details.   Special  techniques  for  handling
     pages  larger than the buffer capacity will be presented later in
     this chapter.

\begin{table}[h]
\caption{\bf Page Manipulation Commands}

\end{table}
\nopagebreak

\subsection*{APPEND commands}

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

     \item [{\tt A}]         Appends the next page of the input file to the contents
               of  the  text  buffer,  thus combining the two pages of
               text on a single page with  no  intervening  form  feed
               character.  This command takes no argument.  To perform
               {\tt n} Appends, use the {\tt n<A>} construct.  Note that {\tt nA}  is  a
               completely different command.

\ifnotintecoeight
     \item [{\tt :A}]        Equivalent to the {\tt A} command  except  that  a  value  is
               returned.   -1 is returned if the append succeeded, and
               0  is  returned  if  the  append  failed  because   the
               end-of-the-input-file  had  previously been reached (\caret {\tt N}
               flag is -1 at start of this command).
               {\em [Not in TECO-8]}

     \item [{\tt n:A}]       Appends {\tt n} lines of text from  the  input  file  to  the
               contents  of  the text buffer.  The value of {\tt n} must not
               be negative.  A value is returned indicating whether or
               not  there  were in fact n lines remaining in the input
               file.  -1 is returned if the command succeeded.   0  is
               returned   if   end-of-file   on  the  input  file  was
               encountered before all n lines were read in.  Note that
               the  command  can  succeed and yet read in fewer than {\tt n}
               lines in the case that the text buffer fills up.
               {\em [Not in TECO-8]}
\fi

\subsection*{PAGE Commands}

     \item [{\tt P}]         Writes the contents of the buffer onto the output file,
               then  clears  the buffer and reads the next page of the
               input file into the buffer.  A form feed is appended to
               the  output file if the last page read in (with a {\tt P}, {\tt Y},
               or {\tt A} command) was terminated with a form feed.

\ifnotintecoeight
     \item [{\tt :P}]        Same as the {\tt P} command except that a value is  returned.
               -1 is returned if the command succeeded.  0 is returned
               if the command failed because the  end-of-file  on  the
               input  file had been reached prior to the initiation of
               this command.  The command string {\tt <:P;>}  takes  you  to
               end of file.
               {\em [Not in TECO-8]}
\fi

     \item [{\tt nP}]        Executes the {\tt P} command {\tt n}  times,  where  n  must  be  a
               non-zero positive integer.

               In TECO-11 on VAX/VMS, n can be a negative integer (and
               {\tt -P} means {\tt -1P}).  A {\tt -nP} command will back up {\tt n} pages.

\ifnotintecoeight
     \item [{\tt n:P}]       Executes the {\tt :P} command {\tt n} times,  where  {\tt n}  must  be  a
               non-zero  positive  integer.   In TECO-11 on VAX/VMS, n
               can be a negative integer (and {\tt -:P} means  {\tt -1:P}).   This
               command returns 0 when another page could not be backed
               up because beginning of file had been reached.
               {\em [Not in TECO-8]}
\fi

     \item [{\tt PW}]        Write the contents of the buffer onto the  output  file
               and  append  a  form feed character.  The buffer is not
               cleared and the pointer position remains unchanged.

     \item [{\tt nPW}]       Executes the {\tt PW} command {\tt n} times,  
		where  {\tt n}  must  be  a non-zero positive integer.

     \item [{\tt m,nPW}]     Writes the  contents  of  the  buffer  between  
		pointer
               positions  {\tt m}  and {\tt n} onto the output file.  {\tt m} 
		and {\tt n} must
               be positive integers.  A form feed is not  appended  to
               this  output,  nor  is the buffer cleared.  The pointer
               position remains unchanged.

     \item [{\tt m,nP}]      Equivalent to {\tt m,nPW}.

     \item [{\tt HPW}]       Equivalent to the {\tt PW} command except that  
		a  form  feed
               character is not appended to the output.

     \item [{\tt HP}]        Equivalent to {\tt HPW}.

\subsection*{YANK commands}

     \item [{\tt Y}]         Clears the text buffer and then reads the next page  of
               the  input file into the buffer.  Because the {\tt Y} command
               DESTROYS the current text buffer, its use can result in
               the  loss  of data, and is subject to {\em Yank protection}
               (see {\tt ED} flag in section~\ref{Conditional Execution Commands}).

	% \ifvmstrue
     \item [{\tt -Y}]        Clears the text buffer and then reads the 
		previous page
               of the file being edited back into the buffer.  Because
               the {\tt Y} command DESTROYS the current text buffer, its use
               can result in the loss of data, and is subject to {\em Yank
               protection}  (see {\tt ED} flag in 
		section~\ref{Conditional Execution Commands}).
               {\em [TECO-11 on VAX/VMS only]}
	% \fi

\ifnotintecoeight
     \item [{\tt :Y}]        Same as the {\tt Y} command but a value is returned.   -1  is
               returned  if  the Yank succeeded.  0 is returned if the
               Yank failed because the end-of-file had been reached on
               the input file prior to the initiation of this command.
               {\em [Not in TECO-8]}
\fi

     \item [{\tt -:Y}]       Same as the {\tt -Y} command but a value is returned.  -1  is
               returned  if  the Yank succeeded.  0 is returned if the
               Yank failed because the  beginning  of  file  had  been
               reached   on   the  file  being  edited  prior  to  the
               initiation of this command.
               {\em [TECO-11 on VAX/VMS only]}

	\item [{\tt EY}]        Same as  the  {\tt Y}  command,  but  
		its  action  is  always
               permitted   regardless   of   the  value  of  the  Yank
               Protection bit in the  {\tt ED}  flag.   Remember  that  Yank
               DESTROYS  the current buffer;  there's no way to get it
               back!

\ifnotintecoeight
     \item [{\tt :EY}]       Same as the  {\tt :Y}  command,  but  its  action  is  always
               permitted   regardless   of   the  value  of  the  Yank
               protection bit in the  {\tt ED}  flag.   Remember  that  Yank
               DESTROYS  the current buffer;  there's no way to get it
               back!
               {\em [Not in TECO-8]}
\fi
\end{list}
