\documentstyle[a4,12pt]{article}
\begin{document}
\author{APM Manual pages}
\title{APM Command Interpreters}
\maketitle
\parskip .1 in
\setcounter{secnumdepth}{10}
\parindent 0in
\section{Preamble}
This file describes the facilities of the standard CLI and then the
additional facilities of the RDW's alternative CLI.

To use the RDW CLI reboot (use $\hat{ }${}T R) off filestore b:: (15) with file
RDW:sys.mob

This CLI is a variant of the standard CLI but with some additional features.
No support is guaranteed for it but RDW, RMM et al will be interested to hear
views.

**** STOP PRESS **** Now runs on wyses and VT100's \hspace{ 0.2 in} boot to

rdw:wsys.mob

\section{The Standard CLI}
The Command Line Interpreter processes the character stream coming from either
the terminal or from a .com file and then acts upon it. \hspace{ 0.2 in} It reads from the IMP
stream zero and thus a program may, by opening an input file to stream zero,
cause that file to be 'obeyed' when the program stops. Similarily if a program
wishes to abort a .com file from which it has been called it may close the input
stream zero.
\subsection{Symbol Assignment}
This takes the form

\} Symbol'='String

with no space between the last character of the symbol and the = sign.
Subsequent use of the symbol as a command verb will cause its translation into
its string equivalent.

Note that supression of Symbol translation is available.


\subsection{Translation Supression}
If a verb is typed in and immediately followed by a '\_' character, the verb will
not be translated. \hspace{ 0.3 in} Typically this would occur when a user wishes to run a
program called, say a.mob. Typing of just 'A' would cause the analyse program
to be run. Typing of 'A\_' would cause his program user:a.mob to be run.


\subsection{Verify}
If the symbol verify is present and equal to an \%odd number then each translated
command line is typed out to the terminal before it is 'obeyed'.


\subsection{Leading \{}
Any command line may be preceded by a \{ symbol. This is for historic reasons. It
is ignored.


\subsection{Comments}
If a line starts with a single exclamation mark (!) then the line is treated
as a comment and ignored.


\subsection{Typing to a terminal}
If a line starts with two exclamation marks (!!) then the line is ignored but it
is typed out (without the !!) to the terminal. The newline at the end may be
supressed by making the last non space character of the line a ':'.


\subsection{Line Continuation}
If the last character of a line is a '-' then this is ignored as is the line
break. This has the characteristic of allowing line continuation. \hspace{ 0.3 in} Note that
the line is limited to 255 characters.

\subsection{Command file}
Calling of command files is of the form

\} @file [p1 [p2.... \hspace{ 0.3 in} p8]]

This causes the command file to be 'obeyed'. If the parameters are present then
they are stored for access as detailed below.

\%NOTE that if another file is obeyed (either directly using the @ or as a result
of a program) at the end of \%that file control is passed back to the \%terminal.


\subsection{Parameter acquisition}

Parameters are accessed in the form \%$<$number$>$. Only the first eight parameters
are processed. Parameter substitution is just string substitution.

Note that this facility operates at terminal level (with null parameters). Thus
typing \%1 will cause a null string to be substituted. If the string \%1 is
required then \%\%11 will have to be typed.


\section{RDW Stack based CLI}
This is based upon the standard cli in such a manner that a naive user need not
be aware of its presence. It has however some additions. Notably the current
line is readily edited, a stack-based history is maintained and there is a
macro substitution facility.

The CLI is at present tied to the Visual 200 terminal but a version for the Wyse
will be released as soon as these terminals come into common use.
\subsection{Editing.}
In addition to the standard control characters (BS $\hat{ }${}U and $\hat{ }${}X) the command line
may, at any time be edited using the DEL button and the $<$- and -$>$ cursor keys.
All other keys (except where detailed below) behave as in the original CLI.
Pressing return causes the \%whole line to be processed (cf the Apollo).


\subsection{History}
This is of the form of a list of the last 15 commands. If a command is
duplicated then the original command is deleted and reappears at the head of the
stack.

The complete list may be viewed by pressing the HOME button. Individual
commands may be selecetd by using the up and down cursor keys. When the
required command is reached it may be edited or just submitted by using the
carriage return key.

\subsubsection{Deleting the history}
This may be acieved by pressing the CL button (CONVERT + HOME).

\subsubsection{Affecting the rememberance of history}
Normally all commands entered interactively (ie from the keyboard) are
remembered and those from files not. This may be affected by use of the \{ and [
characters.

If a line \%starts with a \{ it is \%always remembered.

If a line \%starts with a [ it is \%never remembered.


\subsection{Macros}
All the function keys and all the keypad keys are available for macro
definition. Macros are translated by looking up an associated symbol. These
are:

\hspace*{ 0.3 in} F0 .. F13 for the function keys.
\\ \hspace*{ 0.3 in} KENTER, KMINUS, KSTOP, KCOMMA and K0 .. K9 for the keypad keys.
\\ \hspace*{ 0.3 in} SKMINUS, SCOMMA and SK0 .. SK9 for the shifted (CV +) keypad keys.

In order to avoid the difficulty of remembering these names, the keys default to
their associated symbol. Thus to define a key to a macro all that needs to be
done is to press the requisite key then '=' and then the equivalence string.

\%Note symbol assignments, if made within a login session, are lost at the end of
that session.

\subsubsection{Forcing a carriage return}
If a macro equivalence ends with a $\hat{ }${} character; when the requisite key is
depressed the $\hat{ }${} is stripped off and the command line is interpreted immediately.

Thus if we type

\}F0=[gmc:z$\hat{ }${}

subsequent depressions of F0 will cause the screen to be cleared immediately
with no addition to the history.


\subsection{Prompt}

If the symbol PROMPT is in existance then its translation is used as the CLI
prompt. The default prompt is '\} '.

\subsection{\%}
If the input is from the keyboard then the \% charcter is passed straight through
to the interpreter.

\subsection{Drawbacks, support and access}
\subsubsection{Drawbacks}
There is, to my knowledge only one drawback. This occurs when programs (notably
the 'l' program) read terminal io and then 'stuff it back up the buffer'. This
will cause the line to be echoed twice.

\subsubsection{Support}
Bugs to RDW. PLEASE NOTE that what the cli does stops the minute you depress
carriage return. Hanging and so forth from then on is the fault of THE PROGRAM
YOU ARE RUNNING.

\subsubsection{Access}
At present reboot to machine b:: (15) and to file RDW:SYS.MOB



\vspace{.75in} view:Cli printed on 09/02/89 at 16.54

\newpage
\tableofcontents
\end{document}
