Digital Equipment Corporation TECO Version 23B Text Editor Programmer's Reference Manual
PDF
Dokumen
Iklan
Iklan
TECO
00080
JecsyUsceno TECO
TEXT EDITOR AND CORRECTOR PROGRAM
PROGRAMMER'S REFERENCE MANUAL
This manual reflects the software as of Version 238 of TECO,
Additional copies of this manual may be ordered from: Software Distribution Center,
Digital Equipment Corporation, Maynard, MA 01754 Order Code: DEC-10-UTPRA-A-D
digital equipment corporation - maynard. massachusetts
First Printing, January 1968
Second Printing, October 1968
Third Printing, August 1969
Fourth Printing, April 1970
Fifth Printing (Rev) October 1970
Sixth Printing (Rev) May 1972
Seventh Printing (Rev) April 1975
The information in this document is subject to change without notice
and should not be construed as a commitment by Digital Equipment
Corporation. Digital Equipment Corporation assumes no responsibility
for any errors that may appear in this manual.
The software described in this document is furnished to the purchaser
under a license for use on a single computer system and can be copied
(with inclusion of DIGITAL's copyright notice) only for use in such
system, except as may otherwise be provided in writing by DIGITAL.
Digital Equipment Corporation assumes no responsibility for the use
or reliability of its software on equipment that is not supplied by
DIGITAL.
до
2901292
ÉCON
Copyright (C) 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975 by
Digital Equipment Corporation
The HOW TO OBTAIN SOFTWARE INFORMATION page, located at the back of
this document, explains the various services available to DIGITAL
software users.
The postage prepaid READER'S COMMENTS form on the last page of this
document requests the user's critical evaluation to assist us in
preparing future documentation.
The following are trademarks of Digital Equipment Corporation:
CDP DIGITAL INDAC PS/8
COMPUTER LAB DNC КАТО QUICKPOINT
COMSYST EDGRIN KI10 RAD-8
COMTEX EDUSYSTEM LAB-8/e RSTS
DDT FLIP CHIP LAB-K = RSX
DEC FOCAL OMNIBUS RTM
DECSYSTEM-10 GLC-8 0S/8 RT-11
DECTAPE IDAC PDP TECO
DIBOL IDACS PHA TOPS10
TYPESET-10
TECO
This manual reflects the software as of Version
23B of TECO.
CHAPTER 1
CHAPTER 2
CHAPTER 3
.
© CO N NN N N SOUS ON NN; NN
o
W WW Ww Ww Ww Ww ©) © © ©) ©) ©) ©) © © WW WW W Y
OG Oh A WO © © © NN № №Ю № № № № № — — — —
+ © N —
4 OU N —
N O UU RO SN —
CONTENTS
INTRODUCTION
CONCEPTS
Data Files
Character Set
Special Characters
Control Characters
Carriage Control Functions
Symbols
Data Format
Editing Buffer
Buffer Pointer
General Command String Syntax
Arguments
Alphanumeric Arguments
Numeric Arguments
Commands That Return a Value
Q-Registers
Core Expansion
COMMANDS
Initialization Commands
R TECO Command
MAKE Command
TECO Command
Examples of the Use of Initialization Commands
File Selection Commands
ER Command
EM Command
EW Command
EZ Command
EB Command
Editing Line-Sequence Numbered Files
Examples of the Use of File Section Commands
Input Commands
Y Command
A Command
Examples of the Use of Input Commands
Special Characters as Buffer Position Numeric Arguments
Buffer Pointer Positioning Commands
J Command
TECO
Page
2-1
2-2
2-3
2-4
2-4
2-5
2-6
2-7
2-7
2-8
2-9
2-11
2-11
2-12
3-1
3-1
3-1
3-4
3-4
3-5
3-5
3-5
3-7
3-7
3-8
3-9
3-10
3-11
3-11
3-11
3-12
3-12
TECO
OS Us RON O0 & WN
O DO O O O O O ©0 ©0 ©0 WW WW WW WW OW N N N = Oo O O O O © © U Um Un On
co
— — — NO
Oo o o:
o AWN —
WW WW WW © WW WR WWW WWW WW U WWW WW DW WU WW WW DD WW WW WW о
— nd —
—
—
.
© NN NO Oh” wn
©
со
CONTENTS (Cont)
C Command
R Command
L Command
Examples of the Use of Buffer Pointer Positioning Commands
Text Type=-Out Commands
T Command
(О Command
tL Command
nET Command
Case Flagging On Type-out
Examples of the User Text Typeout Commands
Deletion Commands
K Command
D Command
Examples of the Use of Deletion Commands
Insertion Commands
| Command
Tab Command
@ | Command
nl Command
n\ Command
Examples of the Use of Insertion Commands
Case Control with Insert Commands
Alphabetic Case Control
Special "Lower Case"! Characters
Inserting Control Characters
Output Commands
PW Command
P Command
EF Command
Examples of the Use of Output Commands
Exit Commands
EX Command
EG Command
(7) and © Commands
Search Commands
S Command
FS Command
N Command
vi
Page
3-12
3-12
3-13
3-13
3-14
3-14
3-14
3-15
3-15
3-16
3-16
3-18
3-18
3-18
3-19
3-19
3-20
3-20
3-20
3-20
3-21
3-21
3-22
3-22
3-24
3-25
3-26
3-26
3-26
3-28
3-28
3-29
3-29
3-30
3-30
3-32
3-33
3-33
3-33
.11.
.11.
‚11.
‚11.
‚11.
‚11.
‚11.
‚11.
11.
.11.
.11.
.11.
13.
‚ 13.
‚ 14
‚14.
„14.
„14.3
„14.4
„14.5
W WW Ww WwW Ww WwW © Ww Ww WwW WwW © ©) ©) ©) © ©) © ©) ©) ©) © ©) ©) WW ©) © WW WW WW WW WW WW WW WW WW WW WW A
N O00 С U A
— OD © © © © ©
©
11.
12
‚12.1
12.2
13
13.
13.
> ww" —
14.
14.
14.
14.
14.
15
‚ 16
‚ 16.1
‚17
‚17.1
17.2
‚17.3
N NNN — = — —
со eo
A ©) о —
CONTENITS (Cont)
FN Command
Backarrow Command
Search Command Modifiers
@Modifier
Colon Modifier
Automatic Typeout After Searches
Case Control in Searches
Alphabetic Case Control in Search Arguments
Special ''"Lower Case'' Characters
Control Characters in Search Arguments
Case Match Mode Control in Searches
Special Match Control Characters
Examples of the Use of Search Commands
Iteration Commands
Angle Bracket (<...>)
Semicolon Command
Flow Control Commands
Command String Tags
O Command
Conditional Execution Commands
Examples of the Use of Flow Control Commands
Q-Register Commands
Commands for Storing Integers
U Command
Q Command
% Command
Commands for Storing Character Strings
X Command
G Command
M Command
Saving the Previous Command String
Q-Register Pushdown List
Examples of the Use of Q-Register Commands
Numeric Typeout Command
Special Numeric Values
Examples of the Use of the Special Numeric Arguments
TECO Programming Aids
(18) Command
Question Mark (?) Command
The EO Value
vil
TECO
Page
3-34
3-34
3-35
3-35
3-35
3-36
3-36
3-36
3-39
3-39
3-39
3-40
3-41
3-43
3-43
3-43
3-45
3-45
3-46
3-46
3-47
3-49
3-49
3-49
3-49
3-49
3-49
3-49
3-50
3-50
3-50
3-51
3-51
3-54
3-54
3-56
3-57
3-58
3-58
TECO
3.18
3.18.1
CHAPTER 4
4.1
4.2
4.3
4.4
CHAPTER 5
сл un a Uu Un “ Un On
o Hh & N —
APPENDIX A
APPENDIX B
APPENDIX C
CONTENTS (Cont)
Command String Type -in Control Commands
Carriage Return, Line Feed, and Spaces
TECHNIQUES
Creation, Execution, and Editing of a FORTRAN Program
Rearranging a File
Splitting and Merging Files
Example of an Advanced TECO Macro
USER ERRORS
Erasing Commands
Rubout Command
Double e Command
Command
Bell-Space Command
Error Messages
Question Mark Command
Slash Command
EH Command
APPENDICES
TECO ERROR MESSAGES
ASCII CHARACTERS
SUMMARY OF COMMANDS
viil
Page
3-60
3-60
4-1
4-3
4-4
4-7
А-]
B-1
C-1
2-1
2-2
2-3
3-1
3-2
3-3
3-4
3-5
3-6
3-7
A-1
B-]
C-1
CONTENTS (Cont)
TABLES
Special Characters
Special Symbols
Numeric Operators
EM Commands
Special Buffer Position Arguments
L Commands
T Commands
K Commands
P Commands
Conditional Execution Commands
TECO Error Messages
ASCII Characters
Command Description
TECO
Page
2-3
2-4
3-6
3-12
3-13
3-14
3-18
3-27
3-47
A-1
B-1
C-1
TECO
Chapter 1
Introduction
This manual is a complete reference manual for the advanced TECO user. |t is not designed to be used
as a beginner's text, and people who are learning TECO should not use it as such. Beginners are re-
ferred to the tutorial "Introduction to TECO"', which appears in the DECsystem-10 SOFTWARE
NOTEBOOKS.
TECO is a powerful text editor for use with all DECsystem-10 systems. TECO enables the advanced
user to easily edit any ASCII text. Most editing can be accomplished using a few simple commands;
or the user can select any of a large set of sophisticated commands, such as character string searching,
command repetition, conditional commands, programmed editing, and text block movement. Refer
to Appendix C for a summary of the commands available.
TECO editing is normally done on-line, using the terminal. However, the user can also write his
editing commands as a TECO command file and have his editing task run by an operator.
TECO is a character-oriented editor; one or more characters in a line can be modified without re-
typing the rest of the line. Any source document can be edited: programs written in FORTRAN,
COBOL, MACRO -10, or any other language, as well as memoranda, specifications, and other types
of arbitrarily-formatted text. TECO does not require that line numbers or any other extraneous in-
formation be associated with the text. The full ASCII character set, printing and nonprinting
characters alike, can be processed.
TECO requires a minimum of 5K of core memory, 3K of which is shared in a reentrant system. TECO
takes advantage of any additional core available to expand its buffers, as required.
A single terminal is required for typing in commands. Data can be input or output on any standard
I/O device.
April 1975
TECO
Chapter 2
Concepts
2.1 DATA FILES
DECsystem-10 TECO operates on ASCII data files. The input file is the file that the user wishes to
change. The output file is the file that receives the newly created or edited data.
Inputting is defined as the process of reading in data that already exists in some computer-readable
form (paper tape, disk file, etc.). Data can be input from any device except the user's terminal (or
another user's terminal). Inserting is defined as the actual typing in of new data and is done only at
the user's terminal.
In the case of such hard-copy devices as the card reader and the paper-tape reader, only the device
need be specified to open a file for input or output. For disk and DECtape files, filenames, as well
as the device, must be specified. The device DSK: is the normal mode of operation, and is therefore
assumed when no device is specified, Magnetic tape files are specified by naming the tape drive and
by using special TECO commands to position the tape properly.
Any 1/O device name acceptable to the monitor in ASCII] mode can be used, Some examples are:
DSK: Disk (including drums)
DTAn: DECtape (n is the number of the drive on which the
tape is mounted)
MTAn: Magnetic tape (n is the number of the drive on which
the tape is mounted)
CDR: Card reader
CDP: Card punch
PTR: Paper-tape reader
PTP: Paper -tape punch
LPT: Line printer
TTYn: Terminal number n, usually a terminal having a low-
speed reader or punch
2-1 April 1975
TECO
NOTE
TTYn: used as an |/O device must be different from the
user's terminal and must not be the terminal of any
attached user.
Filenames for disk and DECtape files consist of two parts: the first part, the filename proper, consists
of from one to six alphanumeric characters; the second part, which is optional, is called the "filename
extension."
If given, the filename extension consists of from one to three alphanumeric characters
and is separated from the filename proper by a period. If the filename extension is not given, it is
defined as null and as such is distinctive. In the case of a null filename extension, the period after
the filename proper can be omitted.
Examples of filenames:
TECO.21 The source file for TECO version 21
EARNNG .F4 A FORTRAN source program
0015J.CBL A COBOL source program
GLOB.MAC A MACRO -10 source program
GLOB.BAK A backup file
FRMTTR.TEC A file containing a TECO macro
M20 A filename with null extension
M20. 1 A similar filename with non-null extension
2.2 CHARACTER SET
The TECO character set is the full ASCII set. To obtain particular information about individual char-
acters, the user should refer to the table of ASCII characters in Appendix B. This table contains
the following:
a. A list of all ASCII characters and the symbols used in this manual to represent
them,
b. octal and decimal values of the characters, and,
c. comments concerning any special significance of each character.
In general, the user must be concerned with the character set on two levels: the data level and the
command level.
Every ASCH character from control-A (decimal value 01) through rubout (decimal value 127) is legal
in TECO data. They can all be input and output, and they can all be inserted. The only character
that is not completely legal as data is the null character (decimal value 0). The null character can be
inserted and output, but it is ignored on input. Form feed characters (decimal value 12) are com-
pletely legal in data but are treated specially on input (see Sections 2.3 and 3.3).
Most of the ASCII characters have some meaning when used as commands. Some are monitor commands.
When used as commands, the lower-case characters have the same meaning as their upper-case
2-2
TECO
equivalents. The table in Appendix B tells where in this manual the uses of the various characters
as commands are explained.
2.2.1 Special Characters
Because of their use as special immediate-action commands (monitor control commands or erasing
commands), certain characters must not be typed in explicitly as alphanumeric arguments. All of
them, however, are legal as data (except the null character) and can be inserted using special tech-
niques. The characters to which this restriction applies are referred to in this manual as "'special
characters. '" These special characters are listed in Table 2-1.
Table 2-1
Special Characters!
Character Remarks
o (control -C) A monitor command
© (© (two successive An erasing command
control -G's) (A single control -G is
acceptable.)
(9, (control-G, space) Immediate editing command
(causes current line to be
retyped).
(control =O) : A monitor command
tv (control =U) An erasing command
ESCape or PREfix Equivalent to ALTmode
ALTmode or (D Standard text argument
terminator (Two successive
ALTmodes terminate a
command string.)
Rubout An erasing command
in monitors preceding the 5.02 monitor the characters , © , and
are also monitor commands and must be included in the above list for these systems.
2.2.2 Control Characters
Control characters are characters that are typed by holding down the CTRL key while striking a char-
acter key. The control characters have decimal values 0 through 31. When TECO is printing text,
a control character is printed as an up-arrow, followed by the character which is typed to produce
the control character. For example, control-A prints as "' TA",
In many cases the control character commands can be typed into command strings by using an alternate
procedure to the standard method of holding down the CTRL key while striking the desired character.
2-3
TECO
Instead, the user can first type up-arrow and then type the desired character without depressing the
CTRL key. For example, when used as a command, the two-character sequence up-arrow, H (denoted
by tH) is equivalent to the single character control -H (denoted by © ). This method can be used
only when the control character is typed as a command, not when it is typed as text or as an alpha-
numeric argument. Control characters appearing as text arguments must be preceded by a .
Exceptions are noted at appropriate places throughout the manual.
2.2.3 Carriage Control Functions
A few of the control characters are the special terminal functions: bell, tab, line feed, vertical tab,
form feed, and carriage return. All of these characters echo by performing their particular function;
they also perform this function when TECO is printing out text from the buffer.
When a carriage return is typed in, the monitor automatically generates a line feed following it. The
echo to the carriage return type-in is a carriage return followed by a line feed. If a carriage return
is typed to TECO, a line feed is automatically inserted immediately after the carriage return.
Altmode (or escape or prefix) echoes and prints out as a dollar sign.
2.2.4 Symbols
In the examples in this manual, some special symbols are used to clearly indicate what the user must
type. These special symbols are listed in Table 2-2,
In all examples containing both characters typed by the monitor or TECO and characters typed by the
user, the characters typed by the monitor or TECO are underlined, Carriage control characters
(carriage return, form feed, etc.) typed by the user are indicated through use of the special symbols.
Table 2-2
Special Symbols
Symbol Character
— tab
| line feed
vertical tab
form feed
carriage return
space
altmode
rubout
ODO! -Ëe
control -A
tA up-arrow
followed by À
(Other control characters similarly denoted)
2-4 April 1975
TECO
2.3 DATA FORMAT
TECO is capable of editing text written in any format. There are, however, features in TECO that
make use of the concept of a line and the concept of a page. Therefore, the user must know how
these concepts are defined in TECO.
Lines can be of any length. The characters that define the end of a line are the line feed, vertical
tab, and form feed. The end of the editing buffer also counts as an end-of-line character if there is
no other end-of -line character at the end of the buffer. When TECO counts lines, it does so by
counting these end-of-line characters. An end-of-line character is considered to belong to the line
that it terminates.
Examples:
The following text comprises three lines of text as defined by TECO:
LINE ONE!
LINE TWO) |
LINE THREE )
The following text is considered to be two lines:
BEGINNING) OVERPRINT (7) CONTINUATION )!
The first line is terminated by the (> character and the second by the ! character.
Text to be edited by TECO does not have to contain end-of-line characters; however, if it does not
contain them, those features of TECO that count lines will not be useful.
NOTE
If the EO value has been set to 1, the only end-of-line
character is the line feed (refer to Paragraph 3.17.3 for
a description of the EO value).
Pages are defined in TECO by form feed characters, which act as page separators. They are not con-
sidered to belong to either of the two pages that they separate. Two consecutive form feed characters
delimit a null page. A form feed charater at the beginning of a file delimits a null page at the be-
ginning of the file. A form feed character at the end of a file has no effect in TECO. It can be
omitted.
2-5
TECO
Examples:
The following file consists of two pages:
LINE ONE 2!
LINE TWO J!
LINE THREE J)!
LINE FOUR J!
The following consists of four pages; the first and third pages are null:
(FORMLINE ONE 2
LINE TWO J! |
(FORMLINE THREE 2)
LINE FOUR J!
TECO operates most efficiently with files that are divided into pages of approximately fifty or fewer
lines. Files with longer pages or files containing no form feed characters can be edited with TECO;
but, this process requires either additional core storage or more care when editing.
The processing of form feed characters by TECO must be thoroughly understood by the user. The page
concept is further discussed in relation to the size of the editing buffer in Section 2.4, and the rela-
tion of form feed characters to input and output commands is discussed in Sections 3.3, 3.9, 3.10,
and 3.11.
TECO may be used to edit files containing the special line-sequence numbers produced by BASIC,
the PIP /S switch, LINED, and several other editors, but TECO does not need these numbers and
makes no special use of them (nor does it destroy them). See Section 3.2.6 for an explanation of how
these numbers may be processed.
2.4 EDITING BUFFER
Editing is accomplished by:
a. Reading text into the editing buffer
b. Making changes to the text in this buffer
c. Writing the modified text out to a new file
The editing buffer is a block of core memory within TECO. Data is put in the editing buffer when it
is read in or inserted; it is kept in the editing buffer while it is being modified.
Text is packed in the editing buffer with five 7-bit ASCII characters per 36-bit word. When TECO is
running in the minimum 5K of core, the editing buffer holds approximately 3600 characters. Each
additional 1K of core assigned to TECO increases the size of the editing buffer by 5120 characters.
2-6
TECO
TECO normally passes data into and out of the editing buffer a page at a time. Pages are delineated
by form feed characters (see Sections 2.3 and 3. 3).
2.5 BUFFER POINTER
TECO is a character-oriented editor, therefore, the concept of the buffer pointer must be understood
by the user. The position of the buffer pointer determines the effect of many editing commands. For
example, insertion and deletion always take place at the current position of the buffer pointer.
The buffer pointer is a movable position indicator. lt is always positioned between two characters in
the editing buffer, or before the first character in the buffer, or after the last character in the buffer.
It is never positioned exactly on a particular character; it is positioned either immediately before
or after the character.
The pointer can be moved forward or backward over any number of characters. It cannot be moved
beyond the boundaries of the buffer; i.e., it cannot be moved further back than the position immedi-
ately prior to the first character in the buffer, and it cannot be moved further ahead than the position
immediately after the last character in the buffer.
In the examples in this manual showing text in the editing buffer, the position of the buffer pointer is
shown by a caret (A) directly under the line of text.
Example:
TEXT IN THE EDITING BUFFER
When discussing text in the editing buffer in terms of lines, the phrase ''current line'' is frequentl
g g p q y
used. The current line is the line at which the buffer pointer is currently directed. The pointer can
be positioned either at the beginning of the line or in the interior of the line.
2.6 GENERAL COMMAND STRING SYNTAX
Commands are given to TECO by typing a command string; command strings are formed by writing a
series of commands, one immediately after the other, and concluding with two consecutive altmodes
(refer to Appendix C for a summary of commands).
A command string may be typed after TECO indicates that it is ready by printing an asterisk. An
example of a command string is as follows:
*YIHEADING ($) 2K4DNTAG ($) 2LT
Execution of the command string begins only after the two consecutive altmodes have been typed.
TECO then indicates that it is beginning execution of the command string by typing a carriage return-
2-7
TECO
line feed. At that point, each command in the string is executed in turn, starting at the left. When
all commands in the string have been executed, TECO prints another asterisk indicating it is ready to
accept another command string.
If a command in the string cannot be executed due to a command error, execution of the command
string stops at that point, and an error message is printed. Commands preceding the command in error
are executed. The erroneous command and the commands following it are not executed. Errors,
error messages, and recovery techniques are fully discussed in Chapter 5.
There are exceptions to the general rule that commands are not executed until the end of the command
string has been indicated by two consecutive altmodes. These exceptions are the commands listed in
Table 2-1 in Section 2.2.
2.7 ARGUMENTS
2.7.1 Alphanumeric Arguments
Most alphanumeric arguments are text arguments that are interpreted as ASCII data by TECO. Some
examples of text arguments are: data to be inserted in the buffer, search character strings, and com-
mand string tags. Other types of alphanumeric arguments are device and filenames and Q-register
names,
An alphanumeric argument always follows the command to which it applies. As a rule, most commands
that take text arguments require that the argument be terminated by an altmode; however, there are
exceptions to this rule which are explained at appropriate places in the manual. An altmode, even
when not required, may be used to terminate any TECO command.
An altmode used to terminate an alphanumeric argument can also function as one of the two altmodes
necessary to terminate a command string.
Example:
is terminated by an altmode. The
second argument, ""TEXT2"', is also
terminated by an altmode, but this
altmode is also used as one of the
altmodes terminating the command string.
* ITEXT STEXT2 The alphanumeric argument, "TEXT",
*
Any printable ASCII character is legal in an alphanumeric argument with the exception of the special
characters listed in Table 2-1, Section 2.2. In addition, non-printing characters are legal when they
are preceded by a (R).
2-8 April 1975
TECO
2.7.2 Numeric Arguments
Numeric arguments always precede the command to which they apply. In some cases, only a single
numeric argument is required; in others, a pair of numeric arguments is required.
When two numeric arguments are used, they are separated by a comma. In most cases, numeric argu-
ments must be positive; however, some commands allow a numeric argument to be negative or zero.
The number and type of numeric arguments allowed by each command are stated in the section in
which that command is explained.
Where a numeric argument is used to specify a buffer position, the number used is the number of
characters in the buffer to the left of that position. Thus, n means the position to the right of the
nth character in the buffer (between the nth and n+ 1st characters).
Numeric arguments used in pairs are always buffer position arguments. Such a pair specifies all the
characters in the buffer that lie between the two buffer positions represented by the two arguments.
This definition is precise because the term "buffer position'' always indicates a position before or
after a given character, not ''on'' or ''а!'' the character.
Example:
12,20 This argument pair specifies the thirteenth (13th)
through the twentieth (20th) characters in the
buffer. These characters are specified because
the 12 indicates the position between the 12th
and 13th characters, and the 20 indicates the
position between the 20th and 21st characters.
Numeric arguments can be used in arithmetic/logical combinations. The characters shown in Table 2-3
are used as operators.
Table 2-3
Numeric Operators
Operator Function Example
+ Ignored, if used before the first term +2=2
in a string.
+ Addition, if used between two terms. 5+6=11
space Equivalent to +. я 2=2
56-11
- Negation, if used before the first -2=-2
term in a string.
2-9
TECO
Table 2-3 (Cont)
Numeric Operators
Operator Function Example
- Subtraction, if used between terms. 8-2=6
* Multiply. (Used between two terms.) 8*2=16
/ Integer Divide (and drop the remainder). 8/2=4
(Used between two terms.) 8/3=2
& Bitwise logical AND of the binary 12 & 10=8
representations of two terms, if used
between the terms.
# Bitwise logical OR of the binary 12% 10=14
representations of two terms, if used
between the terms.
When more than one arithmetic/logical operator is used in a single numeric argument, the operations
are performed from left to right. This sequence can be overridden through use of parentheses (). All
operations within parentheses are performed before those outside parentheses. Parentheses can be
nested.
In TECO, numbers are ordinarily assumed to be decimal integers. Preceding a number with tO
(uparrow-O, not control -O) causes the number to be read in octal radix.
Example:
10177 is equivalent to 127.
Examples:
3*1010=24
2+3 * 4=20
2+(3 * 4)=14
2+(3 * (16/(3-1) ) /2 H2 * 5) ) =24
28.(315) * 16=18
-( (2+ (3 * 4) - 1 & (6 +8) ) /2) =-6
The arithmetic/logical operators and parentheses can be used to form one or both of the numeric
arguments in a pair.
Example:
260 - (3 * 42), 250 + (77/3)
T
2.7.3 Commands That Return a Value ECO
Generally speaking, there are two main categories of TECO commands: 1) those that perform some
operation, such as inserting text, and 2) those that '‘return'' a value, such as the number of characters
in the editing buffer. (There are also some commands that do both.)
A command is said to "'return"' a value if the command causes the current value of some quantity to be
calculated, and then the command takes on this value, becoming itself a numeric argument that may
be used by another command. Using such a command is equivalent to typing the particular number
that the command returns as a value, except that the value is not usually known in advance. This
value can then be used as an argument by the next command in the command string, provided that the
command is one that can take a numeric argument. Otherwise, it is ignored.
An example of a command that returns a value is the Z command (see Section 3.4). The Z command
returns a value equal to the number of characters-in the buffer. It has no other function. Thus, in
order to be useful, Z must be used as a numeric argument preceding another command.
Commands that return values may be used in arithmetic/logical combinations with each other and
with explicit numbers. All the same rules apply. Each command that returns a value has all the
properties of a number that has been explicitly typed in.
If commands that return values are concatenated with each other or with digits, the value returned
is that of the last command or number in the string. An operator preceding such a string continues
to apply.
Examples:
ZZ=Z
Z48 = 48
-2Z = -Z
3+ZZ = 3+Z
2.8 Q-REGISTERS
Q-registers are data storage registers that are available to the TECO user. Q-registers give a great
amount of editing power to the user by enabling programmed editing and text block movement. Data
stored in Q-registers is not disturbed by the flow of data into and out of the editing buffer. It can be
preserved throughout an entire TECO job, and it is available for retrieval or change at any time.
There are 36 Q-registers; each Q-register has a single character name, which is either one of the
digits O through 9, or one of the letters A through Z. Also, there is a Q-register pushdown stack that
effectively makes available an additional 32 Q-registers for certain applications.
I The number of entries in the pushdown stack can be increased by changing the parameter LPF in
TECO. MAC and reassembling TECO.
TECO
Two types of data can be stored in Q-registers: decimal integers or alphanumeric character strings.
For numeric storage, a Q-register can be used to hold a single positive, negative, or zero decimal
integer in the range -239 + <п < 239 -1. Numbers stored in Q-registers can be incremented, tested,
or recalled. Hence, Q-registers can be used as switches and counters, as well as for simple data-save
functions.
For text storage, a Q-register can be used to hold a character string of any length. Two types of
character strings can be stored: ordinary text and TECO command strings. Ordinary textual data
stored in a Q-register is copied into the Q-register from the editing buffer without destroying the copy
in the editing buffer. Storing text in a Q-register is useful for functions such as making many copies
of a given segment of text throughout a file without retyping it each time, for moving a block of text
from one position to another in a file, and for moving a block of text to another file.
Textual data in the form of TECO command strings can also be stored in Q-registers. Such a command
string can be executed over and over throughout an editing job, much like calling a subroutine. This
feature enables an editing job to be typed up off-line and then executed at a later time. Such
command strings can be edited just as any other text.
2.9 CORE EXPANSION
Core memory is allocated within TECO in the following manner. There is the executable code, which
is pure and is shared in a reentrant system. The other core memory is allocated to the data segment.
Part of the data segment is used for program variables and fixed-length 1/O buffers, while the rest is
used for three variable-length storage areas:
a. The editing buffer,
b. the command string buffer, and
с. the storage area for Q-registers containing text.
When TECO is initialized, the three variable-length storage areas are assigned a specific amount of
space. After a command string is executed, the command string buffer is cleared. When text is de-
leted from the editing buffer, the formerly occupied space is reclaimed. However, during a TECO
job, conditions may arise where the available space is not sufficient for the three variable-length
storage areas. For example, a command string having a single insert command with many lines of text
to be inserted may overflow the command string buffer. In such a case, TECO attempts to obtain the
required space from one of the other variable-length storage areas. If, however, all three areas are
filled to such an extent that the total amount of space allotted to all three is insufficient, TECO
automatically requests another 1K of core memory from the monitor.
If the request for more core is successful, operation continues normally. TECO prints a message of
the form '"' [nK CORE]'* (where n is the new number of 1K segments of (low) core allocated to the
2-12 April 1975
TECO
user) to inform the user that his core has been expanded to the specified amount. (This message is
suppressed while the user is typing a command string.) If the request for more core is unsuccessful,
TECO stops execution of the command string at this point and prints the error message ?COR Storage
Capacity Exceeded.
TECO
Chapter 3
Commands
3.1 INITIALIZATION COMMANDS
TECO is called by giving one of three different initialization commands to the monitor. An initiali-
zation command can be given whenever the monitor has typed a period to indicate that it is waiting
for a new command.
3.1.1 R TECO Command
The general TECO initialization command is the command:
. RTECO))
*
This command calls TECO into core and initializes the program for general use. It does not automati-
cally initialize any particular devices or files for input or output.
When initialization is complete, an asterisk is typed to indicate that TECO is ready to receive a
command. This state, in which TECO waits for command string type in, is called command mode or
the idle state.
The R TECO command can be given with an argument:
. R TECO n,)
where n is a decimal integer. The argument is used to request more than the minimum of 5K of core
memory for the TECO job. If n is greater than 5, the monitor initializes the user's TECO job with nK
of core, if possible. If n is not greater than 5, it has no effect.
3.1.2 MAKE Command
The two main uses of TECO are (1) to create a new file, and (2) to edit an existing file. These two
uses are so common that there are special monitor commands to initialize TECO for executing them.
The command:
. MAKE dev:filnam. ext [proj, progl )
3-1
TECO
is used to initialize TECO for creating a new file. Filnam.ext is the name that the user, using this
command, gives to the new file. Dev: is the device on which the file is to be created; it can be any
output device. If dev: is omitted, DSK: is assumed. If the output device is a disk device, [proj, prog]
is used to specify the user area in which the file is to be created; if [proj, prog] is omitted and the
device is DSK:, the file will be created in the user's own disk area. For a more precise explanation
of file specifications (dev:filnam.ext [proj, progl), see Section 3.2.1.
The MAKE command opens a new file to receive output from TECO and gives it the name specified.
Once the file has been opened, it is then actually created by using the insert and output commands.
Care should be used in the choice of the filename used with a MAKE command. If there is already a
file on the system device with the name specified, the MAKE command will cause the old file to be
overwritten and TECO will output the warning message % SUPERSEDING EXISTING FILE. If the user
does not wish to supersede the file, he should type (©) to return to the monitor. If no filename is
used with a MAKE command, the name of the last ASCII file used in a MAKE command or any other
edit-class command (MAKE, TECO, EDIT, or CREATE) is used. If no filename is given in a MAKE
command and no edit-class command was previously given, the error message ''COMMAND ERROR"
is typed.
When initialization is completed, TECO types an asterisk to indicate its readiness to receive a com-
mand string. Usually the first command following a MAKE command is an insert command.
. MAKE dev:filnam. ext [proj, prog] ,)
is equivalent to
.R TECOJ
*EWdev:filnam.ext [proj, prog]
3.1.3 TECO Command
The command
. TECO dev:filnam. ext [proj, prog)
is used to initialize TECO for editing an existing file on disk or DECtape. The file specifications
dev:filnam.ext [proj, prog] are interpreted in the same way as for the MAKE command, except that the
device must be a directory -structured device (disk or DECtape).
The filename and filename extension must be exactly the same as those of the file that is to be
edited.
3-2
TECO
The TECO command opens the specified file for input and reads in the first page of that file. It also
opens a new file, with a temporary name, for output of the edited version. The temporary name is of
the form nnnTEC.TMP, where nnn is the user's job number, including leading zeros. When output of
the new version is completed, the original (input) version of the file is automatically renamed
filnam .BAK, and the edited version is given the name of the original file. This operation is
identical to that used for the EB command (see Section 3.2.5).
If no filename is specified in a TECO command, the name of the ASCII file last referenced in any edit-
class command is assumed. If no filename is specified and no edit-class command has previously been
given, the error message "COMMAND ERROR" is typed. The TECO command cannot be used with
a file having the filename extension .BAK, nor with a file name nnnTEC.TMP, where nnn is the
user's job number.
When initialization is completed, TECO types an asterisk to indicate its readiness to receive a
command string.
The command
.TECO dev:filnam.ext [proj, progl)
is equivalent to
.R TECO
*EBdev:filnam. ext [proj, prog] Y
or to
.R TECOS
*ERfilnam. ext [proj, prog] EWfilnam. ext OYOO
and the input file is not renamed to filnam.BAK.
If the project-programmer number in a TECO filname.ext [proj, prog] command is not the user's, the
command produces a result different from that described above. TECO takes the file from the speci-
fied project-programmer area; the output file, however, is written in the user's own disk area,
and is given the same name as the input file. If an ERSATZ device (NEW, SYS, etc.) is used,
the same process occurs; e.g., the command TECO SYS: filname.ext will input from SYS:, then
output to the user's project-programmer area. These operations are identical to those used for the
EB command (see Section 3.2.5).
3-3 April 1975
TECO
NOTE
The R TECO command must be used for jobs involving
editing a file on a device other than disk or DECtape,
or for editing a file named nnnTEC,. TMP, or a file with
the filename extension .BAK. The R TECO command is
also preferred with complex editing jobs, where user
errors are likely, because of the greater control it
gives over the input and output files. The R TECO
command requires the use of file selection commands
(see Section 3.2), whereas the MAKE and TECO
commands do not.
3.1.4 Examples of the Use of Initialization Commands
. MAKE EARNNG.F4) This command initializes TECO for creation
+ of a FORTRAN file named EARNNG. F4.
.TECO LIB40.MAC ) This command initializes TECO for editing
the existing file LIB40. MAC. At the com-
pletion of editing, TECO automatically
changes the name of the original version
of LIB40. MAC to LIB40.BAK and gives
the name LIB40. MAC to the new version.
.TECO ) This initializes TECO for editing the disk
file last referenced in an edit-class com-
mand (MAKE, TECO, EDIT, or CREATE).
.R TECO ) This is the command to initialize TECO
x for general -purpose editing. FILE se-
— lection commands (see Section 3.2)
should follow.
3.2 FILE SELECTION COMMANDS
File selection is the specification of the device from which input is to be taken and the device to
which output is to go. In the case of magnetic tape, file selection also involves positioning the tape.
In the case of directory-structured devices, disk and DECtape, a filename must be specified in ad-
dition to the device.
If the user wants only to create a file, or to edit an existing disk or DECtape file, file selection can
be done by using either of the previously described initialization commands.
MAKE dev:filnam.ext [proj, progl )
or
.TECO dev:filnam.ext[proi, progl)
In all other cases, and in particular if the user initializes TECO with the R TECO command, one or
more of the file selection commands described in this section must be used.
TECO
3.2.1 ER Command
The ER command is used to select a file for input. The general form is
*ERdev:filnam.ext [proj,progl
where
a. dev: is the device name, which can be any name acceptable to the monitor.
The device name must be followed by a colon. If dev: is omitted, the
default value DSK: is assumed.
b. [proj, prog] is ignored when used with a device other than disk. proj is the
project number and prog is the programmer number of the disk area where the
specified file resides or, in the case of output, is to be written. If [proj, prog]
is omitted and the device is a disk, the user's project-programmer number is
assumed.
c. filnam.ext need be used only if the device is a directory device, i.e., disk or
DECtape. filnam is the one-to-six character filename, and ext is the one-to
three character filename extension conforming to the rules stated in Section
2.1. If the device is a disk or DECtape, filnam must not be omitted;
.ext must not be omitted unless the null extension is explicitly intended.
d. The (altmode) functions as the argument terminator.
The ER command terminates input from any file that may have been previously opened for input, and
then opens the specified file for input.
The user may open one file for input, read only part of that file, and then, with another ER command,
release the first file and open a new file for input. It is not necessary to read to the end of a file
before opening another. However, opening the second file does end input from the first. There is
never more than one input file active. In Section 4.4, an example is given showing how to use multi-
ple ER commands to merge parts of several files. Data cannot be input without first giving an ER, or
equivalent, command.
3.2.2 EM Command
EM commands are used to position a magnetic tape for input or output. However, EM commands apply
only to the magnetic tape that is currently open for input (i.e., opened by the latest ERMTAn:
command). To position a magnetic tape for output, it is necessary to first initialize the tape for input,
then do the desired EM function, and then reopen the magtape for output.
The function of an EM command is determined by the value of a single numeric argument preceding
the EM. The various EM commands are listed in Table 3-1.
3.2.3 EW Command
The EW command is used to select a file for output. The general form is
*EWdev:filnam. ext [proj, prog]
3-5 April 1975
TECO
The EW command opens the specified file for output. If any output file is already active, an EW
command closes that file before opening the new file. Only one output file can be active at any one
time. If a previously active output file is closed by an EW command, that closed file contains all
and only that data supplied to it by output commands preceding the new EW command.
If there is already an output file with the name specified, the EW command causes the old file to be
overwritten and TECO outputs the warning message %SUPERSEDING EXISTING FILE.
Multiple EW commands may be used without changing the input file. In Section 4.3, an example is
given showing how to use this technique in order to split a single input file into several parts.
The MAKE filnam.ext initialization command causes an automatic EWDSK :filnam. ext command
to be executed. Output may not be done without first giving an EW, or equivalent, command.
Table 3-1
EM Commands
Command Function
EMor 1EM Rewind the currently-selected input
magnetic tape to load point.
3EM Write an end-of file record on the
output tape
6EM Skip ahead one record.
7EM Back up one record.
8EM Skip ahead to logical end-of tape
(defined by two successive end-of-file
marks). The 8EM command leaves the
tape positioned between the two end-
of file marks so that successive output
correctly overwrites the second EOF.
PEM Rewind and unload.
11EM — Write 3 in. of blank tape.
14EM Advance tape one file. This leaves
the tape positioned so that the next item read
will be the first record of the next file (or
the second end-of file mark at the logical
end-of-tape).
15EM Backspace tape one file. This leaves the
tape positioned so that the next item read
will be the end-of-file mark preceding the
file backspaced over (unless the file is the
first on the tape).
NOTE
The EM commands do not clear the internal input buffers.
It is best to reinitialize with a new ER command before
doing an EM command.
3-6 April 1975
TECO
3.2.4 EZ Command
The EZ command is used only with DECtape or magnetic tape. lts function is equivalent to that of
the EW command except that before opening the specified output file it erases the contents of the
output device directory if the device is a DECtape, or it rewinds the tape if the device is a magnetic
tape. For other devices, it it treated exactly like an EW. The form is
*EZdev:filnam. ext Lproj, prog]
3.2.5 EB Command
The EB command is used to open a file for editing in a manner similar to the initialization command
TECO dev:filnam.ext [proj,progl) . It can be used only for files on a disk or DECtape. The general
form of the command is
*EBdev:filnam. ext [proj, prog]
The exact operation of the EB command is as follows:
First, the EB command executes an automatic ERdev:filnam.ext [proj , prog] ($) command,
opening the specified file for input and releasing any previously opened input file. Then,
it opens a temporary file to receive the output of the edited version of the input file.
This temporary file is named nnnTEC. TMP, where nnn is the user's job number with
leading zeros. This action is equivalent to executing the command
EWdev:nnnTEC. TMP © The output device is the same as the input device.
Finally, the EB command sets an internal flag indicating that special action must
be taken when the EB file is closed (by an EF, EX, or EG command - see
Sections 3.9 and 3.10). It also prohibits any further EW, EZ, or EB commands until
the file is closed.
When the EB file is closed, the following action takes place. First, if there already
exists on the device a file with the name filnam.BAK, it is deleted. Then, the input
file filnam.ext is renamed filnam.BAK. Finally, the output file, nnnTEC.TMP, is
renamed filnam.ext.
The effect of using the EB command is analogous to editing a file in place, to itself,
and converting the original version into a backup file. It updates the specified file
and keeps the most recent previous version as a backup file.
If the project-programmer number specified in an EBfilnam. ext [proj, prog]
command is different from the user's, or if an ERSATZ device is used, then the input
file is taken from the specified area, but the output file is written in the user's own
area with the same name as the input file. In other words, if [proj, prog] is not the
user's project-programmer number,
*EBfilnam.ext [proj, prog]
is equivalent to
*ERfilnam.ext [proj, prog] EWfilnam.ext
The EB command cannot be used with a file having the filename extension .BAK
nor with a file named nnnTEC.TMP. The ТЕСО dev:filnam.ext[proj,progl) ini-
tialization command causes an automatic EBdev:filnam. ext [proj, prog] Of
be executed (followed by an automatic Y command).
3-7 April 1975
TECO
3.2.6 Editing Line-Sequence Numbered Files
Some ASCII files, e.g., those created by BASIC, PIP with the /Sand /O switches, SOS, and LINED, have
a special type of line number at the beginning of each line. These "line-sequence numbers'' conform
to certain rules so that they may be ignored or treated specially by compilers and other programs. The
standards for line-sequence numbers are given in the LINED Program Reference Manual.
TECO does not need line-seguence numbers for operation, but TECO can be used to edit files con-
taining them. If such a file is edited with TECO the line-seguence numbers are, in the normal case,
simply preserved as additional text at the beginning of each line. The line-sequence numbers may be
deleted, edited, and inserted exactly like any other text. On output the line-sequence numbers are
output according to the standard, except that the tab after the number is output only if it is already
there. Leading zeros are added as necessary. If a line without a line-sequence number is en-
countered, a line-sequence number word of five spaces is placed at the beginning of the line, and is
followed by a tab.
The following switches are available for use with line-sequence-numbered files. These switches are
merely added to the appropriate file selection command.
ER dev:filnam. ext [proj, prog] /SUPLSN
EBdev:filnam.ext [proj, progl/SU PLSN
causes line-seguence numbers to be suppressed at input time. The numbers will not be read into the
editing buffer. Also, the tabs following the line-sequence numbers, if they exist, will be suppressed.
EWdev:filnam.ext [proj, prog] /SUPLSN
causes the line-sequence numbers to be suppressed at output time. Tabs following the line-sequence
numbers will also be suppressed if they exist.
EWdev:filnam. ext [proj, prog] /GENLSN
EBdev:filnam. ext [proj, prog] /GENLSN
causes line-seguence numbers to be generated for the output file if they did not already exist in the
input file. Generated line-sequence numbers begin at 00010 and continue with increments of 10 for
each line.
Note that these switches are needed only if a change is to be made in the format of the file being
edited. If no switches are specified, a file is output in the same form as it was input.
3.2.7 Examples of the Use of File Selection Commands
* ERDTA2:CREF.2 ($) EWDSK:CREF.3 This command string selects the
DECtape file CREF .2 on DECtape
* drive 2 for input and opens a file
a called CREF.3 on the disk for
output. If there is a file named
CREF. 3 already on the disk, it
will be overwritten.
3-8 April 1975
* ERCDR: ($) EWPTP:
*
*ERMIA1: ($) EMI4EM14EMEZDTAS:PROFIT.CBL
*ERPULSE.F4L11,141]
*
* EZMTA3:
*
„ЕК МТА1: ($) SEMEWMTA!:
EB22.F4
| * | *
* n<14EM>
*
*EBCHESS. MACI1, 4]
3.3 INPUT COMMANDS
TECO
Select the card. reader for input
and the paper tape punch for
output.
This command string selects the
tape on magnetic tape drive 1
for input, then positions the tape
at the beginning of the third file
on that tape, and finally zeros
the directory of the DECtape on
drive 5 and opens an output file
named PROFIT.CBL on it.
Select the file PULSE.F4 in
project -programmer area [1], 14]
on the disk for input. If this file
is read-protected against the
current user, an error message
results.
Rewind the magnetic tape on
drive 3 and select it for output.
To position a magnetic tape for
output (other than just a rewind),
the user must first select the tape
for input, then use EM commands
to position the tape, and finally
select the tape for output. In
this example, the 8EM command
positions the tape at the end of
data that had previously been
written on the tape. This enables
new output to the tape without
overwriting any of the previous
data.
This command selects the disk file
22.F4 for editing. When the
editing is completed, the file
22.F4 is the new version. The
old version is changed to the
backup file 22.BAK, and any
previous backup file 22. BAK
is deleted.
Advance magnetic tape n files.
This command opens the file
CHESS. MAC on the [1, 4] disk
area for input, and opens a file
CHESS. MAC on the user's own
disk area for output (assuming
the user's project -programmer
number is not [1,4]).
Input commands are used to read data from the input file, which must previously have been opened,
into the editing buffer. Input commands can be used only after an ER command (or the equivalent)
3-9
TECO
has been given. Input always begins at the beginning of the selected input file. Successive input
commands then read successive segments of data from the input file.
The amount of data read on an input command depends on the buffer size, the particular input command
used, and the data itself, as explained in the paragraphs below.
3.3.1 Y Command
The Y (yank) command first clears the editing buffer and then reads text into the buffer until one of
the following conditions is met:
“a. The end of the input file is reached;
b. A form feed character is read;
c. the buffer is two-thirds full and a line feed i is read (or filled to within
128 characters of capacity);
d. the buffer is completely filled.
The usual effect of the Y command is to clear the editing buffer and then read the next page of the
input file into it. Less than the entire next page is read in only if that page is too large to fit within
two-thirds of the buffer's capacity. If the cleared buffer is not large enough to accommodate at
least 3000 characters, TECO automatically expands its buffer by 1K, if possible, before beginning
to input. The user is notified of the buffer expansion by a message of the form [nK CORE], where
| n is the new total number of IK segments of (low) core allocated to the user,
If the end of the input file has previously been read, the Y command only clears the buffer.
If a form feed is read (i.e., if input stops because of condition b), the form feed flag ( te) is set
to -1. The form feed itself is not packed in the buffer with the rest of the text. A succeeding input
command begins input at the character following the form feed. If a form feed is not read, the form
feed flag is set to 0, and the next input command begins input at the character following the last
character previously read in. The form feed flag may be tested by the user (see Section 3.16), but
ordinarily this is not necessary.
” | A single Y command is automatically executed by the TECO filnam.ext monitor command causing
the first page of the input file to be read into the buffer before TECO prints the first asterisk.
The Y command sets the buffer pointer to the position preceding the first character in the buffer.
The Y command does not accept a numeric argument. If multiple Y commands are desired, n<Y >
| (where n is the number of pages to be ignored) should be typed (see Section 3.12.1 ).
3-10 April 1975
TECO
3.3.2 A Command
The A (append) command reads in the next page of the input file without clearing the current contents
of the editing buffer. The new input data is appended to that which is already in the buffer (at the
end of that data). The position of the buffer pointer is not changed. If there was a form feed char -
acter in the input file separating the data already in the buffer and the data read in, it is removed.
Thus, the A command can be used to combine several pages of a file.
If the editing buffer does not have sufficient space to accommodate 3000 more characters, TECO
automatically expands its buffer by 1K, if possible, and then completes execution of the A command.
The user is notified of the buffer expansion by a message of the form [nK CORE].
Input begun by an A command is terminated by any of the same four conditions that terminate a Y
command. The A command processes form feeds and the form feed flags in the same manner as the
Y command.
| The A command does not accept a numeric argument. If multiple appends are desired, the user should
type n<A > where n is the number of pages to be appended to the buffer. Note that nA is a different
command (refer to Paragraph 3.16).
If the end of the input file was previously read, the A command has no effect.
3.3.3 Examples of the Use of Input Commands
*ERREPORT.CBL ($) Y This command string opens the disk file REPORT.CBL
* for input and reads in the first page of that file.
| A This deletes the page of text currently in the editing
buffer, reads in the next two pages of the current input
file, appending the third page to the second.
*A This inputs the next page of the file, appending it to the
[3K CORE] data already in the buffer. The previous contents of the
buffer are not altered and the pointer is not moved.
*
— The buffer is expanded automatically, as required by the
A command. In most cases, this message is of no concern
to the user. It is important only if the system is nearly
overloaded.
*ERDTA6:DATA.DOC Y Y Y ($) ($) This command string reads in and discards the first two
a O) O) pages of the DECtape file DATA.DOC, and then reads
in the third page of that file.
3.4 SPECIAL CHARACTERS AS BUFFER POSITION NUMERIC ARGUMENTS
In many cases, numeric arguments are used to specify buffer positions. Because such arguments tend
to be large and not easily determined by counting, the buffer positions commonly used as arguments
are represented by special characters. These special characters are shown in Table 3-2.
3-11 April 1975
TECO
Table 3-2
Special Buffer Position Arguments
Character Value
B Equivalent to 0. It represents the position at
the beginning of the buffer, i.e., preceding
the first character in the buffer.
Z Equals the total number of characters in the
buffer. Thus, Z represents the position at the
end of the buffer, immediately after the last
character in the buffer.
. (period) Equals the number of characters to the left of
the current position of the buffer pointer, and
hence represents the buffer pointer position
itself.
H Equivalent to the numeric argument pair B, Z.
Thus, in those commands that take two numeric
buffer position arguments, H represents the
whole of the buffer. This letter is particularly
useful with type-out and output commands.
The characters B, Z and . can be used in arithmetic expressions.
3.5 BUFFER POINTER POSITIONING COMMANDS
This section describes the most elementary commands for moving the buffer pointer. In addition to
these elementary commands, the search commands make up an entire set of powerful pointer -
positioning commands. The search commands are described in Section 3.11.
3.5.1 J Command
The nJ command moves the buffer pointer to the position immediately after the nth character in the
buffer. The command 0J moves the pointer to the beginning of the buffer, i.e., to the position im-
mediately preceding the first character in the buffer. The command J, not preceded by an argument,
is equivalent to 0J.
3.5.2 C Command
| If n> 0, nC moves the pointer forward over n characters in the buffer. If n<0, nC moves the pointer
backward over n characters. The nC command is equivalent to . +nJ. The command C is equivalent
to 1C; -C is equivalent to -1C.
3.5.3 R Command
The R command is equivalent to C. The nR command is equivalent to -nC. [If n >0, nR moves the
| pointer backward over n characters in the buffer. If n <0, nR moves the pointer forward over n
3-12
TECO
characters. The nR command is equivalent to .-nJ. The command R is equivalent to IR; -R is
equivalent to -1R.
3.5.4 L Command
The L command is used to move the buffer pointer over entire lines. The use of the L command with
various arguments is shown in Table 3-3.
Table 3-3
L Commands
Command
Argument
Function
L
nL
OL
nl
1 assumed
n>0
-1 assumed
n <0
Advances the pointer to the beginning
of the line following the current line.
Advances the pointer to the beginning
of the nth line following the current line.
Moves the pointer back to the beginning
of the current line.
Moves the pointer back to the beginning
of the line preceding the current line.
Moves the pointer back to the beginning
of the nth line preceding the current line.
If the user attempts to move the buffer pointer backward beyond the position immediately prior to the
first character in the buffer, or forward beyond the position immediately after the last character in the
buffer with a C, R, or J command, an error message is printed, and the pointer is not moved from the
position it had before the illegal command was given. With the L command no such error message
results, but the pointer will be moved only as far as the boundary of the buffer.
3.5.5 Examples of the Use of Buffer Pointer Positioning Commands
*J3L
*ZJ-2L
*
*L4C
The J command moves the pointer to the beginning
of the first line in the buffer. The 3L command
then moves it to the beginning of the fourth line.
The ZJ command moves the pointer to the end of
the last line in the buffer. Then the -2L command
moves the pointer to the beginning of the next
to last line in the buffer (assuming that the last
line is terminated by a line feed).
Advance the pointer to the position following the
fourth character in the next line.
3-13 April 1975
TECO
*OL2R The OL command moves the pointer back to the
*
beginning of the current line. Then the 2R com-
— mand moves it back past the last two characters
in the preceding line (the second of which must
be a line terminator).
*J-L The J command moves the pointer to the beginning
of the buffer, and the -L command then has no
effect and therefore does not return an error
message.
*ZJC The ZJ command moves the pointer to the end of
the buffer, and the C command then causes the
error message.
?POP Attempt to move pointer off the page with the
C command.
3.6 TEXT TYPE-OUT COMMANDS
3.6.1 T Command
Any part of the text in the editing buffer can be typed out for examination. This is accomplished by
using the T commands. The text typed out depends on the position of the buffer pointer and the
argument(s) given. The T commands never move the buffer pointer.
When used with a single numeric argument, T is a line-oriented type-out command; when used with a
pair of numeric arguments, T is a character-oriented type out command. The various T commands are
described in Table 3-4.
3.6.2 (0) Command
During the execution of any T command, the user can stop the terminal output by typing the special
monitor control -character . The command causes TECO to finish execution of the
command string omitting all further type -outs. The effect of the command does not carry over
to the next command string. (This command may only be typed as a control character. The combina-
tion tO (uparrow, O) does not have the same effect.) Occasionally the asterisk output by TECO
when a command is finished is also suppressed by . If this occurs, the user can type
TECO will respond with an asterisk if it is waiting for a command.
Table 3-4
T Commands
Command Argument Function
T 1 assumed | Types out everything from the buffer pointer
through the next line terminator. If the pointer
is at the beginning of a line, T causes the entire
line to be typed out. If the pointer is in the
middle of a line, T causes that portion of the
line following the pointer to be typed out.
3-14
TECO
Table 3-4 (Cont)
T Commands
Command Argument | Function
nT n>0 Types out everything from the buffer pointer
through the nth line terminator following it.
If the pointer is at the beginning of a line,
this command types out the next n lines
(including the current line).
OT 0 Types out everything from the beginning of
the current line up to the pointer. This
command is especially useful for determining
the position of the buffer pointer.
-T -1 assumed | Types out everything in the line preceding
the current line, plus everything in the current
line up to the pointer.
nT п< 0 Types out everything in the n lines preceding
the current line, plus everything in the current
line up to the pointer.
m,nT m<n Types the m+1st through the nth characters
in the buffer.
„у. п > 0. Types the n characters immediately following
the buffer pointer.
.-n,.l п >0 Types the n characters immediately preceding
the buffer pointer.
HT H=B,Z Types out the whole buffer.
3.6.3 tL Command
If a form feed character, @ or tL, is included in a command string as a command, it causes a form
feed to be printed on the terminal when TECO reaches that point in execution of the command string.
This feature is useful for obtaining a clean printout of the text in the buffer.
3.6.4 nET Command
In normal typeout mode, most control characters print in the up-arrow form and altmodes print as
dollar signs. For the benefit of users with special terminal equipment, this feature can be suppressed.
The command 1ET (any nonzero argument has the same effect as 1) changes the typeout commands so
that every ASCII character is delivered to the typeout device literally, i.e., with its own octal mode.
This is called literal type-out mode.
When TECO is in literal type-out mode, it can be restored to normal type-out mode, i.e., with sub-
stitutions for control characters and altmodes, by using the command OET.
The ET command (with no argument) returns the value (0 or -1) of the current setting of the type-out
mode switch. See Section 3.16 for an explanation of this command.
3-15 April 1975
TECO
3.6.5 Case Flagging On Type-out
TECO has three text type -out case flagging modes: (1) lower case flagging, (2) upper case flagging,
and (3) no case flagging. In lower case flagging mode, all characters in the range octal 140 to 177.
are preceded by ' (apostrophe) when typed out. In upper case flagging mode characters in the range
octal 100 to 137 are flagged with a preceding '. TECO is initially set for lower case flagging.
The case flagging mode may be set as follows:
nEU (n >0) sets the typeout mode to flag upper case characters,
OEU sets the mode to lower case flagging (standard),
nEU (n<0) sets the mode to no flagging,
EU (without argument) returns the value of the current
case flagging mode.
If TTY LC is on (i.e., the user's terminal handles lower case) or if the ET flag is on, no case flagging
ever occurs regardless of the EU setting.
3.6.6 Examples of the User Text Typeout Commands
The following examples assume the buffer contains the ABCDE) !
text shown at the right, with the buffer pointer posi- FGHIJJ |
tioned between the M and the N KLMNO) |
PQRSTJ |
UVWXY) |
Z ) !
Examples:
THE
NO
*
531
NO
PQRST
UVWXY
x.
*OT Note that no carriage return-line feed exists between
KLM? the beginning of the line the pointer is on and the
pointer itself, therefore, none are typed. The second
asterisk indicates that TECO is ready for the next
command.
3-16
a
*
*-2T
ABCDE
FGHIJ
KLM*
*.,.46T (9) (9)
NO
PQ*
2.100
oT ©©
KLMNO
*HT
ABCDE
го ©
«интим. (5) (5)
ABCDE
FGHIJ
KLMNO
PQRST
UVWXY
Z
*
*OETHTIETHT(S)
X tAY$SZ
XYZ
*
T
TECO MA'N'U'A'"L
*1EUT
'T'E'C'O "MANUAL
*-]EUT
TECO MANUAL
*
TECO
This pair of commands causes the entire current line to
be typed out without moving the pointer.
The six characters typed are NO) !PQ.
This pair of commands types out the entire current
line and leaves the pointer at the beginning of
this line.
The user requests type —out of the whole buffer,
but stops it with a immediately after the
G is typed.
This command string causes the entire contents
of the buffer to be typed out, with a form feed
printed before and after the text is printed.
If the buffer contains the text X Y Z II,
this command string causes it to be typed out in both
normal and literal modes, as shown. In the first line
typed out, the control -A and altmode are typed in
normal mode as up-arrow, A and dollar sign. In the
second line, typed in literal mode, 'A and $ do not
appear because they are delivered to the console
device in their true values, which are nonprinting
characters on most terminals.
The appearance of apostrophes in the typed text
indicates that ''anual'' is lower case.
1EU changes TECO so that upper case characters
are flagged.
-1EU stops case flagging.
TECO
3.7 DELETION COMMANDS
The K and D commands are used to delete characters from the editing buffer. The K command used
with a single numeric argument is a line-oriented deletion command. The D command and the K
command used with a pair of numeric arguments are character-oriented deletion commands.
3.7.1 K Command
The various K commands are described in Table 3-5.
Table 3-5
K Commands
Command Argument Function
K 1 assumed Deletes everything from the buffer pointer
through the next line terminator. If the
pointer is at the beginning of a line, the
K command causes the entire line to be
deleted. If the pointer is in the middle of
a line, the K command deletes only the
portion of the line following the pointer
(including the line terminator).
nK п >0 Deletes everything from the buffer pointer
through the nth line terminator following it.
OK 0 Deletes everything from the pointer back to
the beginning of the current line.
-K -1 assumed Deletes everything from the pointer back to
the beginning of the line preceding the
current line.
nK n <0 Deletes everything from the pointer back to
the beginning of the nth line preceding the
current line.
m,nK m<n Deletes the m+1st through the nth characters
in the buffer and positions the pointer at the
point of deletion (that is, the pointer is set
equal to m).
3.7.2 D Command
Using the D command, characters can be deleted individually and in short strings. The nD command,
where n >0, deletes the n characters immediately following the buffer pointer. If the argument n is
omitted, n = 1 is assumed. The command nD, where n <0, deletes the n characters immediately pre-
ceding the pointer; -D is equivalent to -1D.
At the conclusion of any K or D command, the buffer pointer is positioned between the characters that
preceded and followed the deletion.
TECO
3.7.3 Examples of the Use of Deletion Commands
The following examples assume that the buffer
contains the text shown at the right; the buffer
pointer is positioned between the M and the N.
Examples:
*60
“0
2-220
нк
*
ок
co
к
x
*
*-5D
| * |
3.8 INSERTION COMMANDS
ABCDEJ) |
FGHIJ J)
KLM NO) !
PQRST U
UVWXY J+
Zo!
Deletes NO) IPQ, changing the third
and fourth lines to KLMRST)!.
Deletes M.
Deletes) IKLM, changing the second
and third lines fo FGHIJNO ) |.
Deletes LMNO,
line to KJ) |.
changing the third
Deletes everything in the buffer, but does
not delete the form feed marking the end
of the page (if there is one).
Deletes everything from A through M.
Deletes everything from N through Z J!.
Deletes NO ! changing the third and
fourth lines to KLMPQRST i.
Deletes the entire third line.
Deletes the last three lines (everything
from P through Z yi).
Deletes NO ) IP, changing the third and
fourth lines to KLMQRST j +.
Deletes KLM.
Deletes FGHIJ) KLM.
The insertion commands are used to insert characters into the editing buffer from the user's terminal.
TECO
3.8.1 | Command
The basic text insertion command is the | command used with the desired text as its argument. The
text argument is terminated by an altmode. The general form is
*Itext
This command inserts the ASCII text string, ''text'', into the editing buffer just before the buffer
pointer. Thus, after the insertion, the buffer pointer is positioned immediately after the last inserted
character. The altmode terminating the text argument is not inserted. The text to be inserted may
contain any character except the special characters (see Table 2-1), but control characters must be
treated specially (see Section 3.8.8).
3.8.2 Tab Command
The tab command is equivalent to the | command, except that the tab command causes the tab itself
as well as all the following text up to the altmode to be inserted. In other words, if the first charac-
ter of a text string to be inserted by an | command is a tab, the | may be omitted. The general form
of the tab command is
*—ltext
3.8.3 @I Command
The OI command is slightly more powerful than the | command. This command enables the user to
insert single (but not double) altmode characters in addition to the characters that can be inserted
with the | command. (To insert a double altmode, the second altmode must be preceded by a
or by any non-altmode character and a RUBOUT.) The @I command is useful for inserting TECO com-
mand strings into the editing buffer. The general form is
*@l/text/
In this form, '"text'' is the text string to be inserted. The text argument must be immediately delimited,
both before and after by any single character which is not itself a part of the text to be inserted. ln
this example, the delimiting character is the slash character. Altmode is not required to terminate the
text string; the second occurrence of the delimiting character terminates the text string. The text is
inserted immediately preceding the buffer pointer, as it is with the | command. The delimiting charac-
ter is not inserted.
3.8.4 nl ($) Command
Any ASCII character can be inserted into the buffer using the п! ($) command. This includes all
characters that the | and @l commands cannot insert. However, the nl command inserts only one
character at a time. The command nl inserts the character with the ASCII value n (decimal) into
the buffer immediately preceding the pointer.
3-20 April 1975
Ес
Unless the EO value has been set to 1, the nl command must be followed by an altmode (refer to
Paragraph 3.17 for a description of the EO value).
3.8.5 n Command
The n command is used to insert the ASCII representation of a decimal number n into the buffer.
For example, 349\ inserts the ASCII characters 3, 4 and 9 into the buffer immediately preceding
the pointer. Note that n does not have to be a number typed in by the user. It can be a value
returned by some other TECO command. For instance, %D\ increments the contents of Q-
register D and inserts the ASCII character representation of this incremented value into the
buffer (see Section 3.14.1.3). Note that the n\ command always inserts the decimal represen-
tation of n,
3,8.6 Examples of the Use of Insertion Commands
The following examples assume that the buffer contains ABCD , EF. /with the pointer positioned
between D and E.
*IXYZ Produces ABCDXYZ EFL /y
*
*147 Produces ABCD 4" +
+
A EF44
Produces ABCD +
*| y
д ЕР +/+
*3R AC "TO Produces A_ BC DE, .F/¢
* | ХУ? Produces ABCD—| XYZ EF. +
*
*QIIA SA pw Produces ABCDIA SA PW EF,
* 4033 Produces ABCD ($) А ЕР _ /4
*10L 10! Produces ABCDY
+
EF. 4
*ZV(9) Produces ABC D8 EF, ¥ because Z has
the value 8,
м \z \z \(® Produces ABCD8910, EF_ /¢ because Z
successively returns the values 8, 9, and 10.
*1 This command is used to separate the page
in the editing buffer into two pages. Both
pages, however, remain in the editing buffer.
*121 This is equivalent to the command in preceding
+ example. It is convenient because it avoids
— the form feed echo.
3-21 April 1975
TECO
*JILINE ONE) This example shows insertion of several
lines of text at the beginning of the buffer.
UNE To, Note that line feeds are inserted automati-
cally as the user types the carriage returns.
*
*K 1, This command string is used to delete the
tail of a line without removing the carriage
A return-line feed at the end of the line. If
— the buffer contains
AB,CD À !
EFGH) |
this command produces
AB) |
AEFGH ) |
*
16 This is used to insert a carriage return without
a line feed following it. The single rubout
| deletes the line feed but not the carriage
. return. (See Section 5.1 for an explana-
— tion of rubout.)
*@I% TEXT X %($) ($) This is a convenient method for inserting
*
multiple altmodes when using the Ol command.
The sequence x , where ""x'"" is any
character except altmode, is typed between
the successive altmodes.
*10777 (9) This is used to insert the ASCII characters
511 at the current pointer position.
3.8.7 Case Control with Insert Commands
With the |, Ol, and tab insert commands TECO ordinarily inserts text in the same case in which it
appears in the command string. The user may, however, alter the case of text being inserted by use
of the special case control commands described in this section.
3.8.7.1 Alphabetic Case Control - The features described in this section provide the method by
which alphabetic characters in the upper case range can be converted to the equivalent characters
in the lower case range, and vice-versa. Alphabetic case conversion is done by use of two control -
character commands,
MW is used for translation to lower case,
tw is used for translation to upper case.
These two commands may be used within insert text arguments to cause case conversion on a tempo-
rary basis for that text argument, or as independent commands to cause case conversion in all insert
and search text arguments.
Note that M and (W affect only alphabetic characters. They have no effect on non-alphabetic
characters.
3-22
(1)
TECO
tv) © and (W tw) used within text arguments.
When used inside an insert text argument, two successive © or tw)
commands cause translation, to the specified case, of all following
alphabetic characters in that text argument.
Example:
*|F MW OR USERS OF tw (wW TECO. (96)
The above command inserts ''For users of TECO."' with the initial ''F'
and "'"TECO" capitalized, and all the other letters in lower case.
Single tv) and tw used within text arguments.
When used inside an insert text argument, a single © or © command
causes translation of the next single character (if it is alphabetic) to the
specified case, The single © or (W in a text argument takes
precedence over the case conversion mode defined by double © or ©
commands.
Example:
*1 (Y) (Y) user (WPROGRAM($XG)
The above command causes the string "user Program" with the "'P"' in upper
case, and all the other letters in lower case to be inserted.
Independent (Y) and Ww Commands.
As explained above, when © and © commands are used inside a text
argument, they affect only that particular text string. When used as inde-
pendent commands, however, © and © set TECO to a prevailing case
conversion mode that affects all insert and search text arguments (except as
specified by © and tw) commands within the text arguments). The
independent command © or TV (or n © , where n does not equal 0) sets
the prevailing case conversion mode so that all upper case alphabetic characters
in insert and search text arguments are translated to lower case, except where
tw) commands within individual text arguments override the independent © .
Example:
*1V$$
“| W) FOR USERS OF (vw) () TECO. DE)
*JEXAMPLE
The above commands cause "For users of TECO.'' and ''example'' to be inserted
with all letters lower case except the ''F'' and ''TECO'', Likewise, the inde-
pendent command tw or tW (or n tw , where n does not equal 0) sets
the prevailing case conversion mode so that all lower case alphabetic characters
3-23
TECO
i insert and search text arguments are translated to upper case, except where
©) commands within individual text arguments override the independent tw .
The independent Ww) command has the use explained above, obviously, only
when the user TTY has lower case capability and TTY LC is on. Otherwise the
tw) command serves merely to turn off the (Y) command.
(4) о (tv) and 0 (W
The independent 0 (Y) and 0 tw commands both have the same effect, namely,
to restore TECO to the default condition where neither case of alphabetic char-
acters are translated to the opposite case, except by tv) and tw) commands
within text arguments.
TECO is initially set for no prevailing case conversion.
Note that the prevailing case conversion mode can have one, and only one,
setting at any one time. The possible settings are:
tv) convert upper case to lower case
tw convert lower case to upper case
0 Gv) or 0 tw no prevailing conversion
When any of these prevailing modes is put into effect, it cancels any of the
others that were in effect.
The order of precedence of the case conversion commands is as follows:
Highest: single © and Ww inside text
Next: double © and tw inside text
Lowest: independent © and
NOTE
If the EO value has been set to 1, tw and (have
no special effect when used inside text arguments (refer
to Paragraph 3.17 for a description of the EO value).
3.8.7.2 Special "Lower Case'' Characters - When used inside an insert text argument, the control
command (> causes the immediately following character (if it is one of the special characters @,
[,\, ], !, or+) to be converted to the equivalent character in the lower case ASCII range (i.e.,
octal 140 or octal 173-177). That is,
(1) @ becomes ` ASCII 140
® [ becomes { ASCII 173
© \becomes | ASCII 174
(+7) 1 becomes } ASCII 175
! becomes ~ ASCII 176
(11) — becomes ASCII 177
(> has no special effect within text arguments if the EO value has been set to |.
3-24
TECO
Examples:
*1VI (W) EXAMPLES FOR THE Inserts "Examples for the
(№) (Wrecom ® 6) ANUAL. TECO Manual.
EXAMPLE 1.
*O !VIEXAMPLE 1. nl Command. "'.
(Y) NI CY) EY OMMAND.
*| (19 $6) Inserts a left brace: ({)
3.8.8 Inserting Control Characters
As of version 22 of TECO all of the control characters - © ОЕ (N) - (2 , and (y ,
(1) , (17 , and © have been reserved as inside -text-commands (some as yet undefined). In order
to insert these characters, the user must employ either the or (т) command.
when used inside an insert text argument causes the next single character to be interpreted as
text rather than as a command, and accordingly to be inserted in the buffer, This applies to .
It also applies to Altmode (It applies, in fact, to all characters except © , , © , and
RUBOUT.)
© when”used inside an insert text argument causes all succeeding instances of the above mentioned
control characters except and (7) itself to be interpreted as text rather than as commands.
© does not affect altmodes. A second instance of © in the same text argument nullifies the
effect of the first.
NOTE
The 5.07/6.01, and later releases of the monitor use GT)
for special monitor functions. To use TECO features,
the SET TTY RTCOMPATIBILITY command must be issued
prior to running TECO (see page 2-255 of the DECsystem-
10 Operating System Commands Manual).
If the EO value has been set to 1, and (17) have no special effect when used inside text
arguments, and all control characters can be inserted with no special treatment (refer to Paragraph
3.17.3 for a description of the EO value),
NOTE
The clever way to create a TECO macro is simply to type
the macro as a long command string just as if it were to
be executed immediately, but instead of typing
at the end, type (9 ©! Then type *i to place the
command string in Q-register i. (This stores the macro,
ready for execution, in Q-register i. (Refer to Para-
graph 3.14.3 for the description of the *i command.)
April 1975
3-25
TECO
Examples:
*| TEXT Inserts the text '' TEXT ый
*
*INSTRING (IR) Inserts ""NSTRING (3) "".
*
*1(D(A) SEARCH inserts ** (fA) SEARCH
NSTRING NSTRING ($)
| De TEXT (RX) 16) (Y) TEXTOS)
(1) XAMPLE (86) Example !"'.
*
3.9 OUTPUT COMMANDS
Output commands are used to transfer data from the editing buffer to the output file.
3.9.1 PW Command
The PW command is the basic output command. It does nothing but output. Depending on the argu-
ment used with it, the PW command outputs all or any part of the data in the editing buffer. lt does
not, however, delete any data from the buffer, and it never moves the buffer pointer.
The PW command outputs the entire contents of the buffer and always appends a form feed to it.
The nPW command (n >0) outputs n copies of the text in the buffer, appending a form feed to each copy.
3.9.2 P Command
The P command is a combination command; when used with a single numeric argument (or no argument),
the P command does both output and input. The various functions of the P command are described in
Table 3-6.
Note that the P command (with a single argument) always clears the editing buffer before it inputs
the next page, and it leaves the pointer at the beginning of the new page. If a P command is exe-
cuted after the end of the input file has already been reached or when there is no input file, the
buffer is simply cleared. No data is read in.
Unlike the PW command, the P command does not always cause a form feed to be output at the end of
the data output from the editing buffer. The P command outputs a form feed at the end of the data
only if a form feed was encountered to terminate the last input command.
3-26 April 1975
TECO
Table 3-6
P Commands
Command Argument Function
P 1 assumed Similar to PWY. Outputs the entire contents
of the buffer, then clears the buffer and reads in
the next page of input. The buffer pointer is
left at the beginning of the page that is read in.
If there is no input file, or no more data in the
input file, the buffer is left cleared. A form
feed character is appended to the end of the
data that is output only if the last input com-
mand was terminated by a form feed.
nP n>0 Executes the P command n times. This com-
mand can be used to skip over several pages
of text when no editing is required. The
nP command causes the n pages of the input
file, starting with the page currently in the
editing buffer, to be output, and then the
nth page after the current page to be yanked in.
m,nP m<n When used with a pair of numeric arguments,
the P command does output only; it does not
clear any data from the buffer, it does not
input any more data, and it does not move the
buffer pointer. Also, the m,nP command never
causes a form feed to be appended to output'.
The only action of m,nP is to output the
m+1st through the nth characters in the buffer.
(m,nP and m,nPW are equivalent.)
HP H=B,Z Outputs the entire contents of the buffer without
appending a form feed to it; the buffer is not
cleared, and no new data is read in. (HP and
HPW are equivalent.)
"However, if a form feed character has been inserted in the buffer between the mth
and nth characters, it will be output.
The PW command does not clear the buffer and does not move the buffer pointer. The same is true of
a P command used with two arguments,
Note also that when a PW command is used, a form feed character is always automatically sent to the
output file immediately following the data from the buffer. (Recall that when the page was read into
the buffer, the form feed character that terminated it, if any, was discarded and not read into the
buffer.) The form feed character is appended to the outgoing data regardless of whether or not a form
feed character was encountered when the data was read in, i.e., regardless of the setting of the form
feed flag. This is not true of the P command.
NOTE
If the EO value has been set to 1, the P command behaves
like the PW command with regard to form feeds.
3-27
TECO
When a P or PW command is used with a double numeric argument (including an H argument), a form
feed character is never appended to the output data. This is true regardless of whether or not a form
feed character was encountered when the data was read in.
NOTE
The discussion in this section does not apply to the form
feed characters that the user has inserted into the editing
buffer using 121 or | FORM (® commands. Form
feed characters in the buffer are output exactly as other
characters in the buffer.
If the editing buffer is empty when a P or PW command is executed, no output of any kind takes place.
No form feed character is output. If the user wants to create a blank page, an example of the
procedure is shown below.
As shown in the discussion above, the nP command can be used to skip over several pages to get to the
next page where editing is required. The nP command can also be used with a very large argument,
e.g., 10000, in order to skip to the end of the input file without doing any more editing. The N and
EX commands are other commands which can be used for this purpose.
3.9.3 EF Command
The EF command is the output file closing command. The EF command, or an equivalent command,
must be used to close the output file after all output to it is complete. The EF command is normally
used after the P command which outputs the last page of a file. The special exit commands EX and
EG (see Section 3.10) automatically cause an EF to be executed. Also, a new EW command causes
an EF to be executed on the previous output file, if any, before opening the new output file. Note
that if an EF command is executed in the middle of the file, all succeeding pages of that file are lost.
3.9.4 Examples of the Use of Output Commands
*PT Output the current page, clear the buffer, read in
FIRST LINE OF NEXT PAGE the next page, then type out the first line of the
new page.
*PEF (5) Output the current page to the output file, and
+ then close the output file. This command string
— is used to close a file (after writing the last page)
when it is not desirable to exit from TECO.
*PWEF Equivalent to the preceding example, except that
the buffer is not altered.
3-28
TECO
.,ZPO,.P This command string outputs the entire contents of
the buffer, but it rearranges the data as it is out-
put. The part of the page that follows the buffer
pointer is output first by the ., ZP command. Then
that part of the data which precedes the pointer is
output by the 0,.P command. No form feed charac-
ter is appended to either section of the output.
.,ZPI21 0,.P This performs the same function as the preceding
command string except that it does append a form
feed character to that part of the page that is
output last.
*HK121 HP This command string produces a single blank page.
*
| * | +
*
*
*HK121 PW This produces two successive blank pages.
*
*8P | If page 6 of a file is in the editing buffer, this
*
command causes pages 6 through 13 of the file to
— be output one after the other, and then reads in
page 14.
*300PW($)$ This outputs 300 copies of the current page.
*
*PWJKIJ.DOE PW This outputs the current buffer, then deletes the
first line, inserts text at the beginning of the
second line, and outputs the buffer again,
. MAKE FILE This is the usual method for creating a text file.
*Ipage of text
*Pl2nd page of text
*Pllast page of text EX
3.10 EXIT COMMANDS
Exit commands are used to terminate a TECO job and return to the monitor. There are four exit com-
mands: EX, EG, (2 , and © .
3.10.1 EX Command
The EX command is used to bring an editing job to a satisfactory conclusion with a minimum of effort.
Its use is shown in the example below.
Assume that the user is editing a 30-page file and that the last actual change to the file is made on
page 10. At this point the user gives the command:
* EX (9) (9)
3-29 April 1975
TECO
In this case, the action performed by TECO is equivalent to the command string 21 PEF, with an auto-
matic exit to the monitor at the end. Thus, the action of TECO is (1) to rapidly move all the rest of
the input file, including the page currently in the buffer, on to the output file; (2) to close the out-
put file; and (3) to return control to the monitor.
The EX command is the easiest method of finishing an editing job, with the latter part of the input
file being properly output and the output file closed.
The EX command performs both input and output functions.
The EX command causes a form feed character to be output after the output of the buffer, only if a
form feed was encountered when that buffer of text was read in. In this way, the EX command main-
tains existing page sizes.
3.10.2 EG Command
The EG command first performs exactly the same functions as the EX command, and then causes the
last compile-class command (COMPILE, EXECUTE, LOAD, or DEBUG) attempted before TECO was
called, to be re-executed (with the same arguments). Generally, the EG command is used only to
exit from an editing job that was initialized by an EB command or a TECO filnam.ext command.
As an example, suppose the user gives the command
.COMPILE PLOT.F4)
to request compilation of a FORTRAN source program, but the compiler encounters errors in the code.
The user then calls TECO to correct these errors with the command:
.TECO PLOT.F4,)
*
When all the errors are edited, the user exits from TECO with the command
*EG
This command causes (1) the rest of the file PLOT.F4 to be output and closed, and (2) the command
COMPILE PLOT.F4 to be re-executed automatically.
3.10.3 (Dane © Commands
The © and © commands do not perform any input or output. They are used strictly for exiting
to the monitor.
The command © (or 1Z) is the simple exit command that can be entered into command strings. lt
allows any 1/O commands that have already been given to be completed, then closes the output
file (if one is open), and then returns the user to the monitor. Note that the file close done by
the (2) command is not a full EF. It is a simple close; no renaming takes place.
3-30 April 1975
TECO
Example:
*PWEF The (2 is executed as a regular command
in the command string when its turn comes.
NOTE
If the EO value has been set to 1 (refer to Paragraph 3.17.3),
a single © is equivalent to © .
The © command is a monitor command that is used to immediately exit to the monitor. The (©
command can be typed at any time, while typing a command string or while a command string is being
executed, and it will override everything else. It cannot be entered in the up-arrow, C form. If
there are any input/output functions in progress when (© is typed, a single © will allow them
to be completed before exiting to the monitor. Double © ( (© (© ) interrupts everything, even
I/O in progress, and exits to the monitor immediately. The command does not cause the output
file to be closed.
Both (2 and © are abortive exit commands. However, when they are used, it is possible to
return to the TECO job provided no other program has been called into core over the TECO job.
Simple monitor commands such as ASSIGN, or PJOB, can be executed without damaging the TECO job.
After an exit to monitor level, even if the exit was caused not by a user (© , or 2 , but instead
by some problem detected by the monitor itself, the user can return to his TECO job by using either
the CONTINUE or the REENTER command.
REENTER causes the TECO job to be reentered with the contents of the editing buffer (when the exit
occurred) intact. After reentry by a REENTER, TECO reinitializes itself for a new command string.
Any previous commands still unexecuted at the time of the exit are lost. If a command string was
being executed when the exit occurred, the part of the string that was not executed before the exit will
not be executed after the REENTER command. The user must determine how much of the command
string was executed. If I/O is interrupted, some portion of the input or output files is frequently either
lost or duplicated.
3-31 April 1975
TECO
Examples: |
*ICOMME © Before finishing a command string the
„DEASSIGN LPT J) user exits to perform a monitor command.
DAYTIME À
T4-APR-70 10:34
.REE) He then reenters TECO. The command
string must be retyped, but the buffer is
TICO MMENTS still intact.
*
*<SFOO ($) oL > This is an infinite loop (if FOO is in the
© © buffer). stops execution and
returns the user to the monitor. REE re-
‚REES starts TECO with the editing buffer intact
* and the command buffer empty.
done. Interrupting execution of an 1/0
command does not permit reentry. In
(© this case, some of the output file will
REE) almost certainly be duplicated.
+
© This is an example of what should not be
The contents of any Q-registers (refer to Paragraph 2.8) remain intact after a ® , CONT or (© ,
REENTER command sequence.
3.11 SEARCH COMMANDS
In many cases the simplest way to reposition the buffer pointer is by using a character string search.
A search command causes TECO to scan through the text until a specified string of characters is found,
and then to position the pointer at the end of this string.
The string of characters to be searched for is supplied as a text argument with the search command,
The search string can be from 1 to 36 character positions in length or up to 80 characters including all
control commands.
If an exact match for the search string is found in the text, the buffer pointer is positioned immediately
after the last character in this match. If the string is not found, TECO positions the pointer at the
beginning of the buffer and notifies the user of the failure. The failure notice may take one of two
forms, depending on the type of search command used. For further explanation see the paragraph
below.
All searches begin at the current position of the buffer pointer.
3-32
TECO
If no text argument is provided with a search command, e.g., $ (9) (Sr @N//, the search is
executed using the last previous search command argument.
3.11.1 S Command
The S Command is used to search for a character string within the current editing buffer. If the string
is not found between the current buffer pointer position and the end of the buffer, the search fails.
After an unsuccessful S search, the buffer pointer is reset to the beginning of the buffer, and, unless
the : modifier (explained below) was used or the search is within an iteration (see Section 3.12),
an error message is printed.
The general form of the S command is
*Sstring
For the standard S command, the search string is provided as a normal alphanumeric argument following
the S and terminated by an altmode. ''string'' can contain any character except the special charac-
ters listed in Table 2-1.
The S command may be used with a single numeric argument. The command nS causes a search for the
nth occurrence of the specified search string. When n is omitted, n=1 is assumed. n must be greater
than O.
3.11.2 FS Command
The FS command is used to search for a character string within the current editing buffer (function of
the S command) and replace it with another string. If the string to be replaced is not found after the
current buffer pointer position and before the end of the buffer, the search fails and no replacement
is made.
The general form of the FS command is
*FSstringl string2
where string 1 is the string to be deleted and string2 is the string to be inserted in its place. If string 2
is omitted, string 1 is deleted without any string replacing it. However, even when string2 is omitted,
its terminating altmode must be present as shown in the form:
*FSstring]
Note that this command, because of the two terminating altmodes, is executed immediately,
Normally, FS execution is deferred.
3.11.3 N Command
The N command combines the S command with input/output functions. The N command is used to
search for a character string in a page of the input file which may not yet have been read into the
buffer. The N command has the same form as the S command.
3-33 April 1975
TECO
The N command functions exactly like the S command except that an N search does not terminate at
the end of the page currently in the buffer. If no match for the search string is found between the
current buffer pointer position and the end of the buffer, the current page is output, the buffer is
cleared, the next page is read in, and the search starts over at the beginning of the new page. This
process continues until a match is found or the input file is exhausted.
If an N search fails, the entire input file has been passed through the buffer and delivered to the out-
put file, and the buffer cleared. The output file is not closed. Unless the : modifier was used or the
search is within an iteration, an error message is typed to notify the user that the search has failed.
An N search will not detect a match when the matching characters are split across two buffer loads.
The output function of the N command is exactly like the P command and the EX command. If a form
feed character was encountered when a given page was read in, a form feed character is appended to
that page when it is output; otherwise, no form feed character is output.
The N command can be used with a single numeric argument. The command nN causes a search for
the nth occurrence of the specified search string. When n is omitted, n=1 is assumed. n must be
greater than O.
3.11.4 FN Command
The FN command is used to search for a character string in a page of the input file which may not yet
have been read into the buffer (function of the N command) and to replace it with another string. The
FN command operates like the N command when searching for the string. If the search fails, no
replacement occurs.
The general form of the FN command is
*FNstring] string2
where stringl is the string to be deleted and string2 is the string to be inserted in its place. If string2
is omitted, stringl is deleted without any string replacing it. However, even when string2 is omitted,
its terminating altmode must be present as shown in the form
*FNstring]l
3.11.5 Backarrow Command
The backarrow command is identical to the N command except that a backarrow search generates no
output. Generally, where the N command executes a P, the backarrow command executes a Y. The
backarrow search is used for examination functions and for discarding parts of a file. The general
form of the backarrow command is
*e-string
3-34
TECO
The backarrow command can also be used with a single numeric argument. The command n=-causss
a search for the nth occurrence of the specified search string. When n is omitted, n=1 is assumed.
n must be greater than O.
3.11.6 Search Command Modifiers
3.11.6.1 @ Modifier - There are two search command modifiers. The @ modifier is used to alter
the method which TECO reads the search command's text argument from the command string. The
general form of a @ search command is the same for S, FS, N, FN, and backarrow. It is
*@nS/string/
The @ modifier is placed before the S, FS, N, FN, or backarrow, and before the numeric argument,
if any. When the @ modifier is used, the search string argument is delimited, not by the search
command and an altmode, but by the first character typed after the search command and the next re-
currence of this character. In the example above, the delimiting character is a slash. The delimiting
character may be any character except a character that appears in the search string itself. With the
@ modifier, single (but not double) altmodes can be used in the search string. The @ modifier can
be used in an FS or FN command to separate the strings with a delimiting character other than altmode.
This is useful in cases where a double altmode cannot terminate the command. A double altmode
terminates an FS or FN command when the replacement string is omitted to allow deletion of the
string for which the search is made. Use of the @ search commands is similar to the use of the @I
insert command (refer to Paragraph 3.8.3).
3.11.6.2 Colon Modifier - The colon modifier is used to alter the execution of a search command in
the event the search fails. Without the colon modifier, a search that fails causes an error message to
be printed; if the colon modifier is used, no error message is printed. Instead, every colon search
command executed returns a numeric value that can be printed out, stored in a Q-register, or tested
by a conditional branch. A colon search command returns the value =1 if the search is successful,
and the value O if the search fails.
The general form of a colon search command is the same for S, FS, N, FN, and backarrow searches:
*:nSstring
The colon precedes the search command letter and its numeric argument, if any. Both the colon and
@ modifiers may be used on a search command, in either order.
The concept of a command returning a value is explained in Section 2.7.3. Just as the Z command
takes on a value that may be used as a numeric argument, so also the command :Sstring takes on
a value of O or -1 after it is executed. If this is the last command in a command string, or if the
command following it does not take a numeric argument, the value returned by the colon search is
discarded. Hence, a colon search should be followed by a command that takes a numeric argument.
3-35
TECO
The colon search commands reposition the buffer pointer in the same manner as other search commands,
regardless of whether or not the returned value is used.
The colon searches are used primarily in programmed editing and are usually followed by a conditional
command. Examples of the uses of colon searches are given in Sections 3.13 and 3.14.
3.11.7 Automatic Typeout After Searches
The ES command allows the user to specify automatic typeout of the line where a successful search
has terminated. The search cannot be in an iteration, nor can the search command be preceded by a
colon. When the FS or FN command is used, the typeout occurs after the insertion has taken place.
The user can also specify in the ES command that either a line feed or a character be inserted into the
typeout to indicate the position of the pointer. Unless the ES value is set, the default is that no
automatic typeout after searches will be performed.
The user can set the ES value in the following manner:
OES Restore TECO to the default of no
automatic typeout.
-1ES Set the ES value to cause automatic
typeout of a line on which a successful
search has terminated.
nES(n >0) Set the ES value ton. If nisin the
range 1 through 31, a single line feed
character is included in the typeout at the
position of the pointer. If nis 32 or
greater, the character with the ASCII
value specified by n is included in the
typeout at the position of the pointer.
ES Examine the setting of the ES flag.
3.11.8 Case Control in Searches
When searching for alphabetic characters TECO will normally accept either upper or lower case
characters as a match. This is called "'either-case mode''. TECO may, however, be forced to exe-
cute any or all searches in "exact mode"'. In exact mode TECO will accept an alphabetic character
or a search match only if it has the same case as the corresponding character given by the user in the
text argument.
Before the techniques for match mode control can be explained, we must first explain the various
techniques for case control. Match mode control is explained in Section 3.11.8.4.
3.11.8.1 Alphabetic Case Control in Search Arguments = The case of alphabetic characters in
search text argument is controlled by the same set of commands used to control case in insert text
arguments,
3-36
TECO
The features described in this section provide the method by which alphabetic characters in the upper
case range can be converted to the equivalent characters in the lower case range, and vice-versa.
Alphabetic case conversion is done by use of two control-character commands.
© is used for translation to lower case.
Wis used for translation to upper case.
These two commands may be used within search text arguments to cause case conversion on a temporary
basis for that text argument, or as independent commands to cause case conversion in all insert and
search text arguments.
Note that © and (W affect only alphabetic characters. They have no effect on non-alphabetic
characters.
(1) © © and (W tw used within text arguments,
When used inside a search text argument, two successive © or (W commands
cause translation, to the specified case, of all following alphabetic characters
in that text argument.
Example:
"sE. (Y) (Y) OR USERS OF (W (W TECO. OO
The above command searches for ''For users of TECO."' with the initial ''F"
and "TECO"' capitalized, and all the other letters in lower case.
(2) Single (W and 6) used within text arguments,
When used inside a search text argument, a single tv) or Q) command causes
translation of the next single character (if it is alphabetic) to the specified case.
The single @ or (W in à text argument take precedence over the case
conversion mode defined by double (VD) or Ww commands.
Example:
"5 (M (М) USER (4) PROGRAM
The above command causes a search for the string "user Program"! with the ''P"'
in upper case, and all the other letters in lower case.
(3) Independent (Y) and tw commands.
As explained above, when (Y) and © commands are used inside a text argument,
they affect only that particular text string. When used as independent commands,
however, © and Ww set TECO to a prevailing case conversion mode that affects
all insert and search text arguments (except as specified by © and ©, commands
within the text arguments).
3-37
TECO
The independent command © ог tV(orn (VD) where n does not equal 0) sets
the prevailing case conversion mode so that all upper case alphabetic characters
in insert and search text arguments are translated to lower case, except where
© commands within individual text arguments override the independent
Likewise, the independent command tw) ог 'W (or n tw, where n does not
equal 0) sets the prevailing case conversion mode so that all lower case alpha-
betic characters in insert and search text arguments are translated to upper case,
except where © commands within individual text arguments override
the independent tw) .
The independent (W command has the use explained above, obviously, only
when the user TTY has lower case capability and TTY LC is on. Otherwise
the tw command serves merely to turn off the tv) command.
(4) o(Y) ando (W
The independent O © and 0 tw commands both have the same effect,
namely, to restore TECO to the default condition where neither case of alpha-
betic characters are translated to the opposite case, except by (Y) and Ww
commands within text arguments.
TECO is initially set for no prevailing case conversion.
Note that the prevailing case conversion mode can have one, and only one, setting at any one time.
The possible settings are:
TV convert upper case to lower case
tw convert lower case to upper case
0tV or O TW no prevailing conversion
When any of these prevailing modes is put into effect, it cancels any of the others that were in
effect.
The order of precedence of the case conversion commands is as follows:
Highest: single and tw inside text
Next: double (1V) and Ww) inside text
Lowest: independent © and (W)
NOTE
If the EO Value has been set to 1 (refer to Paragraph
3.17.3), (wW and (9 have no special effect when
encountered inside text arguments.
3-38
TECO
3.11.8.2 Special "Lower Case'' Characters - When used inside a search text argument, the control
command œ causes the immediately following character (if it is one of the special characters @,
[,\, 1, t, or +) to be converted to the equivalent character in the lower case ASCII range (i.e.,
octal 140 or octal 173 to 177). (11) has no special effect within text arguments if the EO value has
been set to 1. Refer to Paragraph 3.8.7.2 for examples.
3.11.8.3 Control Characters in Search Arguments = As of version 22 of TECO all of the control
characters - (9 , (N - ©, and (O, (D , © , and (9 have been reserved
as inside-text-commands (some as yet undefined). In order to search for these characters, the user
must employ either the or © command. (If the monitor version is a 5,07 or later re-
lease, the user must issue SET TTY RTCOMPATIBILITY to use GT) in TECO; see the note in 3.8.8.)
when used inside a search text argument causes the next single character to be interpreted as
text rather than as a command. This applies to all control characters including itself, It also
applies to altmode. (It does not, however, apply to (© , (9 , @) , or RUBOUT,)
© when used inside a search text argument causes all succeeding instances of the above mentioned
control characters except and © itself to be interpreted as text rather than as commands.
(т does not affect altmodes. A second instance of (т) in the same text argument nullifies the
effect of the first, If the EO value has been set to 1, and (7) have no special effect
when used inside text arguments, and all control characters (except the special characters) can be
searched for with no special treatment.
3.11.8.4 Case Match Mode Control in Searches - Unless special action is taken all searches are
executed in ''either-case mode''. This means that regardless of the setting of the prevailing case mode
by an independent @ or 6) command, a search for an alphabetic character will accept either
the corresponding upper or lower case character as a match.
However, if (Y) or (0) case control commands are used within a search text argument, it is
assumed that the user desires an exact mode search, and a match will be accepted only for the cor-
responding characters in the exact case specified by the user.
If the user desires a search to be executed partly with exact mode and partly with either-case mode,
he should bracket the characters to be taken in either case with O characters. (The ©) char-
acter is entered by simultaneously depressing the CTRL, SHIFT, and L keys.)
For example, S © @ ABC (y DEF (MO) will be successful only with strings containing
lower case abc, but it will accept either upper or lower case def as a match for the last 3 characters.
NOTE
IF EO=1, all searches are executed in exact mode and
GI has no special effect in text arguments.
3-39 April 1975
TECO
The search mode can be forced to exact mode for all searches by use of the independent command
n 69, where n does not equal 0. 0 © resets the search mode to 'either' mode. (X) without an
argument returns the value of the search mode flag.
3.11.9 Special Match Control Characters
There are five special control characters that can be used in search character string arguments. These
characters alter the usual character-matching process that goes on when a search is in progress. They
actually reside in the search string and are interpreted by the search routine itself.
The presence of a © command in a search string is a signal that this particular character position
in the string is unimportant and that any character is to be accepted as a match for it. The (x)
command is a free variable in the search string. To find a match, some character must be present in
the position occupied by the © command; however, it does not matter what this character is.
The (ts) command in a search string is a restricted variable. lts presence indicates that any sepa-
rator is to be accepted as a match in its position. A separator is any character except a letter, a
digit, a period, a dollar sign, or a percent sign; i.e., any character except a character that is
commonly used in symbols. The beginning of the editing buffer is also accepted as a match for (5).
NOTE
The 5.06 and later versions of the monitor use 65)
and (explained below) for special monitor
functions. To use TECO ® and fea-
tures, the following commands must be issued before
running TECO: SET TTY NO PAGE and SET TTY
NO TAPE (see the DECsystem-10 Operating System
Commands Manual),
The (N command is another restricted variable. lt must be followed by a single character argu-
ment: (N x. The (N) command signals that, in the position occupied by the (N and its
argument, any character is to be accepted as a match except the argument.
The command is used in a search string to indicate that the character following the is
to be interpreted literally rather than as a command, even if this character is one of the special match
control characters. The (9 command has the same function as , but it is better to use
because @ will not allow insertion of as a text character while will.
The @ command when used with an argument in a search string indicates particular groups of
characters to be accepted as a match. Depending on the argument, this command matches on the
first occurrence of one of the following groups.
(E) A any alphabetic character.
GE) D any digit.
© L any end of line character (or end of buffer character
in the absence of an end of line character).
3-40 April 1975
TECO
© S any string of spaces and/or tabs:.
(tE) V any lower case alphabetic character.
B W any upper case alphabetic character.
(1E) <nnn > the ASCII character whose octal value is nnn.
(1E) [a,b,c,..] any one of the characters a,b,c,... (a,b,c,.. can
be any symbols that represent single characters).
Since the five commands © , (5) , (N , , and (E) are used in the middle of ASCII
search strings, they cannot be entered in the up-arrow, character form allowable for some control
character commands. They must be typed as a single control character.
3.11.10 Examples of the Use of Search Commands
Examples:
*SA —B
*SNIX
2SRH CANNOT FIND "NIX"!
*
*NDIGITAL
*
*NLAST LIN PG1
TST LIN PG2
?SRH CANNOT FIND "LAST LIN PG
1ST LIN PG 2
| * |=
*12FSOF FOR
3-41
This causes the pointer to be positioned im-
mediately after the B, in the first occurrence
of the string À —|B after the current position
of the pointer.
The string NIX is not found between the
current pointer position and the end of the
buffer. The error message is typed and the
pointer moved to the beginning of the buffer.
The user may have typed an incorrect search
string, the pointer may have been positioned
somewhere in the buffer after the N, or the
string NIX may not have been read into the
current buffer,
If page 5 of the text is currently in the
buffer and the string DIGITAL does not occur
until page 15, this command causes pages 5
through 14 to be output and page 15 to be
read in. The pointer will be set immediately
after the L.
If this string actually exists in the file but
the two lines are not read into the same
buffer load, the N search will fail.
This command causes TECO to search the
current buffer for the 12th occurrence of the
string ""OF'' and replace it with the string
"FOR" . e
TECO
*5— VERSION88 This command can be used to determine if the
a string VERSION88 occurs in the input file
five times. If it does, the pointer is posi -
tioned immediately after the fifth occurrence,
and everything in the input file, preceding
the page on which the fifth occurrence is
located, is discarded.
*-1ESSWORD The ES value is set to -1 to cause the line
60 FORMAT ("WORD") where the search ended to be typed. This
makes certain that the search has actually
* found the right occurrence of the string. It is
easy to overlook an occurrence of a string
preceding the one which the user desires.
*5FSINTEREST This command causes TECO to search the
a current page for the fifth occurrence of the
string "INTEREST" and delete it. Two ($) 's
must be present following the string to be
deleted; the first delimits the string to be
searched for and the second tells TECO that
there is no replacement string.
An N search should not be used where an S
h would suffice, because user errors with
*NMASSACHUSETS searc
?SRH CANNOT FIND "MASSACHUSETS" the N command, such as the spelling error
shown here, can cause considerable delay.
*EF In this example, the user's error caused him
+ to have to pass over the entire file twice
*EBOUTPUT. FIL Y instead of just once.
*NMASSACHUSETTS The command @ 3S +($) + searches for the
* third occurrence of the altmode character
+ following the buffer pointer. When this alt-
*
*@ 35+ HEF mode is found, the characters EF are inserted
* immediately after it. The plus characters
serve as the delimiters for the one-character
search string (9). The plus characters are
not part of the search string.
*@ FN/WRITE#/PRINTF/ This command causes TECO to search for the
string ""WRITE#"" and replace it with the
string ‘* PRINT#.'' Each page of the text is
searched until the string is found.
*NA @ B (9 C (N .D @ CITO Any of the following three strings of characters
de would serve as a match for this N search:
7 A6B-C?D (1X)
ABC p ®
AAB,C D
None of the following four strings would serve
as a match:
AJBC-D3
A.B.C.D.
AABBCCD
AXB, CAX (19
TECO
*1ESSFOUR Because the ES value was set to 1, automatic
FOUR typeout of the line occurs after the string
—— "FOUR" was found. A line feed was in-
SCORE AND SEVEN YEARS AGO serted at the pointer position in the line to
allow the user to easily locate the pointer.
*1ESFSI/0 1-0 This command string causes TECO to search
1-0 for the string ''1/0"' on the current page and
— CONTROL replace it with the string ''1-0"'., The line
=— ——— is then typed with a line feed at the position
of the pointer.
3.12 ITERATION COMMANDS
3.12.1 Angle Bracket (<...>)
The user can cause a group of commands to be iterated (repeatedly executed) any number of times by
placing these commands within angle brackets. The left angle bracket marks the beginning of a
command string loop and the right angle bracket marks the end of the loop. These command string
loops can be nested in the same manner as arithmetic expressions are nested within parentheses. Loops
should be nested to no more than approximately 20 levels; otherwise, pushdown list overflow may occur.
Á numeric argument can be used to specify the number of times a given loop is executed. The argu-
ment is placed before the left angle bracket in the form n<...>. This causes the group of commands
within the brackets to be iterated n times. In a command of the form n <...>, if the argument
n is less than or equal to zero, the commands contained within the angle brackets are skipped. If no
argument is given, the number of iterations is indefinitely large, and may be terminated by the semi-
colon command (see below).
Example:
*J8< ($) L> | This command string inserts a tab at the
*
beginning of the first eight lines in the
— buffer and leaves the pointer positioned
at the beginning of the ninth line. The
J command starts the pointer off at the
beginning of the first line. The first com-
mand in the loop, —+ inserts a tab.
Then the next command, L, moves the
pointer to the next line to prepare
for the next iteration of the loop.
3.12.2 Semicolon Command
Iteration of a command string loop can be terminated before the iteration count is satisfied by using
the conditional iteration exit command, semicolon. The semicolon command can be used only within
angle brackets. It can be used with or without a numeric argument,
When used without a numeric argument, the semicolon command evaluates the outcome of the last
search (of any kind) that was executed before the semicolon command was encountered. If this search
was successful, command execution continues within the loop, as if no semicolon were present. If,
however, the most recent search failed, the semicolon command causes all those commands that follow
3-43 April 1975
TECO
the semicolon in the loop to be skipped over, and command execution to pass on to the first command
following the right angle bracket which closes the innermost loop that the semicolon is in.
NOTE
Within a command loop, all searches are colon searches.
They do not generate error messages when a failure occurs,
instead they return a value of -1 if successful and O if
unsuccessful.
The semicolon command can also be used with a numeric argument. The command n; is ignored if
n<0. However, if n>0, the command n; causes command execution to exit from the loop just as the
semicolon command exits from the loop when a search fails.
Examples:
J < SLOVE ;OLTL > This command string types out every line in
the buffer containing the word LOVE. Note
that the L just before the > is needed to pre-
vent TECO from continuously finding the same
occurrence of LOVE,
*J<OLIJAN FS1969 ($)1970($);>HT © This command string inserts JAN at the be-
JAN REPOR © © © ginning of the first line in the buffer and
DEPT: at the beginning of each line that contains
| the string 1969. lt also changes the 69 in
JAN 1970 SALES every occurrence of 1969 to 1970. The actio
WHOLESALE: is as follows: The J command starts the
RETAIL: operation at the beginning of the buffer.
JAN 1970 EXPENSES: The first execution of the OL does nothing.
UL IJAN then inserts JAN at the beginning
COMMISSIONS: of the first line. Now, a search is made
JAN 1970 RETURNS: for 1969. When 1969 is found,
177 RY: FS1969 ($) 970($) changes the
*
T6K CORE
1969 to 1970, This completes the first itera-
tion; execution loops back to the <. OL
moves the pointer to the beginning of the
line where the 1969 was found. Here JAN
is inserted and then a search is begun for
the next 1969. This continues until the
search command fails to find another 1969.
When the search fails, the pointer is moved
to the beginning of the buffer. HT is the
next command which is executed. (It is
assumed that no line contains more than
one ''1969.'!)
loop because the OL causes the search com-
*<51969 ($) ¡OLIDEC ($) > This command puts TECO into an infinite
[7K CORE]
o
REE)
*
mand to keep finding the same 1969 over
and over again. If left to run long enough
the IDEC ($) command will eventually
exhaust available core and stop execution.
In this example, the user has stopped the
loop with (© (© , and then REEntered.
3-44 April 1975
TECO
*Y<NEXAMPLES: (9);<s) This is an example of nested loops. The
( main loop searches for pages in a file that
o ©; © >> contain the heading EXAMPLES: When
* this is found, execution enters the secondary
a loop, which inserts a tab at the beginning
of all the succeeding lines on that page
(i.e., after every ) ! on that page). When
the second semicolon causes an exit from
the inner loop, execution loops back to the
N search. Finally, when the N search
fails, execution is completed.
*EBfilnam.ext 50000< YHP>EX This example shows how to remove all form
feeds from a file.
*<FSREAD ($) WRITE ¡> This command causes a search of the current
page for all occurrences of the string
""READ'"' and replacement of them with the
string ""WRITE"".
*<@FN/ERROR//;> This command causes TECO to search all
a the following pages for the string "ERROR"
and delete every occurrence of it. The @
construction must be used in this case be-
cause it allows the user to specify a de -
limiting character other than ($). The
delimiting character (in this case /) must
be specified twice after the string; the
first to end the string and the second to
indicate that a replacement string is not
present. If were used as the delimiter,
a double would be present which would
cause an erroneous result.
Only the methods described in this section should be used to exit from a loop. Specifically, the flow
control commands described in Section 3.13 should not be used. Some violations of this rule may be
successful, but generally they will not succeed.
Matching pairs of angle brackets defining loops within the loop may, however, occur following the
semicolon.
3.13 FLOW CONTROL COMMANDS
TECO contains commands that enable the user to write editing programs capable of solving most com-
plex editing problems. The iteration commands discussed in Section 3.12 are a specialized example.
In addition to these, TECO has an unconditional branch command and a set of conditional execution
commands that can be used to create any kind of conditional branch or conditional skip.
3.13.1 Command String Tags
To have branching in a command string, there must be a method of naming locations in the command
string. Location tags in the general form
3-45 April 1975
TECO
tag!
may be placed anywhere in a command string (except in text arguments). A tag is delimited before
and after by an exclamation point and may contain any number of any ASCII characters except the
special characters listed in Table 2-1 and exclamation points.
Command string tags are also the recommended method for putting comments in TECO macros; they
need not be referenced.
3.13.2 O Command
The unconditional branch command is the O command. The general form is
*Otag
The text argument following the O command and delimited by an altmode is the tag naming the desti-
nation of the branch. The tag location itself may be either before or after the O command in the
command string. The O command causes the command string execution pointer to be moved to the
first character following the exclamation point that terminates the tag, and command execution con-
tinues from that point.
Tags are ignored except when an O command forces TECO to scan the command string for them.
3.13.3 Conditional Execution Commands
All conditional execution commands have the following general form:
In this form, n is the numeric argument on which the decision to execute or not to execute is based.
The quotation mark ('') is the first character of all conditional execution commands. The letter x re-
presents the second character of the conditional execution command. The letter x may be any one of
several letters depending on which conditional execution command is intended. The two command
characters, ''x, may be followed by any string of commands terminated by an apostrophe('). If the
condition specified by x is satisfied by the argument n, all the commands between '"'x and ' are exe-
"x...'; then after the
cuted in the usual manner. If there is no branch command within the range
last command in the range is executed, command execution falls through the apostrophe and executes
the next command following it. If n does not satisfy the condition specified by x, then all the com-
mands between ''x and the matching ' are skipped, and command execution continues with the first
command following the apostrophe.
The commands ''x and ' must be used in matching pairs and they may be nested in the same manner that
parentheses surrounding arithmetic expressions may be nested.
The individual conditional execution commands are shown in Table 3-7.
TECO
Table 3-7
Conditional Execution Commands
Command Function
n''G Execute the commands that follow if n >0; otherwise, skip to
the matching apostrophe on the right.
n''L Execute the commands that follow if n<0; otherwise, skip to
the matching apostrophe on the right.
n''E Execute the commands that follow if n=0; otherwise, skip to
the matching apostrophe on the right.
n''N Execute the commands that follow if n#0; otherwise, skip to
the matching apostrophe on the right,
n''C Execute the commands that follow if n is the decimal value
of an ASCII symbol constituent character (a letter, digit,
$, ., or % ); otherwise, skip to the matching apostrophe
on the right.
n-1"'L Execute the commands that follow if n<0; otherwise,
skip to the matching apostrophe on the right.
n+1''G Execute the commands that follow if n>0; otherwise, skip to
the matching apostrophe on the right.
n''D Execute the commands that follow if n is in the digit range
(octal 60 to 71).
п''А Execute the commands that follow if n is in the alphabetic
range (octal 101 to 132 or 141 to 172).
n''V Execute the commands that follow if n is in the lower case
alphabetic range (octal 141-172).
n''W Execute the commands that follow if n is in the upper case
alphabetic range (octal 101 to 132).
wn
n''T Execute the commands that follow if n is 'true' (flag is on)
(i.e., if n<0). |
n''F Execute the commands that follow if n is 'false' (flag is
off) (i.e., if n=0).
n''S Execute the commands that follow if n is 'successful'
(i.e., if n<0).
n''U Execute the commands that follow if n is 'unsuccessful'
(i.e., if n=0).
3.13.4 Examples of the Use of Flow Control Commands
*ISTART! J—| —|PDP-10 TECO )
lINSERT PAGE HEADING!
<s 5k (8) к-р (Bp ICHANGE 5K TO 6K!
<SWAR ($) ;-3DILOVE ($) > ICHANGE WAR TO LOVE!
PZ''NOSTART ($)' IGET NEXT PAGE AND!
EF IRESTART IF NOT NULL!
3-47 April 1975
TECO
This small editing program contains an example of the O command, i.e., the OSTART command
which causes a jump back to !ISTART!. It also contains examples of command string tags used purely
for documentation, e.g., INSERT PAGE HEADING!. Normally, comments would be used only for
lengthy and complex macros that the user expects to maintain.
This example also shows how a conditional execution command may be combined with an O command to
produce a conditional branch. When all three of the editing functions have been performed on the
page, the P command is executed to output this page and read in the next. The program then tests
Z (the number of characters in the buffer) to determine if any data was read in. If Z#0, data was
read in, therefore a branch is taken to restart the program. When finally Z=0, the command
OSTART is skipped, and execution branches to the concluding EF command. This technique fails
when a file contains null pages (consecutive form feed characters). Therefore, the (N end-of-file
test is preferred (see Paragraph 3.16).
*YZ"N1##1Z-4000+1"G4000J0L121 0,. PO, .KO## 'ZJA.-Z"' NO "PEF
*
This slightly more complex command string shows how conditional execution commands may be nested.
If the first Y command produces no data, the ""N command sends execution to the matching apostro-
phe on the right. This is the last apostrophe, immediately prior to the PEF. Otherwise, the commands
following the ""N are executed.
The function of this command string is to convert a file with pages of arbitrary lengths to one with
pages of approximately 4000 characters each.
The command string operates as follows: Z-4000 + 1''G means if Z>4000, i.e., there are at least
4000 characters on the current page, execute the following commands; otherwise, skip to the matching
apostrophe (between and Z). If Z>4000, 4000JOL moves the pointer to the end of last complete
line before the 4000th character in the buffer. Then, 121 0, . P outputs this much of the buffer
with a form feed character after it, and 0, .K deletes that which has been output. Now, go back to
MT | and test Z again. Stay in this loop until Z<4000. Execution then skips to the apostrophe.
ZJ moves the pointer to the end of the current buffer. A appends another page, but leaves the
pointer (.) at the end of the previous page. .-Z''N checks to determine if any data was actually
read in. If so, the loop is reentered at 1##1; otherwise the end of the file has been reached. When
.-Z=0, execution skips to the matching apostrophe and then falls through the next apostrophe to the
PEF that closes the output file.
*XNSIN ($) ;:SCOS ($) "'s-3DITAN (3) 'ZJ>
This example shows how the value returned by a colon search can be used as the argument for a con-
ditional execution command. The N command searches through the file for the first occurrence of
SIN on any page. When SIN is found, the command :SCOS checks for an occurrence of COS
3-48 April 1975
TECO
following SIN on the same page. The colon search command returns the value -1 if the search is
successful, and O if there is no COS following SIN on the page. This value is then used as the numeric
argument for the ''S command. If :SCOS has a value of -1, the occurrence of COS that was
found is replaced by TAN. If :SCOS has a value of 0, the commands -3DITAN are skipped.
We then jump to the end of this page, ignoring all further occurrences of SIN and COS on it, and
continue the iteration process.
3.14 Q-REGISTER COMMANDS
Q -registers are a powerful feature of TECO with many different uses. The general concept of Q-
registers is explained in Section 2.8. This section explains the TECO commands that enable the use
of Q-registers.
The 36 Q-registers have the single character names A, B, C,..., Z, and 0, 1, 2,..., 9. In this
section, the letter i is used to represent the name of an arbitrary Q-register.
3.14.1 Commands for Storing Integers
The following commands enable the use of Q-registers for storing single 36-bit integers.
3.14.1.1 U Command - The command nUi stores the decimal integer n in Q-register i. n may be
any integer in the range -235 + <п <> -1. Anything previously in Q-register i is lost,
3.14.1.2 Q Command - The command Qi is used to read the numeric value in Q-register i. Qi has
no function other than returning the value in the specified Q -register as a numeric argument. lt does
not alter the value in the Q-register. In order to be useful, Qi must be used as a numeric argument
for another command. Qi is often used in conjunction with conditional commands.
3.14.1.3 % Command - The command %i adds 1 to the integer in Q-register i and then returns the
new value in the same manner as a Qi command. If the user wants to increment the value in Q-register
i, but does not want the returned value to be used as an argument for the next command, he should
type an altmode after the %i command.
3.14.2 Commands for Storing Character Strings
The following commands enable the user to store character strings of any length consistent with the
amount of core available.
3.14.2.1 X Command - The X command copies characters from the editing buffer into a Q-register.
These characters are not removed from the editing buffer. Any data previously in the Q-register is
destroyed.
3-49 April 1975
TECO
The various uses of the X command are as follows:
a. m,nXi (m<n) copies the m + 1st through the nth characters in the buffer into
Q-register i.
b. If n>0, nXi copies everything from the current buffer pointer position through
the nth following line terminator character into Q-register i. Xi is equivalent to
1Xi.
c. ОХ! copies everything from the beginning of the current line up to the buffer
pointer into Q-register i.
d. [If n<O, nXi copies everything from the beginning of the nth line preceding
the current line up to the buffer pointer into Q-register i. -Xi is equivalent
to -1Xi.
An X command may require more core space for storage than is available. If so, TECO automatically
tries to expand its core. If successful, TECO prints a message in the form [nK CORE] to show the
new amount of core being used. If unsuccessful, TECO prints an error message and does not execute
the X command. The X command does not move the buffer pointer.
3.14.2.2 G Command - The command Gi fetches a copy of the contents of Q-register i
and inserts it into the editing buffer at the current position of the buffer pointer. The
contents of Q-register i are not changed. The buffer pointer is positioned at the right end of the
character string that was inserted by the G command.
3.14.2.3 M Command - TECO command strings are basically ASCII character strings and, as such,
can be inserted or read into the editing buffer just like any other text. When a command string is in
the editing buffer, it can be edited but it cannot be executed, because at that point it appears to be
data to TECO. However, if the user copies a command string from the editing buffer into a Q-register
(using an X command), then this command string can be executed. The command that accomplishes
this is the Mi command.
The command Mi executes the text in Q-register i just as if this text had been typed in the command
string instead of Mi. Using an Mi command is analogous to calling a subroutine. Any TECO com-
mands may be included in the command string or "'macro"' which is stored in and executed from the
Q-register. Even double altmodes can be included if there are conditions under which the user wants
execution to stop.
A text argument cannot be split from its command across a Q-register boundary if that Q-register is to
be executed with the M command. For instance, if the user wishes to insert the string FOO into the
buffer with the command IFOO, he may put the string IFOO ($) into Q-register 1, and then type
MI to TECO. He wauld be wrong, however, to put the string FOO into Q-register 1 and
type IMI 90. because he would be splitting the text argument FOO from its command |
across the Q -register boundary. For the same reason, putting | into Q-register 1 and then typing
MIFOO is also wrong. The first command, IM1, will merely insert the string MI into the buffer; the
second command, MIFOO, will cause TECO to access Q-register 1, find an | without a terminator,
and print an error message.
TECO
Iterations and conditional execution strings, if included, must be complete within the Q -register.
If an O command is used in the Q-register macro, the tag to which it branches must be in the Q-
register also. M commands may be nested up to approximately 10 levels, depending on the contents
of the internal pushdown list,
A numerical argument, on the other hand, may be split from its command across a Q-register boundary.
For instance, if Q-register 1 contains the string T, and the user types 3M] ($), the effect is
exactly the same as though he had typed 3T($) Another example: if Q-register 1 contains the
character Z, and the user types M1=($) O TECO will type the number of characters in the buffer
as though he had typed Z= .
After a macro without one or more terminating altmodes has been executed by an Mi command, TECO
returns execution to the command following the Mi in the string.
3.14.3 Saving the Previous Command String
After a command string has completed execution or if it has been aborted by means of the (© ©
command, it may be stored in a Q-register. This is done by using an *i command as the first command
in the next command string.
3-50-A April 1975
TECO
*i causes the entire previous command string, less one of the two concluding altmodes, to be stored
in Q-register i. If the command string was aborted by © ©) neither (© is stored with the
command string. The previous contents of Q-register i are lost. The asterisk has this function only
when used as the first command in a command string. At any other position in a command string,
asterisk has its usual meaning of multiplication (see Section 2.7.2).
If the user intended to use *i as the first command but typed some other command first instead, he may
recover the ability to use *i as the first command by typing enough rubouts to cause TECO to respond
with a carriage return/line feed and a new asterisk. This technique will not work perfectly if some
of the characters typed before the *i command were break characters (altmode, carriage return, etc.).
In this case some of the leading characters of the preceding command string will be overwritten.
The *i command is especially useful when an error occurs in a long command string. See the example
in Section 3.14.5.
3.14.4 Q-Register Pushdown List
An additional Q-register feature is the Q-register pushdown list, which may be used for temporary
storage during the execution of a command string.
The command [i pushes the contents of Q-register i onto the stack. It does not change the contents
of i.
The command 1i pops the last pushed entry from the top of the pushdown list into Q-register i. The
previous contents of Q-register i are lost; the entry which was popped off the pushdown list is erased
from the top of the list.
NOTE
The Q-register pushdown list is cleared after the execu-
tion of each complete command string (i.e., every time
TECO types an * to indicate readiness to accept a new
command string).
The maximum depth of the Q register pushdown list is 32 entries. (This number can be changed by
redefining LPF in TECO. MAC and reassembling TECO.)
3.14.5 Examples of the Use of Q-Register Commands
*QR-3UR This command subtracts 3 from the value in
Q-register R
3-51
TECO
*Y ISTIOUCIST + 11:51
'"S%C-50"LOST +1 (3121 0,.P0,.KOST ($)')
ZUEAQE-Z"'NQEJOST +1 ($)' PWEF
*0,.X10,.KZJGI
*ZJ-5XAJBLGA
3-52
This command string arranges a file into
pages of 50 lines each. The Y command
starts operation at the beginning of the file.
At IST! the command OUC sets the value O
in Q-register C. At IST+1! search begins
for a line feed. The command :S !
returns a value of -1 if a line feed is found,
in which case ''S causes the following
commands to be executed. The %C com=
mand increments Q-register C by 1 and
returns the new value in C. If %C<50,
jump back to !ST+1! and search for another
line feed. However, if %C=50, proceed
as follows: (1) insert a form feed character
because the output command used does not
output one automatically, (2) output every-
thing from the beginning of the buffer
through the form feed character, then (3)
delete everything that was output and (4) go
back to IST! where the counter is reini-
tialized and start over.
If the search command fails to find another
line, with the value in Q-register C less
than 50, it returns the value O, therefore
the ''S command causes a skip to the apos-
trophe at the end of the second line. The
carriage return is ignored (see Section 3.18).
The ZUE command stores the number of
characters currently in the buffer in Q-
register E. The À command reads in more
data without moving the buffer pointer,
while QE-Z"N checks the old value of Z
with the new value to see if any data was
actually read. If data was read, QEJ sets
the pointer at the end of the old data and
before the new data, then continue the line
count at !IST+1!. If not, output the last
page and close the file.
This command string moves everything to the
left of the pointer from its position at the be -
ginning of the page to the end of the page.
The 0,.X1 command puts everything from
the top of the page to the pointer in Q-
register 1. The 0.,K command deletes this
data from its present position. The ZJ com-
mand moves the pointer to the end of the
page. At this point the command G1 copies
the contents of Q-register 1 into the buffer
at the position of the pointer.
This command string puts a copy of the last
five lines of the page into Q-register A and
then puts a copy of these five lines imme -
diately after the eighth line in the page.
It does not delete the five lines from their
position at the end of the page.
TECO
*HK@I# J<SREAD ; -4DIACCEPT ($) > HXS
*Y4PMS6PMS2PMSEX
In this example, the @I command inserts a
short macro into the buffer. The * char-
acter is used to delimit the insertion. The
HXS command stores this macro in Q-register
S. In the second command string, the MS
command executes the stored macro on
pages 5, 11, and 13 of the input file.
Note that the initial Y command clears the
macro from the buffer before the first page
is read in. The EX command copies all re-
maining pages, closes the output file, and
returns to the monitor.
*J16< [DSDIMENSION ($) OLTXDK >J4L16<GDDI>($)
*
*A LOT OF TEXT
?NFI NO FILE FOR INPUT
=z (90)
cz (®®
D O®©
*5DITITLE ($) NLONG STRING
-8DIA LOT OF TEXT
?NFO No File for Output
*
77 ©O®©
* UP
*JGZ
*J9D ($X$)
3-53
The 16 <[DSDIMENSION ($) OL1XDK>
command locates the first 16 lines on the
current page that have the word
DIMENSION in them, stores them on the
Q-register pushdown list, and then deletes
them from their present positions. Then the
J4L16<GDD]> command brings these 16
lines back onto the page immediately after
the fourth line from the top.
Assume the user meant to insert ''A LOT
OF TEXT'' but forgot the ''I'' at the be-
ginning. The following technique illus-
trates the simple way to recover from this
common error.
Move the entire command string (with just
one altmode at the end) into Q -register Z.
Move the command string from Q-register
Z into the editing buffer at the current
pointer position.
Delete the altmode at the end of the com-
mand string. The rest of the command
string is the text that was to be inserted,
and it is now inserted.
An error is encountered early in a long
command string. (The N-search failed
because it could not output the page in the
editing buffer. The commands preceding
the N=search have been executed.)
Save that entire command string in
Q -register Z.
Save the current pointer position. Move
the pointer to the beginning of the buffer
(a convenient place to edit the command
string), and get the string back from Q-
register Z.
Delete the commands "'SDITITLE ©"
that have already been executed.
April 1975
TECO
*EWOUT. FIL
*STEXT ($) D
*0,.XZ
*0, „К
*QPJ
*MZ
3.15 NUMERIC TYPEOUT COMMAND
Correct the error. . |
Get back to the end of the command string.
The D command deletes the © at the
end of the command string.
Put the corrected string back into
Q-register Z.
Delete the command string from the editing
buffer.
Move the pointer back to its previous po-
sition. (In this particular case this step
is not actually necessary.)
Execute the corrected command string.
The numeric typeout command is n=, where n is the numeric value to be typed in decimal radix. If a
double = sign is used, the numeric value is typed in octal radix.
Example:
*YZ = This reads in a page and then types
2529 out the (decimal) number of characters
7 in the page.
40
3.16 SPECIAL NUMERIC VALUES
НТА = This types the octal representation of
the next character in the buffer.
Several TECO commands, which have no other purpose than to return some particular numeric value,
have already been discussed in this manual. These commands are B, Z, ., and Qi. Some commands
that execute a function while returning a numeric value have also been discussed. These commands
are %i, colon searches, and all searches within iterations. The concept of a command returning a
numeric value is explained in Section 3.11.
3-54
April 1975
TECO
All of these commands can be used as numeric arguments for commands that take a numeric argument,
e.g., nl, n=, n;, nD, nUi, etc. To perform this function place the command, which returns a numeric
value, in the position of n immediately before the command that takes a numeric argument.
There are several other commands that return numeric values; these commands are listed below.
The nA command (where n can be any numeric value, and serves only to differentiate
this command from the A (append) command) is equivalent to the ASCII value of the
character immediately to the right of the buffer pointer. The nA command equals O,
if the pointer is at the end of the buffer. The nÀ command is used primarily with
conditional commands where one is checking for a particular character or range
of characters.
The @ (or tE) command returns the value of the form feed flag. If, on the last input
command (Y or A), input was terminated because a form feed character was encountered,
E equals -1; otherwise, E equals O. For further discussion of the form feed flag, see
Sections 2.4, 3.3, 3.9, 3.10, 3.11 and 4.2.
The (N (or tN) command returns the value of the end-of-file flag. If the end of
the input file was seen on the last input command (any command that involves inputting
a new page), = -1; otherwise, *+N=0. When +N is set to -1, it will remain -]1
until cleared by an ER or EB command. When +N is first set to =1, new data may or
may not have been read into the editing buffer. Consequently, the +N flag should
usually be tested after processing the input data.
The fF (or ) command is equivalent to the value of the console data switches.
The (H (or tH) command is equivalent to the time of day in 60th's of a second
(50th's where 50 Hz power is used).
The ET command (without a numeric argument) returns the value of the ET flag. The
ET command equals -1 if the flag is on and equals O if the flag is off. The significance
of this flag is discussed in Section 3.6 When the ET flag is on, the T command delivers
all characters, including altmodes and control characters, to the terminal in their exact
form rather than substituting other characters.
The EU command returns the value of the case flag. The EU value is 1 if upper case
characters are flagged on typeout; 0, if lower case characters are flagged on typeout
(default); and -1, if no case flagging is being performed. Refer to Section 3.6.
The EH command returns the value of the error message flag. The EH value is 1 if only the
error is typed; 2, if the error code plus one line is typed (default); and 3 if the full
error message is typed. Refer to Section 5.2.
The EO command returns the value of the version number flag. The EO value is 1 for
version 21A of TECO and 2 for versions 22 and 23. See Section 3.17.
The ES command returns the value of the automatic typeout flag. The ES value is -1
for automatic typeout after successful searches, 1 through 31 for automatic typeout
with a line feed to indicate the pointer position, a decimal number greater than 31
for automatic typeout with the character equal to the ASCII value of the decimal
number indicating the pointer position, and 0 for no automatic typeout (default).
Refer to Section 3.11.
"When using TECO with monitors prior to the 5.02 monitor, the tF TECO command must be entered in
the up~arrow, F form because control -F is interpreted as a special monitor command (see Section 3.18).
3-55 April 1975
TECO
3.16.1
The (19) (ог !!) command, followed by an arbitrary character x, is equivalent to
the ASCII value of the character that immediately follows the (1) in the com-
mand string. For example, in the command A, the character A is an argu-
ment for and is not interpreted as a command. ( A equals 65.)
The backslash(\) command (without a numeric argument) is equivalent to the decimal
value of the digit string (optionally preceded by a + or - sign) immediately following
the current position of the buffer pointer. The value is terminated by the first nondigit
character encountered. If there is no digit string immediately following the buffer
pointer, backslash equals 0. The backslash command moves the buffer pointer to the
right end of the digit string and assumes the value of the digit string.
The (7) (or 1T) command is used to enable type-in of characters while the command
string is being executed. When the (M) command is encountered in a command
string, execution of the command string stops and waits for the user to type any single
character. When this character is typed, the © command assumes the value of
this character. Hence, the © command is useful only as a numeric argument for
another command, e.g., the command tTUC puts the ASCII value of the typed
character into Q-register C.
The (7) command is most often used with a message string preceding it (see
Section 3.17). The message string is used to inform the user that TECO is waiting
for a character to be typed in.
Examples of the Use of the Special Numeric Arguments
*J3C1A== If the fourth character in the buffer is 9,
71
*
the command string returns the indicated result.
*JIA!NA-97"GTA-123"L1A-32UCDQCI ($) ов ($) ''
CIBIZA"NOA '
This command string converts all lower case
alphabetic characters in the buffer to upper case.
Starting at the beginning of the buffer (J), ¡f
the next character has a decimal ASCII value
between 97 and 122 inclusive (1A-97"'"G1A-123"'L),
store the upper case value of this character in
Q -register C (1A-32UC), delete the character (D)
and replace it with the value in Q-register
C(QCI ($)). Then TECO skips to 181 (OB ($);
otherwise, it advances to the next character (C).
In either case, at 181 TECO checks to determine if
there is another character in the buffer (2A'*N) and
if so, returns to TA! (OA ($). When 2A equals 0,
execution stops.
*P<-1- (E) ¡A> This command string outputs the current page, and
T3K CORE] then continues input until a form feed character
R is detected. This command string could be used
* on a file that is not divided into pages of a reason-
able size. The À command is repeatedly executed
until © equals -1. When © equals -1, the
semicolon command causes an exit from the loop.
3-56 April 1975
TECO
*1F= tH=ET= This command string causes the (decimal) value
23094886497 of the console data switches, the time of day
1823373 in 60th's of a second, and the value of the ET
= flag to be typed out. At this execution, the
console switches were set to octal 254064000141,
the time was 08:26:29:33, and the ET flag was on.
*11 MUO This command string stores the ASCII value of the
+ letter M (77) in Q-register O.
*YNCHAPTER ON This command string searches for the next chapter
16 heading and then types out the number of the
x chapter. The buffer pointer is positioned immedi-
— ately following the 6, after the command in this
example has been executed.
*<SFUNCTION © ; (A Here, the (т) command is used as the argument
FUNCTION LETTER © ($) > ($) for an ni insert command. This command string
inserts the letter which is typed in following each
FUNCTION LETTER C
*
FLYITITLE This command string inserts "TITLE" at the top
of each page of a file.
© rwn>0©
3.17 TECO PROGRAMMING AIDS
Bugs can occur in editing macros written in TECO language as in any other program; therefore, TECO
provides the following debugging aids for the TECO user.
3.17.1 Command
The user can cause a statement to be typed out at any point in the execution of a command string.
The command is used to perform this function. The general form of this command is
text
The first is the actual command. It can be entered either as or tA, The string
"text"! is the character string that TECO types out when the command is encountered. The
second command marks the end of the text to be typed and must be entered as . The text
string can contain any characters except and the special characters listed in Table 2-1.
3-57
TECO
Example:
*Y IST! NEW PAGE
OUCIST+11:51
"N%C-50'"LOST+1 ($) ' 12 1($)0,. P0,.KOST (9)' »
ZUEAQE-Z""NOST=1 ($) ' END) |
PWEF
NEW PAGE | This command string is identical to an example
NEW PAGE used in Section 3. 14; however two ©
NEW PAGE commands have been added.
NEW PAGE
NEW PAGE
END
—
3.17.2 Question Mark (?) Command
The question mark command has two uses in TECO. When question mark is the first character typed
by the user after TECO has typed out an error message, it has the special function described in
Section 5.2. However, at any other time the question mark can be entered in a command string
exactly like any other command. This use of the question mark command causes TECO to enter trace
mode. In trace mode, TECO types out each command as it is executed. A second question mark
command takes TECO out of trace mode.
Example:
*JHT?ILITA-9"' N1MITA-58'"'NCOM (3) CD +06) по! ($) ©)
AB: LINE]
LINE 2
C: LINE 3
LINE4
ILITA-9''NIMITA-58''NCOM$1A-58''!NCOIMITA-58''NCD $ 'LOLSTA-9''NLOI!LITA-9"NI
MITA-58""NCO !M!TA-58""NCD SLOTLTTA-9"NLOTLTTA-9""NTMTT1A-58'""NC ?POP
"ЗН
AB: LINE] After the first question mark command, TECO
LINE? begins typing out each command as it is exe-
: LINE3 cuted. This enables the user to see exactly
LINES what the command string is doing. The ?POP
* error message is caused by the attempt to
— move the pointer beyond the end of the
fourth (and last) line (the end of the buffer)
with the C command.
The second question mark command turns off
the trace feature so that the "HT"! following
It is not printed.
3.17.3 The EO Value
The EO (Edit Old) feature enables TECO users to protect existing TECO macros from future changes
to the TECO specifications. In most cases when features are added to TECO, the changes merely
3-58
TECO
involve additional commands whose existence in no way affects old TECO macros. The EO feature
does not apply to changes such as these. Occasionally, however, a new feature would cause old
macros not to run properly. The EO feature is designed to protect old macros from such changes.
Every version of TECO has an EO value. For all versions of TECO up through version 21A, the EO
value is 1. For TECO versions 22 and 23, and all succeeding versions until the next specification
change that would affect old macros, the EO value is 2.
The EO value is always initially set to the maximum value for the version of TECO being run. This
enables all new features.
By using the EO command the EO value can be set to a lower value so as to disable features of TECO
that were implemented since the macro was written and which would cause the macro not to function
properly. The EO command does not disable all new features, but only those that affect old macros.
ОЕО ог resets the EO value to the maximum (standard)
nEO (n<0) for the version of TECO in use.
nEO (0<n<=max) sets the EO value to n.
EO (no argument) returns the current value of the EO flag.
All TECO macros written before version 22 should be edited by putting ""1EO"" at the beginning and
""OEO'" at the end. All macros written with version 22 should have '"2EO"' at the beginning and
''ОЕО'' а! the end, etc.
Table 3-8
Features Enabled by EO Values Greater Than 1
EO=1 Base value.
EO=2 (1) Standard altmode changed from ASCII 175 to 033.
(2) All control characters within text arguments reserved
as commands, instead of only (N , © , (5), ©
in search strings.
(3) Standard searches accept either upper or lower case
— alphabetic characters as a match.
(4) Vertical tab and form feed recognized as end-of =line
characters in addition to line feed.
(5) The P command does not create form feeds.
(6) Command string jumps will not accept instances of
the target characters occurring within text arguments.
(8) The nl command must be followed by altmode.
(9) The (©) exit command is changed to (7) .
3-59 April 1975
TECO
Examples:
*EO= Initial setting is EO=2,
2
*TEOEO== Set EO value to 1.
1
*ОЕОЕО== Revert back to EO=maximum.
| + In
3.18 COMMAND STRING TYPE-IN CONTROL COMMANDS
The use of two successive altmodes as the command string terminator has already been discussed in
Section 2.6. The use of rubout, CU) , and double © as command string erasing commands is
discussed in Section 5.1. There are other characters, however, that are useful in the creation of
command strings.
3.18.1 Carriage Return, Line Feed, and Spaces
Except as text arguments, the characters carriage return and line feed are ignored in command strings.
Spaces are also ignored except (1) when used in text arguments, and (2) when used between two nu-
meric arguments as a + (see Section 2.7.2). Hence, these characters can be employed by the user
when formatting command strings. The carriage return (and the monitor-supplied line feed following
it) is used to enable the user to conveniently type command strings much longer than a single line.
Spaces are used to lend clarity to more complicated macros.
3-60
TECO
Chapter 4 |
Techniques
4.1 CREATION, EXECUTION, AND EDITING OF A FORTRAN PROGRAM
This section demonstrates the use of TECO's multi-purpose commands to simplify the creation and
purp p'iry
editing of programs.
The following example shows the creation and immediate execution of a FORTRAN program.
. MAKE ATEST.F4 J Give the command to create the
disk file ATEST.F4 using TECO.
* TYPE 1) Begin insertion with the TAB command.
1 FORMAT ("COMPILER
ARITHMETIC TEST')))
J=3,)
K=7,)
X.5 RO) 5 .=.5 Rub out erroneous .5.
-T ($) Stop insertion and use the -T command
to verify last line inserted.
X=.5
* —All=K/J *(X*1, E+2-K *K/ (3.*J)) Continue insertion.
R=10.6 )
S=3.5 4)
|=5
J=2 )
N=7
Z=R+S*1/J#N/3,)
ТУРЕ 2, |1, 7. 2
| FORMAT (18 ,F20.12)J
END J
EX End insertion, and then use the EX
command to output and close the file.
EXIT
IC
4-1 April 1975
TECO
.EXECUTE ATEST )
FORTRAN: ATEST.F4
UNDEFINED LBLS
2
MULTIPLY DEFINED LBLS
1
MAIN. ERRORS DETECTED: 2
?TOTAL ERRORS DETECTED: 2
LOADING
LOADER 4K CORE
7EXECUTION DELETED
EXIT
IC
„TECO)
*SF20. ($) OLDI2 ($) отт
2 FORMAT (18,F20.12)
*EG
FORTRAN: ATEST.F4
LOADING
LOADER 4K CORE
COMPILER ARITHMETIC TEST
103 21.683333118562
EXIT
1C
NOTES
Give the command to compile and
execute ATEST.F4,
The FORTRAN compiler discovers
errors in the program.
Call TECO to edit ATEST.F4.
Change the second label 1 to 2,
and then verify the change.
Output the new version and auto-
matically cause a repeat of the ex-
ecution by using the EG command.
Success.
a. The command MAKE ATEST.F4) is equivalent to
the following sequence of commands:
.R TECOJ
FEWATEST. F4
b. The -T command does not move the buffer pointer,
therefore, the user can continue insertion from the
point he left off.
с. In this example, the EX command is equivalent to
PWEF
d. No filename is given with the command TECO,
therefore the name of the file used in the most re-
cent edit-class command (i.e., MAKE, or TECO
command) is assumed. In the example, the com-
mand TECO) is equivalent to
.R TECOJ
JEBATEST. F4 Y
4-2
TECO
NOTES (Cont)
e. The command SF20. moves the pointer to the
line the user wishes to correct. The OL command
positions the pointer immediately prior to the bad
character 1. The D command deletes the 1; the
12 command inserts 2 in its place. The OTT
command types out this entire line.
f. The command EG ($) is equivalent (in this
example) to
*PWEF_ (9 (9) (9)
EXIT
ic
EXECUTE ATEST. РА)
4.2 REARRANGING A FILE
In Section 3.14, an example shows the use of a Q-register in moving a segment of text from one
, Р 9 9 9
place on a page to another place on the same page. This section describes how to move blocks of
text, or whole pages, to entirely different places in a file.
Example:
The user has a file named PGM. MAC on the disk and this file contains data in the following form:
AB (FORM) CD GOR er FORM) GH EORM 1 FORM) EL ÉORM) MN FORM) OF
where each of the letters A, B, C... represents 20 lines of text.
The user intends to rearrange the file, as shown in the following example:
AOB (FORM) D FORM) MN (FORM) EF FORM) ICJ (FORM) KL (FORM) P FORM) GH
The following commands achieve this rearrangement.
.R TECO 6) Call TECO with extra core.
*EBPGM. MAC Y © Specify the file and get the first page.
*NC Output AB and input CD.
*J20X1 (5) (9) Save all of C in Q-register 1.
*20K ($) Delete C from its position in the editing
buffer.
FENG Output D (FORM and input EF. Qut-
put EF FORM and input GH.
*HX2 Save all of GH in Q-register 2.
*Y Delete GH and input 1J.
*20L Move the pointer to the beginning of J.
4-3
TECO
*G1 Bring in all of C from Q-register 1.
*NM Output ICJ input KL, output
KL FORM), and input MN.
*HX1 Save all of MN in Q-register 1 (there-
by discarding the previous contents).
*Y Delete MN and input OP.
*J20X3 Save all of O in Q-register 3.
*20K Delete O from the editing buffer.
*P Output P and clear the edit-
ing buffer.
*G2 Bring GH into the buffer from Q-
register 2,
*HPEF Output GH, close the output file (now
called nnnTEC.TMP), rename the input
file PGM.BAK, and then rename the
output file PGM. MAC.
*EBPGM. MAC Y Now edit the partially revised file
just output. Loop around to the be-
ginning of the file.
*20L Move the pointer to the beginning of B.
*G3 ($) ($) Bring in all of O from Q-register 3.
*ND Output AOB and input D.
*PWHK Output D , and then clear
the buffer.
*G1 Bring in all of MN from Q-register 1.
*EX Output MN and continue the
input/output sequence until GH has
EXIT been output. Then close the output
С file (called nnnTEC.TMP), delete the
— previous PGM.BAK, rename the input
. file PGM.BAK, and then rename the
a new output file PGM. MAC. Finally,
exit to the monitor.
4.3 SPLITTING AND MERGING FILES
This section demonstrates the procedure to split a file into several smaller files and the procedure to
merge parts of several files,
Example 1: Splitting a File
Assume the user has a file named FILE.CBL on the disk; this file contains data in the following form:
AB (FORM) CD ÉORM) EF FORM) GH (FORM) 1) FORM) KL FORM) MN (FORM) OP
4-4
TECO
where each of the letters A, B, C,... represents 20 lines of text. The user wants to separate
FILE.CBL into two files:
a. FILE.1 containing AB FORM) CD and
b. FILE. 2 containing KL (FORM M
And to discard the rest of the data. To accomplish this proceed as follows.
.RTECO) Call TECO.
*ERFILE.CBL ($) EWFILE.1 Open the input file and the firs
output file.
*Y Input AB.
*P Output AB and input CD.
*HPEF Output CD and then close the out-
put file FILE. 1.
TK Clear the buffer (deleting CD from
it) and continue inputting pages of
the file and searching for K. If K
is not found on a given page, clear
the buffer, and read in the next
page. The — command does not
perform output. Thus EF, GH, and
|J are all read in and then deleted.
When KL is read in, the search stops.
*EWFILE. 2 Open the second output file.
*P Output KL and input MN.
*20L Position pointer at the end of M.
*0,.PEF Output M and then close the output
file FILE.2.
* (© Exit to the monitor with the job
completed.
Example 2: Merging Files
Assumed the user has two files:
a. MATH.BAK containing
AB FORM) CD (FOR) EF (FORM) GH FORM) 11 EORMKL
b. MATH.F4 containing
Where A, B, C,... each represents 20 lines of text, and A', B',... represent updated versions of
A, B,....
4-5
TECO
The user wants to merge MATH. F4 with the latter half of MATH.BAK to produce:
MATH. NEW containing
A'B FORM) C'D' ОКМ) ег сн FORM) 1J FORM) KL
He proceeds as follows.
„В TECO
*ERMATH.F4
EWMATH. NEW
*y
*NF'
*PW
*ERMATH.BAK
*Y
*.6
*NL
*HPEF (19)
EXIT
ic
The technique shown in Example 2 illustrates the best method for recovering from the error indicated
by the error message:
Call TECO.
Open the first input file and the out-
put file.
Input A'B'.
Output A'B' (FORM , input C'D',
output C'D' , and input E'F",
Output E'F! (FORM)
Close input from MATH.F4, and open
MATH.BAK for input.
Delete E'F' from the buffer and input
AB.
Delete AB, input and delete CD and
EF, then input GH.
Output GH (FORM , input and then
output 1J FORM , then input KL,
Output KL, close the output file
MATH.NEW, and then exit to the
monitor with the job completed.
POUT-200000 Output Error 200000 - Output File 018TEC. TMP Closed
If this error occurs during an editing job initialized by the TECO filnam.ext,) command or an EB
command, the incomplete output file has a temporary name of the form nnnTEC.TMP (see Section 3.2);
otherwise, the incomplete output file will have the name specified by the user. (Refer to Appendix A
for a list of error messages and their meanings.)
Example 3 is more explicit illustration of recovery from the foregoing error.
4-6
Example 3:
Recovery from an Output Error
.TECO FIL.DOC)
*edit a few pages
*P
?0UT-200000 Output Error 200000 - Output File O18TEC.TMP Closed
*EROISTEC.TMP (9) EwFiL.NEN © Y D ®
*Nlast page edited and successfully output
*PW
*ERFIL.DOC ($) У
*<last page edited and successfully output
*Y and edit next page
*Nnext place to edit
*finish editing normally
*EX
EXIT
IC
.RENAME FIL. DOC=FIL, NEWS
4.4 EXAMPLE OF AN ADVANCED TECO MACRO
This section demonstrates a TECO macro for formatting DECsystem-10 Macro assembly language
programs.
The procedure for executing this macro is as follows:
TECO
„К ТЕСО 6) Call TECO with enough core to cov-
er the maximum page size.
*ERDTA7:PGMFMT.TEC Open the file containing the macro
itself for input.
*YHX1 Input the macro and save it in Q-
register 1.
*EBPROGRM. MAC Open for editing the file that is to
be formatted by the macro.
*Y Read in the first page of the file.
*MI Execute the macro.
* (9
Exit with job completed.
4-7
TECO
Formatting Macro (PGMFMT.TEC)
1EO ISTART !OUL<S 1
($);%L>ZIR1A-10" NL! ICOUNT LINES ON PAGE!
ILOOPIJQL<OUC 1A-90"GOZ (3 ' IEXECUTE LOOP ONCE FOR EACH LINE!
IFSTCHHA"COTAG (5)
IESTCH211A-9'"ECOOP ($) "1A-32"NOZ (D)
IESTCH31% C-8'"GOZ ($) 'CIA-32"'EOFSTCH3 ($)'1A-9"EQGC-7''GOZ ($) 'COFSTCHA ($)'
ас-8'со7 ($)'
IFSTCH410US ICHANGE LEADING SPACES TO A TAB!
IESTCHS!-D%S-QC"'LOFSTCHS ($)' “16 ) oor
ITAG1%C-6"'GOZ ($) 'CIA"COTAG ($) '1A-58'"NOZ ($)'
ICOLONI0USCIA-9"ECOOP ($) '1A-32'"NOZ ($) ILOOK FOR A COLON!
ICOLON21%S ($) CIA-32"' EOCOLON2 ($) 'QC+QS-7'"GOZ ($) 'QC+QAS-7'"EOCOLON3
($)'1A-9'NOZ ($) 'D
ICOLON3!RIA-32"EDOCOLON3
c A6 ICHG SPACES AFTER COLON TO TAB!
IOPITA-90"GOZ ($) 'IA-65"LoOZ ($) '00С
1OP21%C ($) CIA-90'"GOZ ($) '1A-64"GOOP2 ($) '14-57"GOZ ($) '1A-47''GOOP2($)'
TA-9"ECIA-32"EOZ ($) '1A-9"EOZ IGIVE UP IF NO OPERANDS!
TA-32"NOZ ($) 'QC-7'"GOZ ($) 'CIA-32"EOZ ($) '1A-9"'EOZ ($)
-D A LIF A SINGLE SPACE FOLLOWS OP, CHANGE IT TO A TAB!
1OP310UC
IEOL!%C ILOOK FOR END OF LINE OR SEMI-COLON!
IEOL211A-9"'EOEOL ($) '1A-13"G1A-59"'NOEOL ($) '0US
ISEMITRIA-32'"'NTA-9"'NOSEMI2 ($) ' '%s ($) DOSEMI ILINE UP COMMENTS!
ISEMI21QS'"NC 1 (9) ac-Qs-8"L AG)!
1Z!L>
PZ''NOSTART ($) '0UC ILOOK FOR NEXT PAGE!
IGETIYZ"' NOSTART ($) '%C-10"'NOGET ($) 'EFOEO ! QUIT WHEN 10 YANKS YIELD NO DATA !
An explanation of the macro follows.
1EO The 1EO command enables only those features
found in versions prior to 21A for which this
macro was written.
ISTART! It is assumed that the pointer is at the begin-
ning of the first page of the file.
OUL Initialize line counter.
<5! ;% |-> Count the line feed characters on the page.
ZJRTA-10""N%L’ If the last character on the page is not
a line feed, count those characters fol-
lowing the last line feed character as
one more line.
4-8 April 1975
ICOUNT LINES ON PAGE!
JQL<
OUC
1A-90"GOZ ($)'
TA"COTAG ($)'
IFSTCH211A-9''ECOOP (5)
1A-32" NOZ ($)
IFSTCH31%C-8"GOZ (§)'C
1A-32''EOFSTCH3 ($)'
1A-9"EQC-7"GOZ ($)
COFSTCH4 ($) 'QC-8'"GOZ ($)'
IFSTCH410US
IESTCHS!-D
%S-QC"LOFSTCHS ($)
(9) 007 (9)
ITAG1%C-6'"GOZ ($) 'C
TA"COTAG ($)'
1А-58'' МО 7
ICOLONI!OUSC
TECO
This is the standard technique for including
comments in TECO macros.
Execute everything which follows, down
to the > character on the second to the
last line, once for each line on the page.
Initialize first character counter for the line.
If the first character in the line is greater
than Z (decimal 90) in the ASCII set, skip
this line by jumping to 1Z1,
If the first character is alphabetic or period,
or %, or a dollar sign (i.e., legal as the
first character of a Macro language symbol),
go to ITAG!. Otherwise, go to IFSTCH2!,
If the first character is a tab, move the
pointer past the tab, then go to OPI.
If the first character is a space, continue
on to !FSTCH3!; otherwise go to Z to skip
this line.
Increment the character counter (counting
leading spaces), and if the new total is more
than eight spaces, go to Z to skip to the next
line; otherwise, move the pointer to the
next character.
If the next character is another space, go
back to IFSTCH3!.
If the character is neither a tab nor a space,
and if more than eight spaces preceded this
character, go to Z to skip to the next line.
If the character is a tab, but more than seven
spaces preceded this tab, skip to the next
line. Otherwise, move past the tab and go
to IFSTCH41,
Initialize space deleted counter.
Delete last space seen.
Increment space deleted counter. Then, if
the new value of this counter is still less
than the number of characters (spaces)
counted on the line, go back to IFSTCH5!,
When the count of spaces deleted reaches
the number of spaces there were, insert
a tab and then go to !OP!. |
Increment the character counter (counting
characters in the tag), and if the new total
is more than six spaces, go to Z to skip to
the next line. Otherwise, move the pointer
to the next character.
If the next character is a symbol constituent,
go back to ITAG!,
If the character is a colon (ASCII 5:), go
on to ICOLON!; otherwise, skip to the next
line.
Initialize counter of spaces following the
colon, and move the pointer to the next
character.
4-9 April 1975
: TECO
1А-9"ЕСООР ($)'
1A-32"NOZ (3)'
ICOLON21%S ($) C
1A-32'"EOCOLON2 ($)
QC+QS-7"GOZ ($)'
QC+QS-7"EOCOLON3 (5)
1A-9"NOZ 'D
ICOLONSIR
1A-32"EDOCOLONS (3)
c 6)
IOPITA-90"GOZ ($)'
TA-65"LOZ ($) '0UC
lOP21%C ($) C
1A-90"GOZ (5)'
1A-64" GOOP2 ($)'
1A-57"GOZ ($)'
1A-47"GOOP2 ($)'
TA-9"E
CIA-32"EOZ ($) '
lA-9" EOZ
-D
If the character after the colon is a tab,
move the pointer to the next character
and go to !1OP!.,
If the character is not a space either,
skip to the next line. Otherwise, con-
tinue on to ICOLON2!,
Increment the space-following-colon
counter, and then move the pointer to
the next character. The altmode following
%S prevents the value returned by the %S
command from being used as an argument for
the following C command.
If the next character is another space, go
back to ICOLON2!,
If the total count of the symbol characters
before the colon and the spaces after the
colon is more than seven, skip to the
next line.
If the count mentioned above exactly equals
seven, go to ICOLON3!,
With the count mentioned above less than
seven, if the next character is not a tab,
skip to the next line. If this character
is a tab, delete it and continue to
ICOLONS!.
Move pointer back one character (i.e.,
back past the next space or the colon).
If the character passed over is a space
delete it and go back to ICOLON3!.
Otherwise, the pointer is now in front
of the colon. Move it forward over the
colon and then insert a tab to replace
the deleted spaces. Then fall through to !OP!.
If the first character in the operator
field is not alphabetic, skip to the next
line. Otherwise, initialize the op field
character counter.
Increment operator field character counter
and then move pointer to the next character.
If the next character is above Z in the
ASCII set, skip to the next line. If it is
alphabetic, go back to 1OP2!,
If the character is greater than the
digit nine in the ASCII set, skip to the
next line. If it is a digit, go back to
IOP2!.
If the character is not a tab, skip to
the ' preceding the comment GIVE UP IF
NO OPERANDS. The leading spaces
are for appearance only and are ignored.
(A tab could not be used for this purpose.)
If it is a tab, move the pointer to the next
character. If this character is a tab or a
space, skip to the next line. If the charac-
ter is anything else, delete it,
4-10 April 1975
TA-32"NOZ (9)
QC-7'"GOZ ($) 'с
1A-32"EOZ ($) 1A-9"EOZ ($)'
0 4®
IOP3!IOUC
lEOL!%C ($) C
1A-9""EOEOL (8)!
1A-13"G
TA-59"NOEOL ($)'
OUS
ISEMIERTA-32"NTA-9"
NOSEMI2 Е
%$ ($) DOSEMI
ISEMI2IQS'N
C
QC-Qs-8''L = (3) '
IZIL>
Z''NOSTART($)'
TECO
If the letter following the last letter or
digit of the operator is anything but a
space (or the tab that was processed
above), skip to the next line.
If the operator is more than seven char-
acters long, skip to the next line.
Otherwise, move the pointer to the
character after the space following the
operator.
If this character is another space or a
tab, skip to the next line.
Delete the space between operator and
operand and insert a tab in its place.
Initialize operand character counter.
Increment operand character counter
and move pointer to the next character.
If the character is a tab, go back to
IEOL!,
If the character is equal to or below
carriage return in the ASCII set, skip
to the next line by skipping to the last
' in the line starting with !ISEMI2!.
If the character is not a semicolon, go
back to !EOL!.
Initialize the counter for spaces and
tabs preceding the semicolon.
Move the pointer back one more charac-
ter from the semicolon. If this character
is not a space or tab, go to !SEMI2!.
Count the space or tab, then delete it
and go back to !SEMI!,
If there are no spaces or tabs preceding
the semicolon, skip to the next line by
skipping to the next to the last ' in this
line. This check prevents most cases of
inserting tabs before semicolons that
occur in SIXBIT or ASCIZ fields.
Move pointer forward over the last char-
acter seen, and then insert a tab before
the semicolon.
If the number of characters in the operand
field, not counting the spaces and tabs
preceding the semicolon, is less than
eight, insert a second tab. Otherwise,
skip to the next line.
Move pointer to the next line, and then
go back to the beginning of the loop.
When every line on the page has been
edited by the loop, output this page,
clear the buffer, and then yank in the
next page.
If the yank produces any new data, go
back to !ISTART!.
TECO
OUC
IGETIYZ"'NOSTART ($)'
%C-10"NOGET ($) '
EF
0EO
Otherwise, initialize the yank counter.
Try another yank. If this produces any
new data, go back to ISTART!,
Increment the yank counter, and if it is
still less than 10, try again.
When a total of 10 straight yanks after the
P command fails to produce any new data,
close the output file.
The OEO command re-enables TECO com-
mands to the current version.
TECO
Chapter 5
User Errors
This chapter describes two types of errors: (1) typing errors discovered by the user before a command
string is completed, and (2) command errors detected by TECO. The user should realize, however,
that there is a third class of error. Because TECO interprets almost every character as a command,
there can be cases where, if the user fails to notice a command string typing error, TECO executes
a command that the user did not intend. For example, if the user meant to type the command
*INAME
but forgot to type the ''I'', then TECO is forced to interpret the command as an N-search for "AME"
and act accordingly. There is no way to protect the user from errors of this type.
5.1 ERASING COMMANDS
If the user makes an error while typing a command string and discovers the error before terminating
the command string (with a double altmode), the error can be corrected using one of three erasing
commands described below. All of these must be typed before the double altmode that terminates
the command string.
5.1.1 Rubout Command
Rubout is used to erase typed-in characters one at a time starting with the last character typed in.
Example
After typing the portion of the command string shown below, the user discovers that he has mispelled
the name ''Ericson''.
*3LKILEIF ERICXON
To nullify the error, he types three successive rubouts. As he does this, TECO responds by retyping
the characters which are being rubbed out.
*LKILEIF ERICXON RO N RO © RO x
The actual function of the rubout character is to delete the last typed character in the command string.
Consequently, if the incorrect character is not the last in the string, all characters back to that point
must also be rubbed out.
5-1
TECO
Rubout is a nonprinting character; consequently, the actual line appears as follows:
*LKILEIF ERICXONNOX
When the user has rubbed out the incorrect character, he continues the command string from the last
correct character.
*3LKLEIF ERICXONNOXSON ($) OTT
Two successive rubouts are required to erase a carriage return and the monitor-generated line feed
following it.
5.1.2 Double © Command
The command (© (© (two successive control -Gs) is used to erase an entire command string.
In the following example the user has decided, after typing the ""N'", to quit and start over. He does
this by typing two successive control-Gs. (Control-G echoes visibly as ''1G'' and audibly as a
*3LKILEEF ERIXON (19) (©
*
bell ring.)
© © cannot be typed in the alternate up-arrow, character form described in Section 2.2.
5.1.3 (5 Command
The ® command is another erasing command available to the TECO user. The (0) command
erases everything in a command string back to the last carriage -return/end-of -line character pair.
It does not erase the carriage -return nor end-of-line character. The end-of-line characters are line
feed, vertical tab and form feed.
In monitors previous to 5.02B, control-U is intercepted by the monitor and erases only back to the most
recent break character (carriage-return, linefeed, formfeed, altmode).
Example 1:
*ILINE ONE) The user makes an error typing the
LINE TWO ) fourth line and uses the com-
LINE THREE ) mand to erase the entire line. The
© command causes a carriage
KINE FOUR (tU) refurn-line feed to be echoed but the
LINE FOUR ) carriage return and line feed are not
o | inserted.
DO
5-2
TECO
Example 2:
*ILINE ONE J The user makes an error on the third line
LINE TWO but does not notice it until he is on the
) fourth line. In order to erase back to his
KINE THREE ) error without erasing the entire command
LINE FOUR (5 string, he types control-U, rubout,
control-U. The first erases ''LINE
FOUR", The rubout erases the line feed
@ that marks the_end of the third line, and
LINE THREE J) the second (QU) erases "LINE THREE"
LINE FOUR )) and the carriage-return at its end.
| © cannot be typed in the alternate up-arrow, character form described in Section 2,2,
5.1.4 Bell-Space Command
The bell-space command is not actually an erasing command, but it is usually used in conjunction
with the erasing commands. lts function is to cause the current line of the command string to be re-
typed. It is used when the user has typed so many rubouts on a line that he cannot tell exactly what
has been typed.
Specifically, if the user types © and space in succession, everything in the command string back
to, but not including, the last carriage return line feed pair is immediately retyped on the next line.
The user may then continue the command string just as if bell-space had not been typed. The bell-
space is not stored in the command string. Neither does it remove anything from the command string,
or affect the pointer.
*ISTAET: A T ERT:—JTRZE —sw, (O,
START: TRZE SW,CCLFLG —|; CLEAR FLAG
Example:
5,2 ERROR MESSAGES
When TECO encounters an illegal command or a command that cannot be executed, an error message
is printed on the user's terminal. An error message consists of three parts, some of which are printed
automatically and some of which can be printed at the user's option. The first part of the message is
a question mark followed by a 3-letter mnemonic code for the error message. The second is a brief,
one-line, statement of the error condition. The last part is a more complete explanation of the error.
In the standard version of TECO the first two parts of the error message are automatically printed; the
third part is printed only if the user requests it. In Section 5.2.2 there is an explanation of how to
©
5-3 April 1975
TECO
obtain the optional parts of the error message, and in Section 5.2.3 there is an explanation of how to
change TECO so that more or less of the error message is printed automatically.
When an error message is generated, the command to which it refers is not executed, the remainder
of the command string is ignored, and TECO returns to command mode. Also any commands that the
user might have typed ahead are erased.
Example:
*SWORD -4DUINEW The error message points out the presence
?NAU No Argument Before U of a U command not preceded by a numeric
+ argument. The commands SWORD -4D
have been executed, but the commands
UINEW have not.
After an error message has been printed, the user has the option to use either or both of two special
commands, ? and /, that are designed to help the user after a command error has been encountered.
These commands are described below. Note, however, that these two commands have the special
properties described below only immediately after an error has occurred. If any other command is
typed after an error has occurred, TECO assumes that a new command string is being typed and the
ability to use the ? and / commands for this error is lost.
Also note that the *i command described in Section 3.8.8 is frequently useful after an error is
q y
encountered.
5.2.1 Question Mark Command
In some cases, the user may not be able to determine immediately which command in the string caused
the error. This could occur, for example, if there were several commands of the same type in the com-
mand string. In such a case, the user can use the question mark command to obtaïn more information.
The question mark command, when used immediately after an error message typeout, causes the offend-
ing command and several of the preceding characters in the command string to be typed out. A
maximum of 10 characters of the command string are typed; usually this number is sufficient to identify
the command that caused the error. Note that when the question mark command is used in this manner,
it is not necessary to type altmode or any other character after the question mark.
A second question mark is always typed after the last character of the group. The character at which
the error was detected is the last character before the second question mark typed.
®
Another use of the question mark command is explained in Section 3.17.
5-4 May 1975
TECO
Example:
*H X 2PG2ZJ-1U2PG2ZJ According to the error message, one of
. . the G2 commands specifies a Q-register
Le) -—
INTQ No Text in Q-register 2 that does not contain text. The question
*? 27J-1U2PG?? mark command is used and the second
й G2 command is identified as the offending
— command.
5.2.2 Slash Command
When a command error occurs, one or more of the three parts of the corresponding error message is
automatically printed. If all three parts of the error message have not yet been printed and the user
needs a more detailed explanation of the error, he may type the slash command to obtain more
information.
The slash command, when used immediately after an error message, causes the next unprinted part of
the error message to be printed. It may be used enough times to cause all three parts of the error
message to be printed, but no more. Note that when the slash command is used in this manner, it is
not necessary to type altmode or any other character after the slash.
NOTE
The verbal parts 2 and 3 of the error messages printed by
TECO are obtained from a system file (TECO.ERR) ex-
ternal to TECO itself. If for any reason this file cannot
be read, only the code portion of the error message is
printed, and this is followed by the special message
''"? EEE Unable to Read Error Message File". In this
case the / command cannot be used.
Another use of / is described in Section 2.7.2.
Example:
*EBTEST.CBL ($) EX
?BAK Cannot Delete Old Backup File
*/ Failure in rename process at close of editing job
initiated by an EB command or a TECO command. There
exists an old backup file TEST.BAK with a protection
<7/7> such that it cannot be deleted. Hence the in-
put file TEST.CBL cannot be renamed to "TEST, BAK"'.
The output file is closed with the filename ""OO9TEC.TMP"".
The RENAME UUO error code is 2.
5.2.3 EH Command
As was stated above, TECO error messages consist of three parts. The first, or code, part is always
automatically typed. With the standard version of TECO, the second, brief message, part is also auto-
matically typed. The third, more lengthy part is obtained by the / command at the option of the user.
5-5
TECO
By use of the EH command, the user may change TECO so that more or less of the error message is
automatically typed. This is done as follows:
1EH sets TECO so that only the code part of the error message is automatically
printed.
2EH sets TECO so that both the code and the 1-line message parts of the
message are automatically printed.
3EH sets TECO so that all three parts of the error message are always
automatically typed.
OEH resets TECO to the system standard mode of error message typeout.
(Normally equivalent to 2EH.)
EH (with no argument) returns the value of the current EH setting.
Appendix A
TECO
TECO Error Messages
The following table lists the error messages from TECO. The three-letter message preceded by a
question mark is always typed; the second part of the error message, which is a short explanation of
the error, is always typed in standard versions of TECO. The detailed message is typed if the user
types a slash command (/) immediately following the short error message.
Table A-1
TECO Error Messages
?ARG
A4 OU N —
= и
?BAK
?COR
?COS
?EBD
Improper Arguments
The following argument combinations are illegal:
(no argument before comma)
/
m,n, (where m and n are numeric terms)
H, (because H=B, Z is already two arguments)
, (H following other arguments)
Cannot Delete Old Backup File
Failure in rename process at close of editing job initiated
by an EB command or a TECO command. There exists an
old backup file filnam.BAK with a protection<nnn> such
that it cannot be deleted. Hence the input file filnam.ext
cannot be renamed to "filnam.BAK". The output file is
closed with the filename 'nnnTEC.TEMP"', where nnn is
the user's job number. The RENAME UUQO error code is nn.
Storage Capacity Exceeded
The current operation requires more memory storage than
TECO now has and TECO is unable to obtain more core
from the monitor. This message can occur as a result of
any one of the following things:
1) command buffer overflow while a long command
string is being typed,
2) Q-register buffer overflow caused by an X or [
command,
3) editing buffer overflow caused by an insert command
or a read command.
Contradictory Output Switches
The GENLSN and SUPLSN switches may not both be used
with the same output file.
EB with Device dev Is Illegal
The EB command and the TECO command may be specified
only with file structured devices, i.e., disk and DECtape.
TECO
Table A-1 (Cont)
TECO Error Messages
?EBF
?EBO
ФЕВР
?EEE
?EMA
?EMD
?ENT-00
EB with lllegal File filnam. ext
The EB command and the TECO command may not be used
with a file having the filename extension "".BAK'' or with
a file having the name ""nnnTEC.TMP'', Where nnn is the
user's job number, the user must either use an ER-EW se-
quence, or rename the file.
EB, EW, or EZ Before Current EB Job Closed
After an output file has been opened by a TECO command
or an EB command, no further EB, EW, or EZ commands
may be given until the current output file is closed.
EB Illegal Because of File filnam.ext Protection
The file filnam.ext cannot be edited with an EB command
or a TECO command because it has a protection <nnn>
such that it cannot be renamed at close time.
Unable to Read Error Message File
An error, whose code was typed previous to this error
message, has occurred, and while TECO was trying to
find the proper error message in the error message file,
one of the following errors occurred:
1) the error message file, TECO.ERR, could not be
found on device SYS:, :
2) an input error occurred while TECO was reading the
file TECO. ERR,
3) the error message corresponding to that error code is
missing from TECO ERR,
4) the user's TECO job does not currently have enough
room for a buffer to read the error message file into,
and no more core can be obtained from the monitor,
5) for some strange reason device SYS: could not be
initialized for input.
EM with Illegal Argument nn
The argument n in an nEM command must be greater than zero.
EM with No Input Device Open
EM commands apply only to the input device, and so
should be preceded by an ER (or equivalent) command.
To position a tape for output, that unit should be tem-
porarily opened for input while doing the EM commands.
Illegal Output Filename ''filnam. ext"
ENTER UUO failure O. The filename ''filnam. ext"
specified for the output file cannot be used. The
format is invalid.
Output UFD dev: [pj, pg] Not Found
ENTER UUQ failure 1. The file filnam. ext [pj, pg]
specified for output by an EW, EZ, or MAKE command
cannot be created because there is no user file directory
with project-programmer number [pj, pg] on device dev.
Output Protection Failure
ENTER UUO failure 2. The file filnam.ext[pj, pg] speci-
fied for output by an EW, EZ, EB, MAKE, or TECO command
cannot be created either because it already exists and is
write protected <nnn> against the user, or because the UFD
it is to be entered into is write-protected against the user.
A-2
Table A-1 (Cont)
TECO Error Messages
TECO
-14
-15
-16
Output File Being Modified
ENTER UUO failure 3. The file filnam.ext specified for
output by an EW, EZ, EB, MAKE, or TECO command
cannot be created because it is current being created
or modified by another job.
Output UFD or RIB Error
ENTER UUO failure 6. The output file filnam.ext cannot
be created because a bad directory block was encountered
by the monitor while the ENTER was in progress. The user -
may try repeating the EW, EB, or TECO command, but if
the error persists, it is impossible to proceed. Notify your
system manager.
No Room or Quota Exceeded on dev:
ENTER UUO failure 14. The output file filnam.ext cannot
be created because there is no more free space on device dev:,
or because the user's quota is already exceeded there.
Write Lock on dev:
ENTER UUO failure 15. The output file filnam.ext cannot
be created because the output file structure is write-locked.
Monitor Table Space Exhausted
ENTER UUO failure 16. The output file filnam.ext cannot
be created because there is not enough table space left in
the monitor to allow the ENTER. The user may try repeating
the EW, EB, or TECO command, but if the error persists he
will have to wait until conditions improve.
Output SFD Not Found
ENTER UUO failure 23. The output file filnam.ext cannot
be created because the sub-file-directory on which it should
be ENTERed cannot be found.
Search List Empt
ENTER UUO Failure 24. The output file filnam.ext cannot
be created because the user's file structure search list is empty.
pry
Output SFD Nested too Deeply
ENTER UUO failure 25. The output file filnam.ext cannot
be created because the specified SFD path for the ENTER is
nested too deeply.
No Create for Specified SFD Path
ENTER UUO failure 26. The output file filnam.ext cannot
be created because the specified SFD path for the ENTER
is set for no creation.
ENTER Failure nn on Output File filnam. ext
The attempted ENTER of the output file filnam.ext has failed
and the monitor has returned an error code of nn. This error
is not expected to occur on an ENTER. Please send the TTY
printout showing what you are doing to DEC with an SPR form.
TECO
Table A-1 (Cont)
TECO Error Messages
?EOA
?FNF-00
-16
nn
nEO Argument Too Large
The argument n given with an EO command is larger than the
standard (maximum) setting in EO=n for this version of TECO.
This must be an older version of TECO than the user thinks he
is using; the features corresponding to EO=n do not exist.
Input File filnam.ext Not Found
LOOKUP НОО failure 0. The file filnam.ext specified for
input by an ER, EB, or TECO command was not found on the
input device dev.
Input UFD dev: [pij, pg] Not Found
LOOKUP UUO failure 1. The file filnam.ext [pi, pg] speci-
fied for input by an ER, EB, or TECO command cannot be
found because there is no User File Directory with project-
programmer number [pj,pgl on device dev.
Input Protection Failure
LOOKUP UUO failure 2. The file filnam.ext [pi, pg] speci-
fied for input by an ER, EB, or TECO command cannot be
read because it is read-protected <nnn> against the user.
Input UFD or RIB Error
LOOKUP UUO failure 6. The input file filnam.ext cannot
be read because a bad directory block was encountered by
the monitor while the LOOKUP was in progress. The user
may try repeating the ER, EB, or TECO command, but if the
error persists all is lost. Notify your system manager.
Monitor Table Space Exhausted
LOOKUP UUOQ failure 16. The input file filnam.ext cannot
be read because there is not enough table space left in the
monitor to allow the LOOKUP. The user may try repeating
the ER, EB, or TECO command, but if the error persists he
will have to wait until system conditions improve.
Input SFD not Found
LOOKUP НОО failure 23. The input file filnam.ext cannot
be found because the sub -file-directory on which it should be
looked up cannot be found.
Search List Empty
LOOKUP UVO failure 24. The input file filnam.ext cannot
be found because the user's file structure search list is empty.
Input SFD Nested too Deeply
LOOKUP UUO failure 25. The input file filnam.ext cannot
be found because the specified SFD path for the LOOKUP
is nested too deeply.
LOOKUP Failure nn on Input File filnam. ext
The attempted LOOKUP on the Input file filnam.ext has
failed and the monitor has returned an error code of nn.
This error is not expected to occur on a LOOKUP, Please
send the TTY printout showing what you were doing to DEC
with an SPR form.
A-4 April 1975
TECO
Table A-1 (Cont)
TECO Error Messages
?FUL
?1AB
ICE
ICT
?1DV
?1EC
?1EM
IFC
?1FN
ILL
?ILR
Device dev: Directory Full
ENTER UUO failure n. The file filnam.ext specified for
output by an EW or MAKE command cannot be created on
DECtape dev because the tape directory is full.
Incomplete <...> or (...) in Macro
A macro contained in a Q-register and being executed by an
M command contains an iteration that is not closed within the
Q-register by a >, or a parenthetical expression that is not
closed within the Q-register Бу а).
Illegal Control-E Command in Search Argument
A search argument contains a (5 command that is
either not defined or incomplete-
legal Control Command t<char> in text Argument
In order to be entered as text in an Insert command or search
command, all control characters (1@ - tH and tN - t+)
must be preceded by tR or tT. Otherwise they are inter-
preted as commands. The control character '' t <char>"" is
on undefined text argument control command.
Input Device dev Not Available
Initialization failure. Unable to initialize the device dev
for input. Either the device is being used by someone else
right now, or else it does not exist in the system.
lllegal Character ''<char>"' After E
The only commands starting with the letter E are EB, EF,
EG, EH, EM, EO, ER, ET, EU, EW, and EZ. When used
as a command (i.e., not in a text argument) E may not be
followed by any character except one of these.
Re-lnit Failure on Device dev After EM
Unable to re-initialize the device dev after executing an
EM command on it. If this error persists after retrying to
initialize the device with an ER command (or EW command
if output to the device is desired), consult your system manager.
Illegal Character ''<char>'" after F
The only commands starting with the letter F are FS and FN.
When used as a command (other than EF or in a text argument)
F may not be followed by any character other than one of these.
Illegal Character ''<char>"' in Filename
File specifications must be of the form dev:filnam.ext{m,n]
where dev, filnam, and ext are alphanumeric, and m and n
are numeric. No characters other than the ones specified may
appear between the EB, ER, EW, or EZ command and the
altmode terminator (($))).
Illegal Command <char>
The character ''<char>"' is not defined as a valid TECO command.
Cannot Lookup Input File filnam.ext. to Rename It
Failure in rename process at close of editing job initiated by an EB
command or a TECO command. Unable to do a LOOKUP on the ori-
ginal input file dev:filnam.ext in order to rename it "'filnam.BAK"'.
The output file is closed with the name ""nnnTEC.TMP"", where nnn
is the user's job number. The LOOKUP error code is nn.
А-5
TECO
Table A-1 (Cont)
TECO Error Messages
?1N P-nn0000
?10S
?21QC
?1QN
?1RB
?IRN
?1SA
Input Error nn0000 on File filnam.ext.
À read error has occurred during input. The input file
filnam.ext has been released. The user may try again to
read the file, but if the error persists, the user will have
to return to his backup file. The input device status word
error flags are nn0000. (Note: This number represents the
I/O status word (rh) with bits 22-35 masked out.)
(040000 -- block too large).
(100000 -- parity or checksum error).
(140000 -- block too large and parity error).
(200000 -- device error, data missed).
(240000 -- block too large and device error).
(300000 -- parity error and device error).
(340000 -- block too large, parity error, and device error).
(400000 -- improper mode).
(440000 -- block too large and improper mode).
(500000 -- parity error and improper mode).
(540000 -- block too large, parity error, and improper mode).
(600000 -- device error and improper mode).
(640000 -- block too large, device error, and improper mode).
(700000 -- parity error, device error, and improper mode).
(740000 -- block too large, parity error, device error,
and improper mode).
Illegal Character '"<char>'" in 1/O Switch
The only valid characters in switches used with file selection
commands are the alphabetic characters.
Illegal command ''<char>
The only valid '"' commands are ""G, '"'L, ""N, "E, "'C, "A,
'"'D, UV, ""W, UT, "Е, US, and "yy.
Illegal Q-register Name ''<char>""
The Q-register name specified by a Q, U, X, G, %, M,
[, 1, or * command must be a letter (A thru Z) or a digit
(0 thru 9).
Cannot Rename Input File filnam.ext to filnam.BAK
Failure in rename process at close of editing job initiated
by an EB command or a TECO command. The attempt to
rename the original input file filnam.ext to the backup
filename "filnam.BAK"' has failed. The output file is
closed with the name "'nnnTEC.TMP"', where nnn is the
user's job number. The RENAME UUO error code is nn.
Cannot RE-Init Device dev for Rename Process
Failure in rename process at close of editing job initiated
by an EB command or a TECO command. Cannot reinitialize
the original input device dev in order to rename the input file
filnam.ext to "filnam.BAK'', The output file is closed with
the name "'nnnTEC.TMP"', where nnn is the user's job number.
n Argument with Search Command
The argument preceding a search command indicates the number
of times a match must be found before the search is considered
successful. This argument must be greater than O.
TECO
Table A-1 (Cont)
TECO Error Messages
?MAP
?MEE
?MEF
?MEO
?MEQ
?MEU
?MIQ
?MLA
?MLP
Missing '
In attempting to execute a conditional skip command (a "'
command whose argument does not satisfy the required con-
dition) no ' command closing the conditional execution string
can be found. Note: n''...' strings must be complete
within a single macro level.
Macro Ending with E
A command macro being executed from a Q-register ends
with the character ''E''. This is an incomplete command.
E is the initial character of an entire set of commands. The
other character of the command begun by E must be in the
same macro with the E.
Macro Ending with F
A command macro being executed from a Q-register ends with
the character '"'F"' (not an EF). This is an incomplete command.
F is the initial character of an entire set of commands. The
other character of the command begun by F must be in the same
macro with the F.
Macro Ending with Unterminated O Command
The last command in a command macro being executed from a
Q-register is an O command with no altmode to mark the end
of the tag-name argument. The argument for the O command
must be complete within the Q-register.
Macro Ending with "'
A command macro being executed from a Q-register ends with
the '' character. This is an incomplete command. The '' com-
mand must be followed by one of the characters G, L, N, E,
C, A, D, V, W, T, F, S, or U to indicate the condition under
which the following commands are to be executed. This char-
acter must be in the Q -register with the "" .
Macro Ending with *
A command macro being executed from a Q-register ends with the
t character. This is an incomplete command. The + command
takes a single character text argument that must be in the
Q-register with the t
Macro Ending with <char>
A command macro being executed from a Q-register ends with
the character ""<char>''. This is an incomplete command.
The <char> command takes a single character text argument
to name the Q-register to which it applies. This argument
must be in the same macro as the <char> command itself.
Missing <
There is a right angle bracket not matched by a left angle
bracket somewhere to its left. (Note: an iteration in a macro
stored in a Q-register must be complete within the Q-register.)
Missing (
Command string contains a right parenthesis that is not matched
by a corresponding left parenthesis.
TECO
Table A-1 (Cont)
TECO Error Messages
?MRA
?MRP
?MUU
TNAE
?NAI
?NAQ
?NAU
?NCS
?NFI
?NFO
?NNQ
?NTQ
?OCT
Missing >
In attempting to exit from an iteration field with a ; command
(or to skip over an iteration field with a O argument) no >
command closing the iteration can be found. Note: iteration
fields must be complete within a single macro level.
Missing )
The command string contains, within an iteration field, a
parenthetical expression that is not closed by a right
parenthesis.
Macro Ending with t1
A command macro being executed from a Q-register ends with
control=t or tt, This is an incomplete command. The tt
command takes a single character text argument that must be
in the Q-register with the +t.
No Argument Before =
The command n= or n== causes the value n to be typed. The
= command must be preceded by either a specific numeric
argument or a command that returns a numeric value.
No Altmode after nl
Unless the EO value has been set to 1, the numeric insert
command nl must be immediately followed by altmode.
No Argument Before ''
The '' command must be preceded by a single numeric argu-
ment on which the decision to execute the following commands
or skip to the matching ' is based.
No Argument Before U
The command nUi stores the value n in Q-register i. The U
command must be preceded by either a specific numeric argu-
ment or a command that returns a numeric value.
No Command String Seen Prior to *i
The *i command saves the preceding command string in Q-register i.
In this case no command string has previously been given.
No File for Input
Before issuing an input command (Y or A) it is necessary
to open an input file by use of an ER, EB, or TECO command.
No File for Output
Before giving an output command (PW, P, N, EX, or EG) it
is necessary to open an output file by use of an EB, EW, EZ,
MAKE, or TECO command.
No Numeric in Q-register x
Q-register x, specified in a Q or % command, does not contain
numeric data,
No Text in Q-register x
Q-register x, specified by a G or M command, does not
contain text.
"8" or "9"! in Octal Digit String
In a digit string preceded by 10, only the octal digits
0-7 may be used.
A-8 April 1975
TECO
Table A-1 (Cont)
TECO Error Messages
PODV
POLR
POUT -nn0000
?PAR
?POP
Output Device dev Not Available
Initialization failure. Unable to initialize the device dev
for output. Either the device is being used by someone
else right now, or it is write locked, or else it does not
exist in the system,
Cannot Lookup Output File dev:filnam.ext to Rename It
Failure in rename process at close of editing job initiated by
an EB command or a TECO command. The special LOOKUP
on the output file filnam.ext required for DECtape in order to
rename the file to ''filnam.ext'' has failed. The original input
file filnam.ext has been renamed "'filnam.BAK"', but the out-
put file is closed with the name ""nnnTEC.TMP"", where nnn is
the user's job number. The LOOKUP UUQ error code is nn.
Output Error nn0000 - Output File nnnTEC. TMP Closed
An error on the output device is fatal. The output file is closed
at the end of the last data that was successfully output. It has
the filename "'nnnTEC.TMP"', where nnn is the user's job
number. See Section 4.3 for a recovery technique. The out-
put device status word error flags are nn0000. (Note: This
number represents the 1/O status word (rh) with bits 22-35
masked out.)
(000000 -- end of tape).
(040000 -- block number too large: device full or
quota exceeded).
(100000 -- parity or checksum error).
(140000 -- block number too large and parity error).
(200000 -- device error, data missed).
(240000 -- block number too large and device errror).
(300000 -- parity error and device error).
(340000 -- block number too large, parity error,
and device error).
(400000 -- improper mode or device write locked).
(440000 -- block number too large and improper mode).
(500000 -- parity error and improper mode).
(540000 -- block number too large, parity error,
and improper mode).
(600000 -- device error and improper mode).
(640000 -- block number too large, device error,
and improper mode).
(700000 -- parity error, device error, and improper
mode).
(740000 -- block number too large, parity error,
device error, and improper mode).
Confused Use of Parentheses
A string of the form (...<...) has been encountered.
Parentheses should be used only to enclose combinations
of numeric arguments. An iteration may not be opened
and not closed between a left and right parenthesis.
Attempt to Move Pointer Off Page with J, C, R, or D
The argument specified with a J, C, R, or D command must
point to a position within the current size of the buffer,
i.e., between 0 and Z, inclusive.
TECO
Table A-1 (Cont)
TECO Error Messages
?PPN
?RNO
?SAL
?SNA
?SNI
?SRH
STC
?STL
MAG
TAL
Illegal Character ''<char>'' in Project-programmer Number
Project-programmer numbers in file specifications must be given
in the form [m,n] where m and n are octal digit strings separated
by a comma. No characters other than the ones specified may
appear between the enclosing brackets.
Cannot Rename Output File nnnTEC, TMP
Failure in rename process at close of editing job initiated by
an EB command or a TECO command. The attempt to rename
the output file nnnTEC.TMP to the name "filnam.ext"
originally specified in the EB or TECO command has failed.
The original input file filnam.ext has been renamed
"filnam.BAK"', but the output file is closed with the
name "'nnnTEC.TMP"', where nnn is the user's job number.
The RENAME UUO error code is nn.
Second Argument Less Than First
In a two-argument command, the first argument must be
less than or equal to the second.
Initial Search with No Argument
A search command with null argument has been given, but
there was no preceding search command from which the
argument could be taken.
; Not in an lteration
The semicolon command may be used only with a string
of commands enclosed by angle brackets, i.e., in an
iteration field.
Cannot Find ""<text>""
À search command not preceded by a colon modifier and
not within an iteration has failed to find the specified
character string "'<text>'". After an S search fails the
pointer is left positioned at the beginning of the buffer.
After an N or + search fails the last page of the input
file has been input and, in the case of N, output, and
the buffer cleared. Note that when this message occurs,
the text string printed includes all control-character
commands included in the search argument.
Search String Too Long
The maximum length of a search string is 80 characters
including all string control commands and their arguments.
Search String too Long
The maximum length of a search string is 36 character
positions, not counting extra characters required to
specify a single position.
Missing Tag !xxx!
The tag !xxx! specified by an O command cannot be
found. This tag must be in the same macro level as the
O command referencing it.
Two Arguments with L
The L command takes at most one numeric argument, namely,
the number of lines over which the buffer pointer is to be
moved.
TECO
Table A-1 (Cont)
TECO Error Messages
TTL
TT Y
?UCA
?UFS
QUIN
PUIS
?USR
PUTG
PUVUO
Tag Too Long
Tag referenced by an O command is too long. The current limit
is 128 characters.
Illegal TTY I-O Device
À terminal may be specified as an input-output device in an
ER, EW, EZ, or MAKE command only if it is not being used
to control an attached job, the user's own terminal included.
Unterminated tA Command
A tA message type -out command has been given, but there is
no corresponding tA to mark the end of the message. tA
commands must be complete within a single command level.
Macro Ending with Unterminated File Selection Command
The last command in a command macro being executed from a
Q -register is a file selection command (ER, EW, EB, or EZ)
with no altmode to mark the end of the file specifications.
The file selection command must be complete within the
Q -register.
Unterminated Insert Command
An insert command (possibly an @ insert command) has been
given without terminating the text argument at the same
macro level.
Undefined 1/O Switch ''/xxx"!
The switch ''/xxx'" is not defined with either input or output
file selection commands. The only switches currently defined
for input or output file selection commands are
/GENLSN and /SUPLSN.
Unterminated Search Command
A search command (possibly an @ search command)
has been given without terminating the text argument at
the same macro level.
Unterminated Tag
A command string tag has been indicated by a ! command,
but there is no corresponding ! to mark the end of the tag.
Tags must be complete within a single command level.
Illegal UUO
Internal error. The illegal instruction <lh,rh> has been
encountered at address nnnnnn. This is caused by either a
TECO bug or a monitor bug. Please give printout to your
system manager, or submit it to DEC with an SPR.
A-11 April 1975
TECO
Appendix B
ASCII Characters
Table B-1
ASCII Characters
Manual Octal Decimal Comment and Section Reference
Character Symbol
Null or 000 0 Ignored on input. Ignored оп Туре -!п.
Control -Shift-P nl (8) insert only.
Control -A 001 TECO command (Section 3.17).
Control-B 002 2 Monitor command (Section 3.18). A
special character (Section 2.2).
Control-C (© 003 3 Monitor command (Section 3.10). A
special character (Section 2.2). n1($)
insert only. Echoes as *C-carriage
return-line feed.
Control -D 004 4 TECO command (Section 3.17).
Control -E (E) 005 5 TECO command (Sections 3.11 and
3.16).
Control =F (Р) 006 6 TECO command (Section 3.16).
Monitor command (Section 3.18).
A special character (Section 2.2).
Bell (© 007 7 Echoes and prints as a single bell ring
and 1G. Double (©) спа (O are
TECO commands (Section 5.1)
and special characters (Section 2.2).
Backspace © 010 8 TECO command (Section 3.16). Prints
as TH.
Tab — 011 9 TECO command (Section 3.8).
Line Feed | 012 10 Ignored in command strings except as a
text argument (Section 3.18). The
symbol | is used only to represent an
explicitly-typed line feed. lt is not
used for the line feed that the monitor
TECO
Table B-1 (Cont)
ASCII Characters
Character Manuel Octal Decimal Comment and Section Reference
ymbo
Line Feed (Cont) generates when a carriage return is typed.
In data, line feed defines the end of a
line (Section 2.3).
Vertical Tab © 013 11 In data, vertical tab defines the end of
a line (Section 2.3).
Form Feed 014 12 TECO command (Section 3.6). In data,
form feed defines the end of a page
(Section 2.3).
Carriage Return ) 015 13 Ignored in command strings except as a
text argument. (Section 3.18). When
this character is typed the monitor auto-
matically generates a line feed following
it.
Control-N (N 016 14 TECO command (Section 3.11).
Control-O 017 15 Monitor command (Section 3.6). A
special character (Section 2.2). LO
insert only. Echoes as tO -carriage
return-line feed.
Control -P 020 16 Monitor command (Section 3.18). A
special character (Section 2.2).
Control -Q e 021 17 TECO command (Section 3.11).
Control -R 022 18 TECO command (Sections 3.8 and 3.11).
Control -S (9) 023 19 TECO command (Section 3.11).
Control -T © 024 20 Two different uses as TECO commands
(Sections 3.8, 3.11, 3.16).
Control -U (UY) 025 21 TECO command (Section 5.1). A
special character (Section 2.2). п! ($) тп -
sert only. Echoes as tU carriage
return-line feed.
Control -V (Y) 026 22 TECO command (Sections 3.8 and 3.11).
Control -W (tw) 027 23 TECO command (Sections 3.8 and 3.11).
Control =X (tx) 030 24 Two different uses as TECO commands
(Section 3.11).
Control -Y (Y) 031 25
Control-Z (7) 032 26 TECO command (Section 3.10). Echoes
as tZ-carriage return-line feed. Used
as end-of-file signal when doing data
input from a TTY.
Table B-1 (Cont)
ASCII Characters
TECO
Character Manual Octal Decimal Comment and Section Reference
y mbol
Altmode or ($) 033 27 Alphanumeric argument terminator
(Control -Shif+-K) (Section 2.7). A special character
(Section 2.2). Echoes and prints as $.
Two successive altmodes are used to
terminate a command string (Section 2.6).
Control -Shift-L Gy 034 28 TECO command (Section 3.11).
Control-Shift-M | © 035 29
Control -Shift-N © 036 30 Two different uses as TECO commands
(Sections 3.8, 3.11, 3.16).
Control -Shift-O (9 037 31
Space us 040 32 TECO command (Section 2.7). Ignored
in command strings except as a text ar-
gument or when used instead of + with
numeric arguments (Section 3.18).
! 041 33 TECO command (Section 3.13).
" 042 34 Used as a prefix for a whole class of
TECO commands (Section 3.13).
# 043 35 TECO command (Section 2.7).
$ 044 36
% 045 37 TECO command (Section 3.14).
& 046 38 TECO command (Section 2.7).
047 39 TECO command (Section 3.13).
( 050 40 TECO command (Section 2.7).
) 051 41 TECO command (Section 2.7).
* 052 42 Two different uses as TECO commands
(Sections 2.7 and 2.14).
+ 053 43 TECO command (Section 2.7).
, 054 44 TECO command (Section 2.7).
- 055 45 TECO command (Section 2.7).
056 46 TECO command (Sections 3.2 and 3.4).
/ 057 47 Two different uses as TECO commands
(Sections 2.7 and 5.2).
TECO
Table B-1 (Cont)
ASCII Characters
Character Manual Octal Decimal Comment and Section Reference
ymbo
0 060 48
] 061 49
2 062 50
3 063 51
4 064 52
5 065 53
6 066 54
7 067 55
8 070 56
9 071 57
072 58 TECO command (Section 3.11). Device
name delimiter (Section 3.2).
; 073 59 TECO command (Section 3.12).
< 074 60 TECO command (Section 3.12).
= 075 61 TECO command (Section 3.15).
> 076 62 TECO command (Section 3.12).
? 077 63 Two different uses as TECO commands
(Sections 3.17 and 5.2).
100 64 TECO command (Sections 3.8 and 3.11).
A 101 65 Two different uses as TECO commands
(Sections 3.3 and 3.15).
B 102 66 TECO command (Section 3.4). Also used
in the EB command (Section 3.2).
C 103 67 TECO command (Section 3.5). Also used
in the ""C command (Section 3.13).
D 104 68 TECO command (Section 3.7).
E 105 69 Used as a prefix for many TECO com-
mands: EB, EF, EG, EH, EM, EO, ER,
ES, ET, EU, EW, EX, EZ (Sections |
3.2, 3.6, 3.9, 3.10). Also used in the
""E command (Section 3.13).
TECO
Table B-1 (Cont)
ASCII Characters
«А
Character Manual Octal Decimal Comment and Section Reference
ymbol
F 106 70 Used in the EF commands (Section 3.9).
Also in FS and FN commands (Section
3.11).
G 107 71 TECO command (Section 3.14). Also
used in the EG command (Section 3.10)
and ""G command (Section 3.13).
H 110 72 TECO command (Section 3.4).
| 111 73 TECO command (Section 3.8).
J 112 74 TECO command (Section 3.5).
K 113 75 TECO command (Section 3.7).
L 114 76 - TECO command (Section 3.5). Also
used in the ''L command (Section 3.13).
M 115 77 TECO command (Section 3.14). Also
used in the EM command (Section 3.2).
N 116 78 TECO command (Section 3.11). Also
used in the '""N command (Section 3.13).
Also used in FN command (Section 3.11).
O 117 79 TECO command (Section 3.13).
P 120 80 TECO command (Section 3.9).
Q 121 81 TECO command (Section 3.14).
R 122 82 TECO command (Section 3.5). Also
used in the ER command (Section 3.2).
S 123 83 TECO command (Section 3.11). Also
used in ES and FS commands (Section
3.11).
T 124 84 TECO command (Section 3.6). Also
used in the ET command (Sections 3.6
and 3.16).
125 85 TECO command (Section 3.14).
у 126 86
W 127 87 Used in the EW command (Section 3. 2)
and the PW command (Section 3.4).
Otherwise ignored in command strings.
X 130 88 TECO command (Section 3.14). Also
used in the EX command (Section 3.10).
TECO
Table B-1 (Cont)
ASCII Characters
Character be Octal Decimal Command and Section Reference
Y 131 89 TECO command (Section 3.3).
Z 132 90 TECO command (Section 3.4). Also
used in the EZ command (Section 3.2).
[ 133 91 TECO command (Sections 3.2 and 3.14).
N 134 92 Two different uses as TECO commands
(Sections 3.8 and 3.14).
] 135 93 TECO command (Sections 3.2 and 3.14).
tor A t 136 94 When used as a command, indicates that
the next character is to be interpreted as
a control character.
—or _ -— 137 95 TECO command (Section 3.11).
7 140 96
a 141 97 Equivalent to A in command strings.
b 142 98 Equivalent to B in command strings.
с 143 99 Equivalent to C in command strings.
d 144 100 Equivalent to D in command strings.
e 145 101 Equivalent to E in command strings.
f 146 102 Equivalent to F in command strings.
g 147 103 Equivalent to G in command strings.
h 150 104 Equivalent to H in command strings.
i 151 105 Equivalent to | in command strings.
1 152 106 Equivalent to J in command strings.
k 153 107 Equivalent to K in command strings.
| 154 108 Equivalent to L in command strings.
m 155 109 Equivalent to M in command strings.
n 156 110 Equivalent to N in command strings.
o 157 111 Equivalent to O in command strings.
p 160 112 Equivalent to P in command strings.
q 161 113 Equivalent to Q in command strings.
B-6
Table B-1 (Cont)
ASCII Characters
TECO
Character Мапа Octal Decimal Comment and Section Reference
ymbo
r 162 114 Equivalent to R in command strings.
S 163 115 Equivalent to S in command strings.
t 164 116 Equivalent to T in command strings.
u 165 117 Equivalent to U in command strings.
у 166 118 Equivalent to V in command strings.
W 167 119 Equivalent to W in command strings.
X 170 120 Equivalent to X in command strings.
y 171 121 Equivalent to Y in command strings.
z 172 122 Equivalent to Z in command strings.
{ 173 123
| 174 124
} 175 125 Converted to altmode (033) when read
from TTY unless user has specified
TTY LC mode. Equivalent to altmode
(033) when executing commands or
being typed as text if the EO value has
been set to 1.
~ 176 126 Converted to altmode (033) when read
from TTY unless user has specified
TTY LC mode. Equivalent to altmode
(033) when executing commands or
being typed as text if the EO value has
been set to 1.
Rubout or 177 127 TECO command (Section 5.1). A special
Delete character (Section 2.2).
nI($) insert only. Does not print.
Echoes as the character being erased.
Appendix C
Summary of Commands
C.1 INITIALIZATION AND FILE SELECTION
Table C-1
Command Description
TECO
Command
Function
Reference
dev:filnam. ext [proj, prog]
ERfilespec
nEM
EWfilespec
EZfilespec
EBfilespec
MAKE filespec)
TECO filespec)
/GENLSN
/SUPLSN
INITIALIZATION AND FILE SELECTION
File specifications (filespec)
Select file for input.
Position magnetic tape
Select file for output.
Erase directory contents and select file for
oufpuf.
Select file for input and output, with back-
up file protection.
Equivalent to EWfilespec ($). , or to:
ERfilespec EWfilespec Y ($)
Equivalent to EBfilespec Y.
Used with EW or EB to cause line sequence
numbers to be generated.
Used with ER, EB, or EW to suppress line
sequence numbers,
INPUT
Clear Buffer and input one page.
Input one page and append to current buffer
contents.
BUFFER POSITIONS
Before first character; O,
Current pointer position; number of characters
to the left of the pointer.
(Section 3.2)
(Section 3.2)
(Section 3.2)
(Section 3.2)
(Section 3.2)
(Section 3.2)
(Section 3.1)
(Section 3.1)
(Section 3.2)
(Section 3.2)
(Section 3.3)
(Section 3.3)
(Section 3.4)
(Section 3.4)
April 1975
TECO
Table C-1 (Cont)
Command Description
Command
Function
Reference
nJ
nC
nR
nl
nT
End of the buffer; number of characters in
the buffer.
m+1st through nth characters in the buffer.
Entire buffer; B, Z.
ARGUMENT OPERATORS
Add.
Add.
Subtract.
Multiply.
Divide and truncate.
Logical AND.
Logical OR.
Perform enclosed operations first.
Accept number in octal radix.
POINTER POSITIONING
Move pointer to position between nth and
n+1st characters.
Advance pointer n positions.
Move pointer back n positions. Equivalent
to -nC.
Move pointer to beginning of nth line from
current pointer position.
TYPE-OUT
Type all text in the buffer from the current
pointer position to the beginning of the nth
line from the pointer position.
Type the m+1st through the nth characters.
Type the decimal integer n.
Type the octal integer n.
Change typeout mode so that no substitutions
are made for nonprinting characters.
Restore typeout mode to normal.
(Section 3.4)
(Section 2.7)
(Section 3.4)
Section 2.7)
Section 2.7)
Section 2.7)
Section 2.7)
Section 2.7)
Section 2.7)
(
(
(
(
(Section 2.7)
(
(
(Section 2.7)
(
Section 2.7)
(Section 3.5)
(Section 3.5)
(Section 3.5)
(Section 3.5)
(Section 3.6)
(Section 3.6)
(Section 3.15)
(Section 3.15)
(Section 3.6)
(Section 3.6)
Table C-1 (Cont)
Command Description
TECO
Command Function Reference
OEU Flag lower case characters on typeout (Section 3.6)
(standard).
1EU Flag upper case characters on typeout. (Section 3.6)
-1EU No case flagging on typeout. (Section 3.6)
-1ES Set automatic typeout after searches. (Section 3.11)
nES(n>0) Set automatic typeout after searches and (Section 3.11)
include a character to indicate the position
of the pointer.
OES Set to no automatic typeout after searches. (Section 3.11)
(tA)message Type the message enclosed. (Section 3.17)
tL or form feed Type a form feed. (Section 3.6)
Inhibit typeout. (Section 3.6)
DELETION
nD Delete the n characters following the pointer (Section 3.7)
position.
-nD Delete the n characters preceding the pointer (Section 3.7)
position.
nK Delete all characters in the buffer from (Section 3.7)
current pointer position to the beginning
of the nth line from the pointer position.
m, nK Delete the m+1st through the nth characters. (Section 3.7)
INSERTION
ltext Insert the text delimited by | and altmode. (Section 3.8)
LO Insert the character with ASCII value n (Section 3.8)
(decimal).
@ |/TEXT/ Insert the text delimited by the arbitrary (Section 3.8)
character following |.
n\ Insert the ASCII representation of the (Section 3.8)
decimal integer n.
(Y) Translate to lower case. (Section 3.8)
© Translate to upper case. (Section 3.8)
GH When used inside text arguments, this means (Section 3.8)
translate special characters O, [, N, ], 1,
+ to "lower case'" range.
C-3
TECO
Table C-1 (Cont)
Command Description
the text is not found on the current page,
pages are input and output until it is found.
Command Function Reference
INSERTION (Cont)
Accept next character as text. (Section 3.8)
(т) Used inside text arguments to cause all control (Section 3.8)
characters except , © , and altmode
to be taken as text. Nullified by a second
OUTPUT AND EXIT
PW Output the current page and append a form (Section 3.9)
feed character to it.
nP Output the current page, clear the buffer, (Section 3.9)
and read in the next page. Continue this
process until the nth page from the current
page has been input.
m,nP Output the m+1st through the nth characters. (Section 3.9)
Do not append a form feed character, and
do not change the buffer.
EF Close the output file. (Section 3.9)
(7) or tZ Close the output file and exit to the (Section 3.10)
monitor.
(© Exit to the monitor. (Section 3.10)
EX Output the remainder of the file, close the {Section 3.10)
output file, and then exit to the monitor.
EG Output the remainder of the file, close and (Section 3.10)
then re-execute the last compile-class com-
mand that was typed.
SEARCH
nStext Search for the nth occurrence (following the (Section 3.11)
pointer) of the text delimited by S and
altmode, but do not go beyond the end of
the current page.
nFStext text Search for the nth occurrence (following the (Section 3.11)
pointer) of the first text string and replace
it with the second text string. Do not go
beyond the end of the current page.
nNtext Equivalent to nStext except that if (Section 3.11)
C-4
Table C-1 (Cont)
Command Description
TECO
character a following
Command Function Reference
SEARCH (Cont)
nFNtext text Equivalent to nFStext text except (Section 3.11)
that if the text is not found on the current
page, pages are input and output until it is
found.
n — text Equivalent to nNtext except that it (Section 3.11)
does input only, no output.
:nStext Equivalent to nStext except that it (Section 3.11)
returns a value of -1 if the search succeeds
or O if it fails instead of an error message.
The : command can also be used with FS,N,
FN, and +.
@nS/text/ Equivalent to nStext except that the (Section 3.11)
text is delimited by the arbitrary character
following the S. The @ command may also
be used with FS, N, FN, and.
0 (1) or 01X _ Reset search mode to accept either case. (Section 3.11)
Tal © or n 1X (n#0) Set search mode to ''exact'' mode. (Section 3.11)
(GV) Translate to lower case. (Section 3.11)
(м) Translate to upper case. (Section 3.11)
(1) When used inside text arguments, this means (Section 3.11)
translate special characters O, [, N, ], |,
«to "lower case'' range.
Accept next character as text. (Section 3.11)
(D Used inside text arguments to cause all (Section 3.11)
control characters except , © ,
and altmode to be taken as text. Nullified
by a second
(9 Used inside search argments to indicate (Section 3.11)
accept either case for following characters.
Nullified by a second
(x) When used inside a text argument, accept (Section 3.11)
any character at this position in the search
string.
(5) Accept any separator character at this (Section 3.11)
position.
(N a Accept any character except the arbitrary (Section 3.11)
TECO
Table C-1 (Cont)
Command Description
constituent character, execute the enclosed
commands.
Command Function Reference
SEARCH (Cont)
(9 Take the next character in the search string (Section 3.11)
literally, even if it is a control character.
@ A Accept any alphabetic character as a match. (Section 3.11)
GE) V Accept any lower case alphabetic character (Section 3.11)
as a match.
(tE) W Accept any upper case alphabetic character
as a match.
GE) D Accept any digit as a match. (Section 3.11)
@ L Accept any end-of-line character as a match. (Section 3.11)
(Е) 5 Accept any string of spaces and/or tabs (Section 3.11)
as a match.
@ <nnn> Accept the ASCII character whose octal (Section 3.11)
value is nnn as a match.
(E) [a,b,c...] Accept any one of the characters in the (Section 3.11)
brackets as a match.
ITERATION AND FLOW CONTROL
n< > Perform the enclosed command string n times. (Section 3.12)
п; If n=0, jump out of the current iteration field. (Section 3.12)
; Jump out of the current iteration field, if the (Section 3.12)
last search executed failed.
tag! Define a position in the command string with (Section 3.13)
the name ''tag'’.
Otag Jump to the position defined by !tag!. (Section 3.13)
n''Ecommands' If n=0, execute the commands specified (Section 3.13)
between "E and '; otherwise, skip to the '.
n''Ncommands' If n£0, execute the enclosed commands. (Section 3.13)
n''Lcommands' If n<0, execute the enclosed commands. (Section 3.13)
n''Gcommands' If n>0, execute the enclosed commands. (Section 3.13)
n-l''Lcommands' If n<0, execute the enclosed commands. (Section 3.13)
n+l'""Gcommands' If n>0, execute the enclosed commands. (Section 3.13)
n''Ccommands’ If n is the ASCII value (decimal) of a symbol (Section 3.13)
Table C-1 (Cont)
Command Description
TECO
preceding command string in Q-register i.
Command Function Reference
ITERATION AND FLOW CONTROL (Cont)
n''Dcommands’ If n is a digit execute the enclosed commands. (Section 3.13)
n''Acommands' If n is alphabetic, execute the enclosed (Section 3.13)
commands.
n''Vcommands' If nis lower case alphabetic, execute the (Section 3.13)
enclosed commands.
n''Wcommands' If n is upper case alphabetic, execute the (Section 3.13)
enclosed commands.
n''Tcommands' If n is true, execute the enclosed commands. (Section 3.13)
n''Fcommands' If n is false, execute the enclosed commands. (Section 3.13)
n''Scommands' If n is '""successful'', execute the enclosed (Section 3.13)
commands.
n''Ucommands' If nis ""unsuccessful'', execute the enclosed (Section 3.13)
commands.
Q-REGISTER
nUi Store the integer n in Q-register i. (Section 3.14)
Qi Equal to the value stored in Q-register i. (Section 3.14)
%i Increment the value in Q-register i by 1 (Section 3.14)
and return this value.
nXi Store, in Q-register i, all characters from (Section 3.14)
the current pointer position to the beginning
of the nth line from the pointer.
m,nXi Store the m+1st through nth characters in (Section 3.14)
Q-register i.
Gi Place the text in Q-register i at the current (Section 3.14)
pointer position.
Mi Execute the text in Q-register i as a command (Section 3.14)
string.
Ci Push the current contents of Q-register i onto (Section 3.14)
the Q-register pushdown list.
Ji Pop the last stored entry from the Q -register (Section 3.14)
pushdown list into Q-register i.
*i (As first command in a string.) Save the (Section 3.14)
TECO
Table C-1 (Cont)
Command Description
Command
Function
Reference
ТА
(E) or tE
(№ г IN
fF or (46)
(H) or tH
ET
© or 1X
EU
EO
EH
(11) xor tx
\
GT) or 1T
SPECIAL NUMERIC VALUES
The ASCII value (decimal) of the character
following the pointer.
The form feed flag. Equals 0 if no form feed
character was read on the last input, -1
otherwise.
The end-of file flag; equals -1 ¡f end of input
file seen on last input. Otherwise equals 0.
Decimal value of the console data switches.
The time of day in 60th's of a second.
The value of the type -out mode switch.
Equals O for normal type-out, -1 otherwise.
Value of the search mode flag. (O=either case
mode, -1= exact mode.)
The value of the EU flag.
+1 = flag upper case characters.
O = flag lower case characters,
-] = no case flagging on typeout.
The value of the EO flag. 1= version 21A,
2= versions 22 and 23.
The value of the EH flag. 1= code only,
2= code plus one line, 3= all of error message.
Equivalent to the ASCII value (in decimal)
of the arbitrary character x following tt.
Equivalent to the decimal value of the
digit string following the pointer.
Stop command execution and then take
on the ASCII value (in decimal) of the
character typed in by the user.
AIDS
When used after an error message, this causes
a more detailed explanation of the error to be
typed.
When used at the beginning of a command
string, this causes the entire command string
(with one of the two concluding altmodes)
to be moved into Q-register i.
(Section 3.16)
(Section 3.16)
(Section 3.16)
(Section 3.16)
(Section 3.16)
(Section 3.16)
(Section 3.11)
(Section 3.6)
(Section 3.17)
(Section 5.2)
(Section 3.16)
(Section 3.16)
(Section 3.16)
(Section 5.2)
(Section 5.2)
Table C-1 (Cont)
Command Description
TECO
AIDS (Cont)
When used after an error message, this causes
the offending command to be typed out (with
a few of the commands preceding it).
Enter trace mode. A second ? command
takes TECO out of trace mode.
Erose last character typed in the command
string.
Erase the entire command string.
Erase everything typed in back to the last
break character.
Retype current line of command string.
Restore the EO value to standard.
Set the EO value to n.
Type only code part of error messages.
Type error code plus one line.
Type all three parts of error.
Equivalent to 2EH.
(Section 5.
(Section 3.
(Section 5.
(Section 5.
(Section 5.
(Section 5.
(Section 3.
(Section 3.
(Section 5.
(Section 5.
(Section 5.
(Section 5.
17)
1)
1)
1)
17)
17)
2)
N
—
INDEX (TECO)
A
tA (control-A) see Control commands
A (append) command, 3-11, 3-47, 3-55
Addition, 2-9
Alphabetic case control
in insert commands, 3-22
in search arguments, 3-36
Alphanumeric argument, 2-4, 2-8,
Altmode, 2-3, 2-4, 2-7, 2-8, 3-5, 3-15, 3-20,
3-21, 3-42, 3-45, 3-49, 3-50, 5-1
& (ampersand), 2-10 |
AND, 2-10
<> (angle brackets), 3-42, 3-45
'(apostrophe) command, 3-46, 4-11
Arguments, 3-1
alphanumeric, 2
numeric, 2-9, 3
text, 2-8
-4, 2-8
-5, 3-11
~~
Argument pair, 2-9
Argument terminator, 3-5
Arithmetic/logical operators, 2-9, 2-10
* (asterisk), 2-8, 2-10, 3-1, 3-2, 3-3, 3-16
*i command, 3-25, 3-50
@ {at sign modifier), 3-35
@ | command, 3-20, 3-53
Automatic typeout
after searches, 3-36
flag, obtaining the value, 3-55
B
'B (control-B) see Control commands
B, 3-12
+ (back arrow) command, 3-34
t\ (control -backslash) command, see control
commands
\ (backslash) command, 3-21, 3-56, 3-57
Backspace one file, 3-6
Back up one record, 3-6
Backup file, 3-7, 3-9
BAK, 2-2, 3-3, 3-7
Bell, 2-4, 5-2
Bell-space command, 5-3
Blank page, 3-28, 3-29
Blank tape, 3-6
Blocks of text, 4-3
Boundary of the buffer, 3-13
Brackets, angle see Angle brackets
Brackets, square see Square brackets
Break character, 5-2
Buffer boundary, 3-13
Buffer, command string, 2-12
,editing, 2-7, 2-11, 2-12
pointer, 2-7, 3-10, 3-11, 3-12, 3-13,
3-14, 3-18, 3-21, 3-22, 3-32, 3-34,
3-50, 3-56
position, 2-9, 3-11
Buffers, 1-1, 2-12, 3-11
C
1C (control-C) command see Control commands
C command, 3-12, 3-47
Caret, 2-7
Carriage return, 2-4, 2-7, 3-16, 3-21, 3-60,
5-2
Case control
in insert commands, 3-22
in search arguments, 3-36
Case flagging on typeout, 3-16
Case flag, obtaining the value, 3-55
Case match mode control in searches, 3-39
Categories of TECO commands, 2-11
Causing the current line to be retyped, 5-3
Changing
amount of error reporting, 5-6
maximum number of entries in the Q-register
pushdown list, 3-5
Character set, 2-2
Character strings, 2-12, 3-50
Characters, control, 2-4
,special, 2-3
Close, 3-6, 3-7, 3-28, 3-30, 4-1
Index -1
INDEX (TECO) (Cont)
: (colon), 3-5,
: (colon modifier), 3-33, 3-35
: (colon) search, 3-35, 3-48
Comma, 2-9
Command buffer, 3-32
Command error, 2-8, 5-1
Command mode, 3-1
Command string buffer, 2-12
Command strings, 2-7, 2-8, 2-12, 3-30, 3-31,
3-45, 3-50, 3-60, 5-1, 5-3
Command string syntax, 2-7
Commands
edit class, 3-2
erasing, 2-3
immediate action, 2-3
monitor, 2-3, 3-2
that return a value, 2-11
Commands, summary of see Appendix C
Comments, 3-48
Compile-class command, 3-30
COMPILE command, 3-30
Conditional branch, 3-35, 3-38
Conditional command, 3-30
Conditional execution, 3-40
Conditional execution commands, 3-46, 3-48
Conditional skip, 3-45
Console data switches, 3-55, 3-56
CONTINUE, 3-31
Control characters, 2-3, 3-15, 3-40
Control commands
tt, 3-24
tv, 3-39
t[, 2-3
tA, 3-56, 3-57
'C, 2-3, 3-29, 3-30, 3-44
tE, 3-40, 3-55
tF, 3-55, 3-57
1G, 2-3, 3-60, 5-2
1G 1G, 2-3, 5-2
1G _ 5, 5-3
tH, 3-55, 3-57
tL, 3-15
IN, 3-40, 3-42, 3-55
'Ю, 2-3, 3-14, 3-17
tR, 3-25, 3-39, 3-40
15, 3-40, 3-42
tT, 3-25, 3-39, 3-56, 3-57
У, 3-22, 3-37
1V1V, 3-23, 3-37
W, 3-22, 3-37
'W1W, 3-23, 3-37
tU, 2-3, 3-60, 5-2, 5-3
IX, 3-40, 3-42
17, 3-29, 3-30
Converting special characters to lower case,
3-24, 3-39
Core, 1-1, 2-6, 2-12, 3-1, 3-10, 3-11,
3-50, 4-3
Core expansion, 2-12, 3-10, 3-11
Create, 3-2, 3-4
Creating a TECO macro, 3-25
CTRL key, 2-3
Current line, 2-7, 3-13, 3-15, 5-3
D (delete) command, 3-18, 3-19, 3-47
DEBUG, 3-30
Decimal number, 3-20
Designating particular groups of characters as a
match in searches, 3-40
Determining the command that caused an error,
5-4
Device, 1-1, 3-2, 3-3, 3-4, 3-5, 3-7
Device name, 2-1, 3-5
Digit string, 3-56
Directory structured devices, 3-4
Disk area, 3-5
Divide, 2-10
$ (dollar sign), 3-15, 3-40
tE (control-E) see Control commands
E command, 3-47
EB command, 3-3, 3-7
Echo, 2-4
Edit, 3-2, 3-4
Edit-class command, 3-2
Index -2
INDEX (TECO) (Cont)
Editing buffer, 2-7, 2-11, 3-8, 3-10, 3-14 Features enabled by EO values greater than 1,
3-19, 3-20, 3-21, 3-26, 3-32, 3-33, 3-50 3-59
Editing existing files, 3-2 File selection, 3-3, 3-5
Editing, programmed, 2-11 Filename, 2-1, 2-2, 3-2, 3-3, 3-4, 3-5
Editing line-sequence numbered files, 3-8 Filename extension, 2-2, 3-3, 3-5, 3-7
EF command, 3-28 Flow control commands, 3-45
EG command, 3-29, 3-30, 4-2 FN command, 3-34
EH command, 3-55, 5-5 Format, 2-5
EM command, 3-5, 3-6 Formatting command strings, 3-60
End-of file flag, obtaining value, 3-55 Form feed characters, 2-2, 2-4, 2-5, 2-6, 3-10,
End of file record, 3-6 3-15, 3-26, 3-27, 3-28, 4-3, 4-4, 4-6
EO command, 3-55, 3-59 Form feed flag, 3-10, 3-27, 3-55, 3-56
EO value, 3-58 Form feed processing, 4-3
= (equal sign) command, 3-54, 3-57 FS command, 3-33
ER, 3-5, 3-8
Erasing
G
tG (control-G) see Control commands
entire command string, 5-2
single character, 5-2 G command, 3-47, 3-50
Erasing commands, 2-3, 3-60, 5-1, 5-2 /GENLSN (generate line-sequence numbers)
Error, command See Command Error switch, 3-8
Error message flag, obtaining the value, 3-55, H
5-6
1H (control-H) see Control commands
Error messages, 5-3, 5-4, A-1
Errors, 5-1 H, 3-12
ESC, 2-3, 2-4 HP command, 4-4, 4-5
ES command, 3-36, 3-55 I
ET command, 3-15, 3-55, 3-57
ET flag, 3-55, 3-57
EU command, 3-55
EW command, 3-2, 3-5, 3-6, 3-28
Exclamation point, 3-46
*I command, 3-25, 3-50
| command, 3-20, 3-21
Idle state, 3-1
Immediate action commands, 2-3
Increasing the number of entries in the pushdown
EX command, 3-29, 3-30, 4-1, 4-2 stack, 2-11
EXECUTE, 3-30 Increment, 3-49
Execution, 2-7, 2-12 Initialization, 3-1, 3-4
Exit, 3-29, 3-30, 3-31 Input, 2-1, 2-2, 3-3, 3-5, 3-7, 3-9, 3-10,
3-26, 3-27, 3-30, 3-32, 3-33
Input file, 2-1, 3-26, 3-30, 3-32, 3-33, 3-42
Insert, 2-1, 2-2, 3-2, 3-18, 3-19
F Inserting
Exit command, 3-29, 3-30, 3-32
EZ command, 3-7
control characters, 3-25
single control characters as text, 3-25
t - :
F (control -F) see Control commands succeeding control characters as text, 3-25
F command, 3-47
Index -3
INDEX (TECO) (Cont)
Insertion, 4-1
Insertion command, 3-18
Inside-text command, 3-25, 3-39
Integer divide, 2-10
lteration, 3-43, 3-50
Interpreting control-characters as text in searches
single characters, 3-39
succeeding characters, 3-39
J
J command, 3-12
K
K command, 3-18, 3-19
L
tL (control-L) see Control commands
L command, 3-13, 3-47
Line, 2-5, 3-13, 3-14, 3-22
Line feed, 2-4, 2-5, 3-10, 3-16, 3-60, 5-2
Line sequence numbered files, 3-8
Line sequence numbers, 2-6, 3-8
Line terminators, 2-5
Literal type-out mode, 3-15
LOAD, 3-30
Load point, 3-6
Loop, 3-32, 3-43
Logical AND, 2-10
Logical OR, 2-10
Lower case flagging, 3-16
M
M command, 3-50, 4-7
Macro, 4-7, 4-8
Main uses of TECO, 3-1
Magnetic tape, 3-5, 3-6, 3-9
Maximum length of search strings, 3-32
Merge, 4-4, 4-5
- (minus), 2-10
Modifiers, 3-35
Monitor commands, 2-3, 3-2
Multiply, 2-10
Multi-purpose commands, 4-1
N
tN (control -N) see Control commands
N command, 3-33, 3-35, 3-47, 4-4
nA command, 3-55
n\ command, 3-20
Negation, 2-10
nI(S)command, 3-20
nK CORE, 2-12, 3-10
nnnTEC.TMP, 3-3, 3-7
No case flagging, 3-16
No prevailing case conversion, 3-24
Numeric argument, 2-9, 3-5, 3-11, 3-35
Numeric operators, 2-10
Null, 2-2
Null extension, 2-2, 3-5
Null page, 2-6
O
tO (control -0O) see Control commands
Obtaining more information about errors, 5-5
Obtaining the value of
automatic typeout flag, 3-55
case flag, 3-55
end-of file flag, 3-55
error message flag, 3-55, 5-6
search mode flag, 40
typeout mode switch, 3-15
version number flag, 3-55
O command, 3-46
Octal numbers, 2-10
Opening a new file, 3-2
MAKE command, 3-1, 3-2, 3-4, 3-6, 4-1, 4-2 Operators, 2-10
Index -4
INDEX (TECO) (Cont)
OR, 2-10
? (question mark) command, 3-58, 5-4
Output, 2-2, 3-4, 3-5, 3-6, 3-26, 3-28, 3-30, '' (quotation mark) command, 3-36, 4-8
3-31, 3-41, 3-56, 4-1, 4-4
Output commands, 3-26
Output error, 4-7
R
Output file, 2-1, 3-26, 3-27, 3-29, 3-32, 3-34 IR (control-R) see Control commands
P command, 3-26, 3-28, 3-34
Page, 2-5, 2-6, 2-7, 3-10, 3-21, 3-26, 3-33,
3-41, 3-56, 4-3, 4-5
Parentheses, 2-10
Parts of error messages, 5-3
% (percent sign) command, 3-49, 4-8
Period, 2-2, 3-40, 3-47
. (period), 3-12, 3-47
+ (plus), 2-9
Pointer, buffer see Buffer pointer
Position, buffer, 2-9
Programmed editing, 2-11
Programmer number, 3-5
Project number, 3-5
Project-programmer area, 3-2, 3-3, 3-9
Project-programmer number, 3-5, 3-7
[proj,progl, 3-5
Protecting old macros from new features in
TECO, 3-59
Pushdown stack, increasing the number of
entries, 2-11
Putting comments in TECO macros, 3-46
PW command, 3-26, 3-27, 3-28, 4-4, 4-6
PWY command, 3-27
Q command, 3-49
Q-registers, 2-11, 2-12, 3-49, 3-50
Q-register commands, 3-49
Q-register pushdown list, 3-51
Q-register pushdown stack, 2-11
R command, 3-12
R TECO command, 3-1, 3-3, 3-4
Rearranging, 4-3
REENTER, 3-31, 3-44
Release, 3-5, 3-7
Rename, 3-3, 3-7
Restoring TECO to no prevailing case conversion,
3-24, 3-38
Return a numeric value, 3-35, 3-55
Retyping the current line, 5-3
Rewind, 3-6, 3-9
Rubout, 2-3, 2-4, 3-22, 3-60, 4-1, 5-1
tS (control -S) see Control commands
S command, 3-33, 3-35, 3-47
Saving the previous command string, 3-50
Search, 3-32, 3-33, 3-34
Search command modifiers, 3-35
Searching
and deleting strings, 3-33, 3-34
and replacing strings, 3-33, 3-34
in "'either-case-mode'', 3-39
in ‘’exact-case-mode!', 3-39, 3-40
partly in ‘'exact-case'' and partly in
‘'either-case'! mode, 3-39
Search string, 3-32, 3-33, 3-35
; (semicolon) command, 3-43, 3-45
Separator character, 3-40
Setting
case flagging mode, 3-16
EO value, 3-59
TECO to a prevailing case conversion mode,
3-23, 3-37
version number of TECO, 3-59
Skip, 3-27, 3-28
Skip one file, 3-6
Index -5
INDEX (TECO) (Cont)
Skip one record, 3-6
Skip to end-of-tape, 3-6
/ (slash), 2-10
/ (slash) command, 5-5
Space, 2-4, 2-9, 3-60
Special characters, 2-3, 3-20, 3-46
Special "lower case" characters, 3-24, 3-39
Special numeric values, 3-54
Splitting, 4-4
[ ] (square brackets), 3-51
Strings, command, 2-3, 2-8, 2-12
Subroutine, 2-12
Subtraction, 2-10
/SUPLSN (suppress line-sequence numbers)
switch, 3-8
Switches for line-sequence numbers, 3-8
Symbols, 2-4
tT (control-T) see Control commands
T command, 3-14, 3-47
Tab, 2-4, 2-5
Tab command, 3-20
Tag, 3-46
TECO command, 3-2, 3-3, 3-4, 3-7, 3-10, 4-2
TECO filnam.ext command, 3-3
Teletype, 1-1, 2-1
Temporary case conversion, 3-22, 3-37
Temporary file, 3-7
Terminator, argument, 3-5
Text argument, 2-8, 3-20, 3-32, 3-35, 3-46
Text block movement, 2-11
Time of day, 3-55, 3-57
Trace mode, 3-58
Translating
group of characters to lower case, 3-23, 3-37
group of characters to upper case, 3-23, 3-37
single characters to lower case, 3-23, 3-37
single characters to upper case, 3-23, 3-37
Type-in, 3-60
Type-out, 3-14, 3-54
Type-out commands, 3-14, 3-54
Type-out mode, 3-16
Typing a numeric value
in decimal, 3-54
in octal, 3-54
Typing errors, 5-1
TTY used as an 1/O device, 2-2
U
tU (control =U) see Control commands
tt (control up-arrow), 3-24, 3-39, 3-56
U command, 3-47, 3-49
Unconditional branch, 3-46
Underline, 2-4
Unload, 3-6
Up-arrow, 2-4
Uparrow-O, 2-10
Update, 3-7
Upper case flagging, 3-16
Uses of TECO, 3-16
V
tV (control-V) see Control commands
V command, 3-47
Values, obtaining
automatic typeout flag, 3-55
case flag, 3-55
end-of -file flag, 3-55
error message flag, 3-55, 5-6
search mode flag, 3-40
typeout mode switch, 3-15
version number flag, 3-55
Version number flag, obtaining the value, 3-55
Vertical tab, 2-4, 2-5
W
tW (control -W) see Control commands
W command, 3-47
Index-6
INDEX (TECO) (Cont)
X
tX (control =X) see Control commands
X command, 3-49, 3-50
Y
Y command, 3-3, 3-7, 3-10, 3-55
Yank command, 3-10
Z
tZ (control -Z) see Control commands
Z, 3-12, 3-21, 4-10
ZJ command, 3-13
Index -7
HOW TO OBTAIN SOFTWARE INFORMATION
SOFTWARE NEWSLETTERS, MAILING LIST
The Software Communications Group, located at corporate headquarters in
Maynard, publishes software newsletters for the various DIGITAL products.
Newsletters are published monthly, and keep the user informed about cus-
tomer software problems and solutions, new software products, documenta-
tion corrections, as well as programming notes and techniques.
There are two similar levels of service:
. The Software Dispatch
. The Digital Software News
The Software Dispatch is part of the Software Maintenance Service. This
service applies to the following software products:
PDP- 9/15
RSX-11D
DOS/BATCH
RSTS-E
DECsystem-10
A Digital Software News for the PDP-11] and a Digital Software News for
the PDP-8/12 are available to any customer who has purchased PDP-11 or
PDP-8/12 software.
A collection of existing problems and solutions for a given software
system is published periodically. A customer receives this publication
with his initial software kit with the delivery of his system. This
collection would be either a Software Dispatch Review or Software Per-
formance Summary depending on the system ordered.
A mailing list of users who receive software newsletters is also main-
tained by Software Communications. Users must sign-up for the news-
letter they desire. This can be done by either completing the form sup-
plied with the Review or Summary or by writing to:
Software Communications
P.O. Box F
Maynard, Massachusetts 01754
SOFTWARE PROBLEMS
Questions or problems relating to DIGITAL's software should be reported
as follows:
North and South American Submitters:
Upon completion of Software Performance Report (SPR) form remove last
copy and send remainder to:
Software Communications
P.O. Box F
Maynard, Massachusetts 01754
The acknowledgement copy will be returned along with a blank SPR form
upon receipt. The acknowledgement will contain a DIGITAL assigned SPR
number. The SPR number or the preprinted number should be referenced in
any future correspondence. Additional SPR forms may be obtained from
the above address.
All International Submitters:
Upon completion of the SPR form, reserve the last copy and send the re-
mainder to the SPR Center in the nearest DIGITAL office. SPR forms are
also available from our SPR Centers.
PROGRAMS AND MANUALS
Software and manuals should be ordered by title and order number. In the
United States, send orders to the nearest distribution center.
Digital Equipment Corporation Digital Equipment Corporation
Software Distribution Center Software Distribution Center
146 Main Street 1400 Terra Bella
Maynard, Massachusetts 01754 Mountain View, California 94043
Outside of the United States, orders should be directed to the nearest
Digital Field Sales Office or representative.
USERS SOCIETY
DECUS, Digital Equipment Computers Users Society, maintains a user ex-
change center for user-written programs and technical application infor-
mation. The Library contains approximately 1,900 programs for all
DIGITAL computer lines. Executive routines, editors, debuggers, special
functions, games, maintenance and various other classes of programs are
available.
DECUS Program Library Catalogs are routinely updated and contain lists
and abstracts of all programs according to computer line:
: PDP-8, FOCAL-8, BASIC-8, PDP-12
. PDP-7/9, 9, 15
. PDP-11, RSTS-11
. PDP-6/10, 10
Forms and information on acquiring and submitting programs to the DECUS
Library may be obtained from the DECUS office.
In addition to the catalogs, DECUS also publishes the following:
DECUSCOPE ~The Society's technical newsletter, published bi-monthly,
aimed at facilitating the interchange of technical in-
formation among users of DIGITAL computers and at dis-
seminating news items concerning the Society. Circula-
tion reached 19,000 in May, 1974.
PROCEEDINGS OF -Contains technical papers presented at DECUS Symposia
THE DIGITAL held twice a year in the United States, once a year
EQUIPMENT USERS in Europe, Australia, and Canada.
SOCIETY
MINUTES OF THE -A report of the DECsystem-10 sessions held at the two
DECsystem-10 United States DECUS Symposia.
SESSIONS |
COPY-N-Mail -A monthly mailed communique among DECsystem-10 users.
LUG/SIG -Mailing of Local User Group (LUG) and Special Interest
Group (SIG) communique, aimed at providing closer
communication among users of a specific product or
application.
Further information on the DECUS Library, publications, and other DECUS
activities is available from the DECUS offices listed below:
DECUS DECUS EUROPE
Digital Equipment Corporation Digital Equipment Corp. International
146 Main Street (Europe)
Maynard, Massachusetts 01754 Р.О. Box 340
1211 Geneva 26
Switzerland
DECsystem-10 TECO
Text Editor and Corrector
DEC-10-UTPRA-A-D
READER'S COMMENTS
NOTE: This form is for document comments only. Problems
with software should be reported on a Software
Problem Repcrt (SPR) form (see the HOW TO OBTAIN
SOFTWARE INFORMATION page).
Did you find errors in this manual? If so, specify by page.
Did you find this manual understandable, usable, and well-organized?
Please make suggestions for improvement.
©
с
|=
1.2 2
[==
IS
L
o
5 Is there sufficient documentation on associated system programs
о required for use of the software described in this manual? If not,
3 what material is missing and where should it be placed?
Ф
a
Please indicate the type of user/reader that you most nearly represent.
Assembly language programmer
Higher-level language programmer
Occasional programmer (experienced)
User with little programming experience
Student programmer
Non-programmer interested in computer concepts and capabilities
Name Date
Organization
Street
City State Zip Code
or
Country
If you do not require a written reply, please check here. [
UOOUOO
Fold Here
am
Do Not Tear - Fold Here and Staple
FIRST CLASS
PERMIT NO. 33
MAYNARD, MASS.
BUSINESS REPLY MAIL
NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES
Postage will be paid by:
SOSOOEN
Software Communications
P. O. Box F
Maynard, Massachusetts 01754
| ©
DECsystem-10 TECO
Text Editor and Corrector
DEC-10-UTPRA-A-D
READER'S COMMENTS
NOTE: This form is for document comments only. Problems
with software should be reported on a Software
Problem Repcrt (SPR) form (see the HOW TO OBTAIN
SOFTWARE INFORMATION page).
Did you find errors in this manual? If so, specify by page.
Did you find this manual understandable, usable, and well-organized?
Please make suggestions for improvement.
Is there sufficient documentation on associated system programs
required for use of the software described in this manual? If not,
what material is missing and where should it be placed?
Please indicate the type of user/reader that you most nearly represent.
Assembly language programmer
Higher-level language programmer
Occasional programmer (experienced)
User with little programming experience
Student programmer
000000
Non-programmer interested in computer concepts and capabilities
Name Date
Organization
Street
City State Zip Code
or
Country
If you do not require a written reply, please check here. []
Fold Here
Do Not Tear - Fold Here and Staple
FIRST CLASS
PERMIT NO. 33
MAYNARD, MASS.
BUSINESS REPLY MAIL
NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES
Postage will be paid by:
Software Communications
P. O. Box F
Maynard, Massachusetts 01754
DECsystem-10 TECO
Text Editor and Corrector
DEC-10-UTPRA-A-D
READER'S COMMENTS
NOTE: This form is for document comments only. Problems
with software should be reported on a Software
Problem Report (SPR) form (see the HOW TO OBTAIN
SOFTWARE INFORMATION page).
Did you find errors in this manual? If so, specify by page.
Did you find this manual understandable, usable, and well-organized?
Please make suggestions for improvement.
| 8
=
2
|=
В
L
о
5 Is there sufficient documentation on associated system programs
о required for use of the software described in this manual? If not,
8 what material is missing and where should it be placed?
Ф
a
Please indicate the type of user/reader that you most nearly represent.
Assembly language programmer
Higher-level language programmer
Occasional programmer (experienced)
User with little programming experience
Student programmer
Non-programmer interested in computer concepts and capabilities
Name Date
Organization
Street
City State Zip Code
or
Country
If you do not require a written reply, please check here. U)
000000
Fold Here
Do Not Tear - Fold Here and Staple
FIRST CLASS
PERMIT NO. 33
MAYNARD, MASS.
BUSINESS REPLY MAIL
NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES
Postage will be paid by:
digiltial
Software Communications
P. O. Box F
Maynard, Massachusetts 01754
">
/
Unduh
Hanya pengingat ramah. Anda dapat melihat dokumen di sini. Tetapi yang paling penting, AI kami telah membacanya. Ia dapat menjelaskan hal-hal kompleks dengan istilah sederhana, menjawab pertanyaan Anda dalam bahasa apa pun, dan membantu Anda menavigasi dengan cepat bahkan dokumen terpanjang atau paling rumit.
Iklan