\chapter{RT-11 Operating Characteristics}
\label{RT-11 Operating Characteristics}

\section{Startup}


     TECO is started with the

\begin{verbatim}
               .R TECO
\end{verbatim}

     command.  TECO is now immediately ready to accept commands.   The
     text buffer and Q-register areas are empty.

     The EDIT command

\begin{verbatim}
               .EDIT/TECO filespec
\end{verbatim}

     is used to edit an already existing file.  It is equivalent to

\begin{verbatim}
		.R TECO
               *EBfilespec`Y``
\end{verbatim}

     For those RT-11 users that will use TECO as the primary editor, a
     monitor {\tt SET} command is provided:

\begin{verbatim}
               .SET EDITOR TECO
\end{verbatim}

     Once this command is issued, the {\tt /TECO} option on the {\tt EDIT}
	 command
     is  no  longer  necessary  since  the default editor is now TECO.
     Since this {\tt SET} command only has affect between system bootstraps,
     it  is  recommended that the command be placed in the appropriate
     startup file (e.g., {\tt STARTS.COM}).

     Now, assuming the {\tt SET} command has been issued, the command

\begin{verbatim}
               .EDIT filespec
\end{verbatim}

     can be used to edit an already existing file. The standard RT-11 
	{\tt EDIT} command options are  all  available  with     TECO.

\begin{verbatim}
               .EDIT/CREATE filespec
               .EDIT/INSPECT filespec
               .EDIT/OUTPUT:filespec filespec
\end{verbatim}

     Another option, {\tt /EXECUTE}, is also available:

\begin{verbatim}
               .EDIT/EXECUTE[:string] filespec
\end{verbatim}

     The {\tt /EXECUTE} option causes TECO to process the filespec  (assumed
     {\tt .TEC}  filetype)  as a set of TECO commands.  If {\tt string} is used,
     the string is  placed  into  TECO's  text  buffer.   If  {\tt string}
     contains  only  alphanumeric  characters,  it does not have to be
     enclosed in quotes.  If it is  to  contain  blanks,  it  must  be
     quoted with single quotes.  The equivalent TECO commands would be

\begin{verbatim}
               .R TECO
               *ERfilespec`YHXZHKIstring`MZ``
\end{verbatim}

     Note the input file remains open and can provide  more  input  to
     the macro.


\section{File Specification}


     The file access commands  {\tt ER},  {\tt EB},  {\tt EI},  and  
	{\tt EW}  accept  a  file
     specification in the standard RT-11 format:

\begin{verbatim}
               dev:filename.type
\end{verbatim}

     in which dev:  is a physical  device  name  or  a  user  assigned
     logical  name;   if  {\tt dev:}   is not specified, the default 
	{\tt DK:}  is
     assumed.  The filename field must be specified  in  the  commands
     {\tt ER}, {\tt EB}, {\tt EI}, and {\tt EW} and be a legal 
	RT-11 filename.  The type field
     is a file extension and must be explicitly given if  used  (there
     is  no default).  The {\tt EB} and {\tt EW} commands also accept 
	the extended
     notation for an output file size

\begin{verbatim}
               dev:filename.type[n]
\end{verbatim}

     The optional {\tt [n]} specifies the output file size where  {\tt n}
	  is  the
     number of blocks to be allocated.


\section{Backup Files}


     The {\tt EB} command maintains one level of file backup on RT-11.   The
     pre-edited input file name is changed to

\begin{verbatim}
               filename.BAK
\end{verbatim}

     before the new output file is  closed  with  the  original  name.
     Only normal file closing commands ({\tt EC}, {\tt EF}, {\tt EG}, and 
	{\tt EX}) cause this
     renaming to happen.  If TECO is aborted or  the  output  file  is
     purged  by  the {\tt EK} command, the input filename remains unchanged.
     Note only one {\tt .BAK} file for a given name is kept;   earlier  
	{\tt .BAK}
     backup files are deleted each time a new backup file is created.

     A good policy to follow when editing is to close the edited  file
     frequently  enough so that an unexpected incident would not cause
     a substantial loss of work.  Files should be backed up regularly.
     TECO  has the power to let an unsuspecting user alter a good file
     into a completely useless state.  The {\tt SRCCOM} program can be  used
     to verify an editing session.


\section{Exit And Go}


     If TECO is exited via the {\tt EGstring}\escape command, the string 
	is passed
     to the system as the next command to execute.  This string may be
     any valid command or an indirect command file specification.


\section{Reenter And Close}
\label{Reenter And Close}

     The RT-11 {\tt REENTER} command may always be used  to  continue  TECO.
     Its primary differences from running TECO is that when {\tt REENTER} is
     used, the text buffer and Q-register  areas  are  unmodified,  as
     opposed  to when TECO is run the text buffer and Q-register areas
     are cleared.  The input and output  file  are  always  lost  upon
     reentering  TECO.   If  an output file was open before reentering
     TECO, the file will have to be  recreated  with  the  appropriate
     {\tt E}-command.   (Note that the monitor commands {\tt GT ON}, {\tt GT OFF}, 
	{\tt LOAD},
     and {\tt UNLOAD} disallow a {\tt REENTER}.)

     The output file is not closed if  TECO  is  aborted.   The  RT-11
     {\tt CLOSE}  command can be used to make the output file permanent, but
     be aware that the output file will not  be  complete  because  of
     internal  buffers that TECO keeps.  TECO may be reentered after a
     {\tt CLOSE} command.


\section{File Recovery}


     TECO can be a useful tool in recovering ASCII  files  lost  on  a
     block  replaceable device.  TECO allows block replaceable devices
     to be opened in a non-file structured mode.  This gives the  user
     the  capability  to open a disk and access ASCII data anywhere on
     it, independent of file boundaries.  The command

\begin{verbatim}
               ERdev:`
\end{verbatim}

     is used to open the  device  at  which  point  {\tt \_}  (underscore  or
     backarrow) searches may be used to locate specific ASCII data and
     transfer it to new output files.  Note that  files  tend  to  get
     reproduced,  in whole or part, many places on a block replaceable
     device;  be sure to verify that any given text is indeed complete
     and the correct version.


\section{System Crash Recovery}
\label{System Crash Recovery}

     TECO and RT-11 are highly reliable, but if  during  an  important
     edit  session a random system failure should occur, the following
     procedure may help save some or all of the editing.

\begin{enumerate}
          \item  Bootstrap the system

          \item  Immediately perform a {\tt SAVE} command to save  as  much  of
              memory  as  possible  into  a  file on {\tt SY:}.  The address
              range form of the {\tt SAVE} command must be used.   The  
		{\tt SAVE}
              command  will  not  allow  any part of the monitor to be
              saved, e.g., if you have a 28K system and are running {\tt SJ}
              you cannot save 28K but only 26.3K.

          \item  Perform standard startup procedures, e.g., {\tt DATE}.

          \item  Use TECO on the {\tt SAVE}d file to  try  and  recover  useful
              parts of the edit.
\end{enumerate}

\section{VT11 Graphics Support}
\label{VT11 Graphics Support}

     If the monitor supports the VT11 graphics  processor  ({\tt GT ON}  and
     {\tt GT OFF}  work)  TECO  will automatically start up in display mode,
     adjusting to both the size of  the  display  screen  and  to  the
     presence or absence of the scroller.

     If the display fails to start  with  a  working  VT11,  TECO  has
     decided  that  there  is  not  enough  free  memory  and will not
     allocate the display file buffer or start the display.

     See Section \ref{Scope Commands} for a description of the available  
	commands  to
     interact with the display.

     Various aspects of the display screen become immediately  obvious
     upon  seeing  them;  the text pointer, its position and shape and
     its  position  between  lines;   wrap  around  of  more  than  72
     characters  per  line;   the  scroller  interaction  and  so  on.
     Experiment with a scratch file for more familiarity.
