March 14, 2003: The RUNOFF
source file of this document has not been located. This file is the result of scan, OCR, and manual touchup, starting with an original loose-leaf copy of the December 1966 version.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 1
Revised: 12/15/66
Identification
Manuscript typing and editing
TYPSET, RUNOFF
J. Saltzer, X6039
Purpose
The command TYPSET is used to create and edit 12-bit BCD
line-marked files. This command permits editing and
revising by context, rather than by line number. The
command RUNOFF will print out (in a format subject to
control words placed in the file via TYPSET) a 12-bit BCD
line-marked file in manuscript format. RUNOFF contains
several special control features which were not available
with the DITTO command, including type-justification.
References
This work represents one more iteration in the arduous task
of creating an "ultimate" editing scheme. As such, it is
primarily a synthesis of techniques which have been proven
valuable in several separate problem areas. It is felt that
this particular synthesis brings to bear on the editing
problem an easy to use package of techniques, and might
provide a model for an editor on a "next generation"
time-sharing system. Here is a list of some of the sources
of ideas for these commands:
J. McCarthy (Colossal typewriter)
S. Piner (Expensive Typewriter)
P. Samson (Justify)
Comp. Center staff (Input, Edit, and File)
M. L. Lowry (Memo, Modify, and Ditto)
M. P. Barnett (Photon)
V. H. Yngve (Comit, Vedit)
R. S. (Madbug)
A. L. Samuels (Edits)
F. J. Corbato´ (Revise)
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 2
An Edit-by-Context Program
Program Name: TYPSET
Description
TYPSET is a command program used to type in and edit
memorandum files of English text. TYPSET, along with the
command RUNOFF, is a replacement for the (old system)
commands MEMO, MODIFY, and DITTO. Editing is specified by
context, rather than line number, and input is accomplished
at high speed since the program does not respond between
lines.
Usage
TYPSET name
"name" specifies the primary name of a file to be edited, or
of a file to be created; it may be absent, in which case a
file is to be created, and must be named later by the "FILE"
request.
When TYPSET is ready for typing to begin, the word "Input"
or "Edit" is typed, and the user may begin. If he is
creating a file, he begins in high-speed input mode; if he
is editing a file, he begins in edit mode.
High-Speed Input Mode
In high speed input mode, the user may type lines of up to
360 characters in length (e.g., 120 underlined characters)
separated by carriage returns. He does not walt for
response from the program or the supervisor between lines,
but may type as rapidly as desired. The full character set
of his keyboard may be used.
The user leaves high-speed input mode and enters edit mode
by typing an extra carriage return. When switching modes,
the program acknowledges the switch by typing the name of
the new mode, "Input" or "Edit".
Edit Mode
In Edit mode, the program recognizes "requests" of the form
given below. All requests take effect immediately on a copy
of the file being edited. Except where a request is
expected to cause a response, such as "PRINT," successive
requests may be entered immediately on successive lines
without waiting for a response from the program. Each
separate request must begin on a separate line. Program
responses are typed in red, if you use a two-color ribbon.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 3
Character Set
The standard 12-bit character set is available. (See
Section AC.2.01.) The preset erase character is # and the
preset kill character is @ . The 1050 characters lozenge,
cent sign, plus-over-minus, and exclamation point should not *
be used in TYPSET memos. Anticipated future changes to the
1050 character set are not guaranteed to preserve the code
values or existence of these characters.
Requests
Editing is done line by line. We may envision a pointer
which at the beginning of editing is above the first line of
the file. This pointer is moved down to different lines by
same requests, while other requests specify some action to
be done to the line next to the pointer. All requests
except FILE may be abbreviated by giving only the first
letter. Illegal or misspelled requests will be commented
upon and ignored.
For purposes of description, the requests have been divided
into two categories, those necessary for effective use of
the command, and special-purpose requests which are not so
generally useful. The first category includes eight
requests:
LOCATE character string
This request moves the pointer down to the first line
which contains the given character string. Only enough
of the line need be specified to identify it uniquely.
Since the pointer only moves down through the file the
second occurrance of a line containing a given
character string may be located by giving the LOCATE
request twice. The line which has been found is
printed in its entirety.
It is not necessary to count blank characters exactly.
If one blank character appears at some point in the
request string, any number of blank characters or tabs
at the corresponding point in the file will be deemed
to satisfy the request. If 2 blank characters appear
together in the request string, there must be at least
two blank characters or tabs at the corresponding point
in the file, etc.
If the LOCATE request fails to find a line containing
the given character string, a message is printed, and
the pointer is set to point after the last line in the
file. Any requests which were typed in between the
LOCATE which failed and the message from the program
about the failure are ignored. Another LOCATE request
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 4
will move the pointer back to the top of the file to
begin another scan down through the file.
PRINT n
Starting at the pointer, n lines are printed on the
typewriter console. The pointer is left at the last
line printed. If n is absent, 1 line is printed and
the pointer is not moved. If the pointer is not at a
line (e.g., above or below the file, or at a line just
deleted) only a carriage return is typed.
NEXT n
This request moves the pointer down "n" lines. If "n"
is absent, the pointer is moved to the next line.
DELETE n
This request deletes "n" lines, starting with the line
currently being pointed at. The pointer is left at the
last deleted line. If "n" is absent, the current line
is deleted and the pointer not moved.
INSERT new line
The line "new line" will be inserted after the line by
the pointer. The first blank following the request
word is part of the request word, and not part of the
new line. The pointer is set to the new line. To
insert more than one line, give several INSERT
requests, or just type a carriage return to switch to
high-speed input mode. All lines typed are inserted
after the line being pointed at. When the user returns
to edit mode by typing an extra return, the pointer is
set to the last inserted line. If the very first edit
request given is an INSERT, the inserted lines are
placed at the beginning of the file. If an INSERT is
given after the pointer has run off the bottom of the
file, the inserted lines are placed at the end of the
file.
CHANGE /string 1/string 2/ n G
In the line being pointed at, the string of characters
"string 1" is replaced by the string of characters
"string 2". If "string 1" is void, "string 2" will be
inserted at the beginning of the line. Any character
not appearing within either character string may be
used in place of the "slash" character. If a number,
"n", is present, the change request will affect "n"
lines, starting with the one being pointed at. All
lines in which a change was made are printed. The last
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 5
line scanned is printed whether a change was made or
not. The pointer is left at the last line scanned. If
the letter "G" is absent, only the first occurrence of
"string 1" within a line will be changed. If "G" is
present, all occurrences of "string 1" within a line
will be changed. If "string 1" is void, "G" has no
effect. Blanks on CHANGE-request strings must be
counted exactly.
Example:
line: It is a nice day in Boston.
request: CHANGE /is/was/
new line: It was a nice day in Boston.
request: CHANGE xwasxisx
new line: It is a nice day in Boston.
request: CHANGE ' '.' g
new line: It.is.a.nice.day.in.Boston.
request: CHANGE '."
new line: Itis.a.nice.day.in.Boston.
request: CHANGE "tis"t is"
request: CHANGE '.' ' G
request: CHANGE 'on 'on.'
new line: It is a nice day in Boston.
FILE name
This request is used to terminate the editing process
and to write the edited file on the disk. The edited
file is filed as "name (MEMO)". If "name" is absent,
the original name will be used, and the older file
deleted. If no name was originally given, the request
is Ignored and a comment made. If "name" Is given and
a file of that name already exists, the user will be
asked If he wishes to delete the old file. When this
request Is finished, the user returns to command level,
and the supervisor will respond by typing "R" and the
time used.
TOP
This request moves the pointer back to above the first
line in a file.
The following seven requests are handy for special purposes,
but will probably not be used as often as the ones
previously described.
BOTTOM
This request moves the pointer to the end of the file
and switches to input mode. All lines which are then
typed are placed at the end of the file.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 6
ERASE c
The character "c" becomes the erase character.
normally, the character "#" is the erase character.
(The erase character is used to delete the previously
typed character or characters.)
KILL c
The character "c" becomes the kill character.
Normally, the character "@" is the kill character.
(The kill character is used to delete the entire line
currently being typed.)
APPEND character string *
The string of characters "character string" is appended
to the line being pointed at.
VERIFY p
If the parameter, "p" is "OFF", the following program
responses are not automatically typed:
"INPUT" or "EDIT" when the mode is changed.
Lines found by the FIND or LOCATE requests.
Lines changed by a CHANGE request.
If the parameter "p" is "ON", the responses are
restored. The command begins In "ON" mode.
RETYPE new line
The line "new line" replaces the line being pointed at.
The first blank following the request word is part of
the request word and therefore is not part of the new
line.
FIND character string
This request moves the pointer down to the first line
which starts with the given character string.
SPLIT name
All the lines above the pointer are split into a file
called "name (MEMO)". Any old copy of "name (MEMO)" is
deleted. The remainder of the file may still be
edited, and filed under another name. The SPLIT
request may be used several times during a single edit,
if desired. Unless at least one "TOP" request has been
given, "name" must be different from the original name
of the file being split.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 7
QUIT *
This request is used to terminate the editing process
without making any changes to the original file, and
without creating a new file. All intermediate files
are deleted, and the user returns to command level.
Backspacing
The backspace key may be used to create overstuck or
underlined characters. All overstruck characters are stored
in a standard format, independent of the way they were typed
in. CHANGE-, LOCATE- and FIND-request strings are also
converted to this standard format, so it is not necessary to
remember the order in which an overstruck character was
typed in order to identify it. For example, suppose the
line:
The NØRMAL MØDE statement of MAD
had been typed in by typing the letters NORMAL, five
backspaces, a slash, and four forward spaces. The slashed Ø
in NØRMAL can be changed to a standard O by typing
CHANGE 'Ø'O'
Restricted Names and Recovery Procedures
Two special names are used for intermediate files by TYPSET.
They are:
(INPUT FILE)
(INPT1 FILE)
Following a QUIT sequence (or a CTSS system breakdown) one
or both of these files may be found. (Whenever a QUIT
sequence has been given, a SAVE command should be issued to
save the status of all files.) Because the (INPT1 FILE)
generally contains a complete copy of the file since the
last TOP command, it may be renamed and used as a source
file, and may permit recovery of lost requests. The (INPUT
FILE) contains only that part of the file above the pointer,
and therefore contains only a partial record of the original
file. The original file is never deleted until the new,
edited file has been successfully written and closed.
The intermediate files are normally written in permanent
mode. If the user's track quota becomes exhausted while
editing, TYPSET will switch to temporary mode intermediate
files. If it is necessary to leave the edited file in
temporary mode, a comment will be made.
If a new file name is to be created (including these
intermediate files) and the user already has a file of the
same name in his directory, he is first asked if he wishes
to delete the old file.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 8
Summary of TYPSET requests.
abbrev. request response
Basic requests:
L LOCATE string line found *
end-of-file
D DELETE n end-of-file
N NEXT n end-of-file
I INSERT line none
P PRINT n printed lines,
end-of-file
C CHANGE QxxQyyQ n G changed lines *
T TOP none
FILE name Ready message
Special-purpose requests:
B BOTTOM "Input" *
V VERIFY ON (or OFF) none
S SPLIT name no name given
R RETYPE new line none
E ERASE x none
K KILL x none
A APPEND string none *
F FIND string line found *
end-of-file
Q QUIT Ready message *
* These responses will not occur if VERIFY mode is off.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 9
A Right-Justifying Type Out Program
Program Name: RUNOFF
Program Description
RUNOFF is a command used to type out memorandum files of
English text, in manuscript format. Control words scattered
in the text may be used to provide detailed control over the
format. Input files may be prepared by the context editor,
TYPSET.
Usage
RUNOFF NAME1 -P1- -P2- ... -Pn-
NAME1 is the primary name of a file "NAME1 (MEMO)"
to be typed out.
P1,P2, etc., are any number of the
following parameters, in any order:
STOP Pause between pages.
NOWAIT Suppress the initial pause to load paper and
the pause between pages.
PAGE n Begin printing with the page numbered "n".
BALL n Typewriter is using printing ball "n". If
this parameter is omitted, Runoff assumes
that the ball in use will properly print all
CTSS characters in the file. The number "n"
is engraved on top of the printing ball.
CTSS characters not appearing on the ball
being used will be printed as blanks, so that
they may be drawn In.
Control Words
Input generally consists of English text, 360 or fewer
characters to a line. Control words must begin a new line,
and they begin with a period so that they may be
distinguished from other text. RUNOFF does not print the
control words.
.line length n
Set the line length to "n". The line length is preset
to 60.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 10
.indent n
Set the number of spaces to be inserted at the
beginning of each line to "n". Indent is preset to 0.
.undent n
In an indented region, this control word causes a
break, and the next line only will be indented n spaces
fewer than usual. This control word is useful for
typing indented numbered paragraphs.
.paper length n
This control word is used for running off a memorandum
file on non-standard paper. The number "n" is a line
count, figured at 6 lines per inch. If this control
word is not given, "n" is assumed to be 66, for 11-inch
paper.
.single space
Copy is to be single spaced. This mode takes effect
after the next line. (The normal mode is single
space.)
.double space
Copy is to be double spaced. This mode takes effect
after the next line.
.begin page
Print out this page, start next line on a new page.
.adjust
Right adjust lines to the right margin by inserting
blanks in the line. The next line is the first one
affected. (This is the normal mode.)
.nojust
Do not right-adjust lines.
.fill
Lengthen short lines by moving words from the following
line; trim long lines by moving words to the following
line. (This is the normal mode.) A line beginning
with one or more blanks is taken to be a new paragraph,
and is not run into the previous line.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 11
.nofill
Print all lines exactly as they appear without right
adjustment or filling out.
.page -n-
Print page numbers. (The first page is not given a
page number. It has instead a two-inch top margin.
See also "Manuscript Conventions", below.) If "n" is
present, insert a page break and number the next page
"n". Note that RUNOFF does not print completely empty
pages.
.space -n-
Insert "n" vertical spaces (carriage returns) in the
copy. If "n" carries spacing to the bottom of a page,
spacing is stopped. If "n" is absent or 0, one space
is inserted.
.header xxxxxxxxxxxxxxxx
All of the line after the first blank is used as a
header line, and appears at the top of each page, along
with the page number, if specified.
.break
The lines before and after the ".break" control word
will not be run together by the "fill" mode of
operation.
.center
The following line is to be centered between the left
and right margins.
.literal
The following line is not a control word, despite the
fact that it begins with a period.
.heading mode P
This control sequence alters the mode of the running
head to that specified by the parameter "P". Any of
the following parameters are allowed:
CENTER The header will be centered on the page.
MARGIN The header will be adjusted against the right
margin of the page.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 12
FACING On even-numbered pages, the header will be
adjusted against the left margin, on odd
numbered pages against the right.
OPPOSED The header will be adjusted against the
opposite margin from the page number.
In the absence of a .HEADING MODE control
sequence, the default option is OPPOSED.
.odd page
This control word causes the current page to be printed
out, and the next page to be numbered with the next
higher odd page number.
.paging mode P1 P2 ... Pn
This control sequence alters the mode of page
numbering to that specified by the parameter P1, P2,
etc. The P1's may be in any order, and selected from
the following list:
MARGIN Page numbers will be adjusted against the
right margin.
FACING Odd page numbers are adjusted against the
right margin, even page numbers are adjusted
against the left margin.
CENTER Page numbers are centered between the right
and left margin.
TOP Page numbers are placed on the fourth line
from the top of the page.
BOTTOM Page numbers are placed on the fourth line
from the bottom of the page.
OFF Page numbers are discontinued.
PREFIX "string" The string of characters between
quotation marks is prefixed to the page
number. The quotation marks may be next to
each other, in which case no prefix is used.
ROMANU Page numbers will be printed in upper case
Roman numerals.
ROMANL Page numbers will be printed in lower case
Roman numerals.
ARABIC Page numbers will be printed in Arabic.
(This is the normal mode.)
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 13
SET n Set the next page number to be "n".
SKIP n Skip "n" page numbers.
If in a single use of .PAGING MODE several pi's specify
competing functions, the last one specified takes
precedence. When the .PAGING MODE sequence appears in
text at point A, all text up to A (and probably some
text after A) will appear on a page controlled by the
previous paging mode. The new paging mode will take
effect on the next page. Then there is no danger of
getting page numbers both at the top and bottom of the
same page.
Use of the TOP parameter may conflict with the heading
mode. If a heading and a page number should be printed
in the same column, the page number will take
precedence.
In the absence of a .PAGING MODE control sequence, the
default options are: TOP MARGIN PREFIX "PAGE"
.append A
Take as the next input line the first line of A (MEMO).
Note that the whole of A is appended, and that the
appending is an irreversible process - that is, once
RUNOFF encounters the .APPEND control word it will
switch to file A (MEMO) and continue from its first
line. Other text in the original file (which contained
the control word) will not be processed by RUNOFF. The
file A (MEMO) may, of course, itself call for appending
of still another file, and so on.
All control words may be typed in either upper case or lower
case. Illegal control words are ignored by the RUNOFF
command. A comment may appear to the right of a control
word, as long as it is on the same line.
Abbreviations
All control words may be abbreviated if desired. A list of
abbreviations is given in the summary. In most cases, a
single word is abbreviated by giving its first two letters;
two words are abbreviated by giving the first letter of each
word.
Manuscript Conventions
The RUNOFF program assumes a page length of 11 inches, with
6 vertical lines per inch. The top and bottom margins are 1
inch, except for the first page which has a 2-inch top
margin. If a header is used, it will be placed 1/2 inch
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 14
from the top of the page. The first page is not numbered,
nor is it given the header line, unless the control words
".header" and ".page 1" appear before the first line of
text.
Customary margins are 1-1/2 inches on the left and 1 inch on
the right, implying a 60-character line. This is the
standard line length in the absence of margin control words.
Unless restrained from doing so by NOWAIT, the program stops
before the first page for loading of paper. The STOP
parameter will cause a stop between all pages. The paper
should be loaded so that after the first carriage return
typing would take place on line 1 of the paper. The left
margin stop of the typewriter should be placed at the point
typing will begin, and the right margin moved as far right
as possible. Now, when you type the first carriage return,
the program will start typing and continue to the end of the
file.
Tabs
When performing right-adjustment, the RUNOFF command does
not take special account of the tabulate characters.
Therefore, tabs should not be used unless "fill" mode is
off. If tabs on a 1050 are not set at the CTSS standard *
settings of 11, 21, 31, etc., the supervisor may mistime
characters or insert extra carriage returns. For this
reason, use of tab characters is not recommended.
If a memo does use tabs in a section where "fill" is off,
the mechanical tab stops on the typewriter must be set
properly. The following conventions should be used in any
memo which uses tabs: The first two lines of the memo
should contain two comments, beginning with the words ".SET
TABS AT", followed by a string of blanks and x's, with the
x's positioned at the desired tab stop positions. The
second comment should be ".TABS SET AT" followed by a string
of tabs and x's. If the typewriter is correctly set up, the
typset request "PRINT 3" will cause the two lines to be
printed out with the x's lined up. Since the supervisor *
assumes that tab stops are at 11, 21, 31, etc., a line with
too many tab characters may appear to overflow the carriage
size, and the supervisor may insert extra returns.
Backspacing
Underlining or overtyping may be accomplished with the aid
of the backspace key, even in a line that is subject to
right adjustment.
CTSS PROGRAMMER'S GUIDE Section AH.9.01 12/66 15
Summary of RUNOFF Control Words
abbrev. control word automatic break
.ap .append A no
.ll .line length n no
.pl .paper length n no
.in .indent n no
.un .undent n yes
.ss .single space yes
.ds .double space yes
.bp .begin page yes
.ad .adjust yes
.fl .fill yes
.nf .nofill yes
.pa .page (n) yes, if n
.sp .space (n) yes
.he .header xxxx no
.br .break yes
.ce .center yes
.li .literal no
.hm .heading mode P no
.op .odd page yes
.pm .paging mode P no
If "automatic break" is yes, the lines before and after the
control word will never be run together, and the previous
line will be printed out in its entirety before the control
word takes effect.
(END)