\chapter{Invoking TECO}
\label{Invoking TECO}
     
\section{Running TECO}
\label{Running TECO}

     To run TECO with no special options or  defaults,  use  the  same
     command  on  your  operating system that you would use to run any
     other program.  The command is system dependent  but  is  usually
     something like

\smallskip
\centerline {{\tt RUN TECO}}

     Consult the  appendix  that  describes  your  operating  system's
     characteristics for details.


\section{Creating a new file}
\label{Creating a new file}

     As described in Chapter~\ref{Basics of TECO}, most operating systems  
	use  the  same
     command to invoke TECO for the purpose of creating a new file:

\smallskip
\centerline {{\tt MAKE filespec}}
\index{files}

     The {\tt MAKE filespec} command takes as its single argument the file
     specification   for   the   file   to   be  created.   This  file
     specification must  conform  to  the  conventions  used  by  your
     operating  system.   If  a file by that name already exists, TECO
     will give  you  a  warning  message  telling  you  that  you  are
     superseding an existing file.

     The  {\tt MAKE}  command  invokes  TECO  and  performs   an   effective
     {\tt EWfilespec} \escape\escape  command, as described in 
	Chapter~\ref{Basics of TECO}.


\section{Editing an existing file}
\label{Editing an existing file}

     As Chapter~\ref{Basics of TECO} states, most operating systems use the same  command
     to invoke TECO for the purpose of editing an existing file:

\smallskip
\centerline{{\tt TECO filespec}}
\index{filespec}

     The {\tt TECO filespec}  command  takes  as  its  argument  the  file
     specification for the file to be edited.  The file will be opened
     for input and output, with back-up protection.  That  means  that
     the  system will save the original version of the source file (in
     case you `blow' the edit).  If  your  operating  system  supports
     file  version  numbers,  a  new version will be created.  If your
     operating system does  not  support  file  version  numbers,  the
     original  file will be preserved in a file with the same name but
     with a backup extension ({\tt.BAK}).

     The  {\tt TECO}  command  invokes  TECO  and  performs   an   effective
     {\tt EBfilespec}\escape{\tt Y}\escape\escape   command.  Note that the first page of the file is
     brought  into  memory  and  that  the  text  buffer  pointer   is
     positioned at the start of the file.

     If, at any time during the edit, you discover that  the  edit  is
     invalid,  slowly  (so  TECO  can  respond  to  them)  type enough
     {\tt <CTRL/C>}s to get you back to the operating system.  You will find
     that your original file has been preserved.

     TECO remembers the filespec given in a {\tt MAKE} or {\tt TECO} command.   
	If
     TECO  is  invoked  with  the command {\tt TECO}, with no filespec, it
     will open the file edited last (i.e., the remembered filespec).


\section{Switches on TECO and MAKE commands}
\label{Switches on TECO and MAKE commands}
\index{switches}

     The {\tt TECO} and {\tt MAKE} commands can take switches (qualifiers) of  the
     form {\tt /SWITCH}.  These switches are described below.

\smallskip
\centerline{SWITCHES ON COMMAND LINES}
\medskip
\nopagebreak

\begin{tabular}{lll}
     System    & Switch         & Meaning \\

\index{{\tt SIZE} switch}
     RSTS/E    & {\tt /SIZE:n}        & start with {\tt nK} word editing area. \\
               & {\tt /SIZE:+n}       & start  with  {\tt nK}  additional   words   of \\
               &                & editing area. \\

     RSTS/E    &                & \\
     RSX-11    &		& \\
\index{{\tt INSPECT} switch}
     VAX/VMS   & {\tt /INSPECT}       & Do not create an output file \\
\index{{\tt FIND} switch}
               & {\tt /FIND}          & Initially  position  to   the   position \\
               &                & marker  left  in  the file by the VTEDIT \\
               &                & macro and delete the marker. \\
\index{{\tt NOCREATE} switch}
               & {\tt /NOCREATE}      & Do not automatically create a  new  file \\
               &                & if   the  file  specified  by  the  TECO \\
               &                & command does not exist. \\
\index{{\tt NOINI} switch}
               & {\tt /NOINI}         & Do   not   use   {\tt TECO.INI}   to   perform \\
               &                & initialization. \\
\index{{\tt NOMEMORY} switch}
               & {\tt /NOMEMORY}      & Do not  remember  the  argument  to  the \\
               &                & invocation command. \\
\index{{\tt SCROLL} switch}
               & {\tt /SCROLL}        & Automatically   enter    split    screen \\
               &                & scrolling   mode,   using   $1/4$  of  the \\
               &                & screen's lines  as  the  scrolling  area \\
               &                & (available on VT100 terminals only). \\
\index{{\tt VTEDIT} switch}
               & {\tt /VTEDIT}        & Load VTEDIT video terminal editor. \\

\end{tabular}

	The /SCROLL switch may take a value of the following form:

\begin {tabular}{lll}

       & {\tt /SCROLL:n} & Enter split screen scrolling mode, using \\
       &		& {\tt n} lines for the scrolling area. \\

\end {tabular}

     The /VTEDIT switch may also take values (of the form {\tt :value}).

\begin {tabular}{lll}

	& {\tt /VTEDIT:HOLD} & Start up in hold screen mode \\
        & {\tt /VTEDIT:SEEALL} & Start up in SEEALL mode \\

\end {tabular}

     These values can be combined, viz.:  {\tt /VTEDIT:HOLD:SEEALL}.
              
\section{Invoking a TECO program}
\label{Invoking a TECO program}

     All operating systems except TOPS-10 and  TOPS-20  use  the  same
     command  to let you start up execution of a TECO program (macro).
     This is the {\tt MUNG} command.

\index{{\tt MUNG}}
     The {\tt MUNG} command has the form

\smallskip
\centerline {{\tt MUNG filespec}}
\smallskip

     where {\tt filespec} is the name of the TECO program that is to be run.
     If  no  file extension (file type) is specified, {\tt .TEC} is assumed.
     This command executes the  TECO  code  that  appears  within  the
     specified  file.   It  invokes  TECO  and  performs  an effective
     {\tt EIfilespec} \escape \escape  command (consult the appendices for operating-system
     dependent  differences).   The  contents  of  the  specified file
     should generally end with a double ESCAPE so that execution  will
     start immediately.

     Another form of this command is

\smallskip
\centerline {{\tt MUNG filespec,data}}
\smallskip

     where {\tt data} is any string of ASCII characters to  be  passed  to
     the  TECO program.  This version of the MUNG command invokes TECO
     and issues an effective

\smallskip
\centerline {{\tt Idata} \escape {\tt EIfilespec} \escape\escape}
\smallskip

     command.  Under TECO-11, a space, tab, or a slash ({\tt /}) may be used
     instead of the comma.

\section{User Initialization}
\index{{\tt TECO.INI}}

     You can specify initialization commands to  TECO  by  creating  a
     file  called  {\tt TECO.INI}.   If,  upon  start-up,  TECO finds a file
     called {\tt TECO.INI} in your area, TECO executes the commands in  that
     file.   You  can  use  {\tt TECO.INI} commands to set initial values of
     flags and to tailor TECO to your needs.  You  must,  however,  be
     very  careful  in  constructing  code for your {\tt TECO.INI} file:  an
     error in this code may keep TECO from running at all!

     If you include unusual commands in your initialization file,  you
     would  be  prudent to surround such commands with the {\tt ?}  command.
     This causes TECO to type the commands out when they are  executed
     (see  section \ref{Tracing}).   You  should  also  print an informative
     message on the terminal reminding other users that  this  version
     of TECO has been customized.

     Example 1: \\
     \nopagebreak
     \centerline{{\tt ?1ED?}}
\smallskip
\index{{\tt ED} flag}

     The user initialization file sets the ED flag  to  1  so  that  \caret 
     characters  in  search strings have their traditional meaning (do
     not convert the next character to a control character).  The file
     also causes the command to be typed out when it is executed.

     Example 2: \\
     \nopagebreak
\centerline{{\tt 0,16ED}\caret{\tt A} [Dot preserved on failing searches] \caret{\tt A13}\caret{\tt T10}\caret{\tt T}}
\smallskip

     The user initialization file causes future search string failures
     to  preserve  the  pointer  position.   It  also prints a message
     informing all users of this feature.

     In TECO-11, the {\tt TECO.INI} commands  may  return  a  value  to  the
     command processor.  Such a value, if present, is interpreted as a
     set of bit encoded flags that  control  the  startup  processing.
     In TECO-11, the {\tt TECO.INI} commands  may  return  a  value  to  the
     command processor.  Such a value, if present, is interpreted as a
     set of bit encoded flags that  control  the  startup  processing.
     The following bits may be set:

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

	\item [{\tt Value\&1}]   Automatically load the VTEDIT  macro  (as  if
                         the user had typed {\tt TECO/VTEDIT}).

	\item [{\tt Value\&4}]   Inhibit use of the memory  file  (as  if  the
                         user had typed {\tt TECO/NOMEMORY}).

	\item [{\tt Value\&16}]  Automatically load VTEDIT  and  start  it  in
                         SEEALL   mode  (as  if  the  user  had  typed
                         {\tt TECO/VTEDIT:SEEALL}).

	\item [{\tt Value\&32}]  Automatically load VTEDIT  and  start  it  in
                         HOLDSCREEN  mode  (as  if  the user had typed
                         {\tt TECO/VTEDIT:HOLD}).

	\item [{\tt Value\&128}] Automatically enter  split  screen  scrolling
                         mode (as if the user had typed {\tt TECO/SCROLL}).

	\item [{\tt Value\&256}] Inhibit automatic creation of the output file
                         if  the  input file does not exist (as if the
                         user had typed {\tt TECO/NOCREATE}).

\end{list}

     For  additional  information  on  initialization,   consult   the
     operating system specific appendices.
