There is 1 other file named tec124.rnd in the archive. Click here to see a list.
.title TECO VERSION 124A
.center;TECO VERSION 124A
.center;February 27, 1979
.center;Table of Contents
1.0 INTRODUCTION. . . . . . . . . . . . . . . . . . . . . . . 3
2.0 FILES . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1 Directories. . . . . . . . . . . . . . . . . . . . . . 3
2.2 EY Command . . . . . . . . . . . . . . . . . . . . . . 3
2.3 EB Changes . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Filespec Defaulting. . . . . . . . . . . . . . . . . . 4
2.5 EA Command . . . . . . . . . . . . . . . . . . . . . . 5
2.6 EK Command . . . . . . . . . . . . . . . . . . . . . . 5
2.7 File Protections . . . . . . . . . . . . . . . . . . . 5
2.8 EN Command . . . . . . . . . . . . . . . . . . . . . . 5
2.9 New Switches . . . . . . . . . . . . . . . . . . . . . 6
2.9.1 /READONLY. . . . . . . . . . . . . . . . . . . . . . 6
2.9.2 /INPLACE . . . . . . . . . . . . . . . . . . . . . . 6
2.9.3 /NOLSN . . . . . . . . . . . . . . . . . . . . . . . 6
2.9.4 /DEFAULT . . . . . . . . . . . . . . . . . . . . . . 7
2.10 ^P And ^Y Commands . . . . . . . . . . . . . . . . . . 7
2.11 ^U Command . . . . . . . . . . . . . . . . . . . . . . 7
2.12 :A Command . . . . . . . . . . . . . . . . . . . . . . 8
3.0 Q-REGISTER "*" AND ASSOCIATED COMMANDS. . . . . . . . . . 8
3.1 EP Command . . . . . . . . . . . . . . . . . . . . . . 8
3.2 EI Command . . . . . . . . . . . . . . . . . . . . . . 8
4.0 INITIALIZATION AND TERMINATION. . . . . . . . . . . . . . 9
4.1 TECO.INI . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Monitor Command Extensions . . . . . . . . . . . . . . 9
4.2.1 MAKE Command . . . . . . . . . . . . . . . . . . . . 9
4.2.2 Auxillary Command String . . . . . . . . . . . . . . 10
4.3 ED Command . . . . . . . . . . . . . . . . . . . . . . 11
4.4 EE Command . . . . . . . . . . . . . . . . . . . . . . 11
4.5 ^C, REENTER. . . . . . . . . . . . . . . . . . . . . . 12
5.0 SEARCHING AND INSERTING . . . . . . . . . . . . . . . . . 12
5.1 Negative Searches. . . . . . . . . . . . . . . . . . . 12
5.2 Bounded Searches . . . . . . . . . . . . . . . . . . . 12
5.3 FD Command . . . . . . . . . . . . . . . . . . . . . . 13
5.4 Search Failures. . . . . . . . . . . . . . . . . . . . 13
5.5 Null Replacement FS Commands . . . . . . . . . . . . . 13
5.6 ^G Text Command. . . . . . . . . . . . . . . . . . . . 13
5.7 Searches Within Iterations . . . . . . . . . . . . . . 13
6.0 Q-REGISTERS AND MACROS. . . . . . . . . . . . . . . . . . 14
6.1 Text Type-out From A Q-register. . . . . . . . . . . . 14
6.2 U Command. . . . . . . . . . . . . . . . . . . . . . . 14
6.3 [ Command. . . . . . . . . . . . . . . . . . . . . . . 14
6.4 Arguments. . . . . . . . . . . . . . . . . . . . . . . 14
6.5 W Command. . . . . . . . . . . . . . . . . . . . . . . 14
7.0 TERMINALS, TYPE-IN, AND TYPE-OUT. . . . . . . . . . . . . 15
7.1 V Command. . . . . . . . . . . . . . . . . . . . . . . 15
7.2 Extended TTCALLS . . . . . . . . . . . . . . . . . . . 15
7.3 Echoing. . . . . . . . . . . . . . . . . . . . . . . . 15
7.4 Image Type-Out . . . . . . . . . . . . . . . . . . . . 16
7.5 ^A Changes . . . . . . . . . . . . . . . . . . . . . . 16
7.6 = Changes. . . . . . . . . . . . . . . . . . . . . . . 16
7.7 ^G<period> . . . . . . . . . . . . . . . . . . . . . . 16
7.8 EV Command . . . . . . . . . . . . . . . . . . . . . . 16
8.0 LOG FILES . . . . . . . . . . . . . . . . . . . . . . . . 17
9.0 ERROR PROCESSING. . . . . . . . . . . . . . . . . . . . . 18
9.1 Colon Modifier . . . . . . . . . . . . . . . . . . . . 18
9.2 Error Message Levels . . . . . . . . . . . . . . . . . 19
9.3 Stack Overflows. . . . . . . . . . . . . . . . . . . . 19
10.0 MISCELLANEOUS . . . . . . . . . . . . . . . . . . . . . . 19
10.1 EC Command . . . . . . . . . . . . . . . . . . . . . . 19
10.2 GETTAB, PEEK . . . . . . . . . . . . . . . . . . . . . 19
10.3 ^F Command . . . . . . . . . . . . . . . . . . . . . . 19
10.4 \\ Command . . . . . . . . . . . . . . . . . . . . . . 20
10.5 nA Command . . . . . . . . . . . . . . . . . . . . . . 20
10.6 Line Feed, Backspace, And Semicolon Commands . . . . . 20
11.0 IMPROVEMENTS TO EXISTING FEATURES . . . . . . . . . . . . 20
11.1 EX Command . . . . . . . . . . . . . . . . . . . . . . 20
11.2 New Search Algorithm . . . . . . . . . . . . . . . . . 20
12.0 BUGS AND INCOMPATIBILITIES. . . . . . . . . . . . . . . . 21
13.0 NEW ERROR MESSAGES. . . . . . . . . . . . . . . . . . . . 22
APPENDIX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
.hl 1 Introduction
This document describes the differences between TECO version 124A and DEC TECO
version 24. The development of TECO 124A was begun at Stevens Institute of
Technology by John Potochnak, Gary Brown, and Robert McQueen.
Their efforts produced TECO 123, which contained about 70% of the new
features described herein. More new features were added by Clive Dawson
at the University of Texas at Austin, producing TECO 124. Development
has continued at both installations on a joint, if informal, basis.
Several other installations have recently contributed to the
development of TECO 124A by sending bug fixes and other suggestions.
Most notable was the work done by Jim Thomas at the Univ_. of New Orleans
who implemented the Boyer-Moore fast string search algorithm, Jim Simpson of the
Department of Defense who contributed much to the TECO macro
library, and Stan Peters of Brigham Young University who enhanced the
The features described in the following sections have been divided into
various groups for easy reference. This document, together with the
DEC TECO manual, should provide a complete guide to TECO 124A.
.hl 1 FILES
.hl 2 Directories
As in TECO 24, sub-file directories are now fully supported. All known problems regarding
ersatz devices, logged-in PPN vs.#default path, etc., are handled properly.
Unlike DEC TECO 24, however, the EB command will ALWAYS place the edited file into the default directory
path, unless it is followed by the /INPLACE switch (see Sec_. 2.9.2).
If the original file being edited resides anywhere
other than in the default directory, TECO will perform an ER-EW sequence
rather than an EB.
TECO's filespec scanner now accepts directories of the form "[-]" as the
default directory, "[,]" as the logged-in directory, "[n,]" or "[,n]" as
logged-in project or programmer, or "[n,n,sfd1,sfd2,...]" as a full directory
TECO 124A will issue a warning message whenever a file opened via
ER or EB is found by virtue of /LIB or /SCAN on a directory other
than the one specified.
.hl 2 EY Command
The "Y" (yank) command is no longer legal. It has been
replaced by "EY". This is to prevent inadvertent destruction of the
editing buffer by such mis-types as "0YY". This will not invalidate
any existing macros, as "Y" is still allowed at macro level, or if the
EO level is set to 2 or less.
.hl 2 EB Changes
Handling of file-manipulating commands while an "EB" job
is open has been modified; doing an "ER" with an "EB" job open will
do what it always has, namely open the specified file for input while continuing
output to the temporary file. "EW" will close and delete the temporary
output file, open the specified output file, and will leave the input file open.
.hl 2 Filespec defaulting
"ER#file$" now defaults unspecified fields
from the previous "ER" command. Note that this requires a null extension
to be indicated as a "." followed by no extension. This can be used to
re-open the last input file, as "ER$", or to set a default extension
of ".MAC", by doing a ":ER.MAC$" (see Sec_. 9.1), which would
cause unspecified extensions to default to ".MAC", until another
extension was specified.
"EW#file$" now defaults unspecified fields from
the previous "EW" filespec. It will then fill in any remaining
unspecified fields from the last "ER" spec. For example,
assuming a fresh copy of TECO, "EW#FOO" writes the file FOO
The extension is left null because there was no previous "ER" or "EW" to set
a default extension. If "ER#DTA2:BLAH" is then done, the file DTA2:BLAH is read
The extension still has no default at this point. Now, if
"EW#.BAR" is executed, the file written would be DTA2:FOO.BAR.
In this case, the previous "EW" was used to get the filename, and since
the device was not specified in this "EW" or the previous one, DTA2:
was taken from the "ER". This is particularly useful in re-opening
previously used files. Therefore, assuming no defaults exist yet, "ER#file$EW$" is an
easy way to read and supersede an existing file.
For convenience and to avoid confusion, neither a PPN nor an ersatz device
specified in a previous "ER" will be used in "EW" defaulting.
"ER#dev:file[p,pn]$EW$$" would read the specified file, and output
using the same name to the default directory (providing no previous
"EW" had been done to set EW defaults).
"EB#file$" will now default using the
previous "ER" filespec.
It is possible to cancel any default filespec in effect for an ER, EW
or EB by using the /DEFAULT switch. For example, "ER#FOO/DEFAULT$" will first
cancel all existing default values, and then set the default filename
.hl 2 EA Command
TECO can now append to files. The command is "EA#filespec$"
(for 'edit append'). This command behaves exactly like "EW" in
defaulting, except that if the file exists, it will be appended to,
rather than superseded. For consistency, "EW#filespec/APPEND$" is equivalent to
.hl 2 EK Command
Using the EK command (for 'edit kill'), it is now possible to cancel an EW or EA command. EK discards the
current output file and preserves any file about to be superseded.
This command was implemented because there was no way to recover from a "Superseding
existing file" message without doing a _^C.
If an EB is in progress, the EK command will close and delete
the temporary output file, and keep the input file open.
.hl 2 File Protections
Protections may now be specified for output files. Files created with
the EW, EA, EB, EL, and EE commands can be given a protection by using the usual "<nnn>" notation
in the filespec. If no protection is specified,
the protection used by each command is as follows:
EW Protection used by previous EW or EA.
EA Protection of the existing file.
EB Protection of the input file.
EL System default.
EE System default.
If no protection has been previously specified by an EW or EA, the
EW command will use the system default protection.
Regardless of the default protection, if the file involved has the
extension .SFD, then the protection will be set to <775> unless
If it is specified, the SFD protection will not
override the current default output protection.
.hl 2 EN Command
TECO now has the ability to rename files. The command
"EN#filespec$" (for 'edit name') will rename the
currently open input file to the specified spec. A null filespec (EN$)
will result in deletion.
A partial filespec can be specified, which makes it possible to change
selected attributes of the file without specifying all of them. For example,
"EN<055>$" will change the protection but leave the name and directory alone.
TECO will never change the directory of a file unless it is explicitly
mentioned in the EN filespec.
Note that the file to be renamed must have been
opened by a previous "ER" command, and that the input file is closed as
well as renamed by the "EN". EN is illegal while an EB is in progress.
It is also illegal to specify a device, since renaming across devices
does not work.
.hl 2 New Switches
All I/O switches can now be abbreviated.
The /READONLY switch now provides the TECO monitor command with a read-only
capability. "TECO#file/READONLY" will cause an ER-EY sequence to be performed
instead of the usual EB-EY sequence. For the sake of consistency, "EB#file/READONLY$" is equivalent to
The /INPLACE switch can be used with an EB or TECO command to indicate
that the edited file should overwrite the old file without producing a
.BAK file. Note that this is the only way to get the EB command to put
the edited file into a directory other than the default path.
Use of /INPLACE will suppress the "Superseding existing file" warning,
and can also be used with the EW command for this purpose.
TECO is now much faster in processing non-line-numbered
files. Although sequenced files still use the same, slow I/O
routines, non-sequenced files bypass the old code and are processed up to 50%
.par;To implement this, TECO now decides whether a file is sequenced
at the time it is opened (ER'd). It then sets up the appropriate I/O routines.
You may override TECO's decision with the switch "/NOLSN", which
declares the file to be unsequenced. In this case, TECO simply ignores
bit 35, and processes everything as ASCII. This is useful in files
with spurious bits on. Note that the new technique for determining the presence or absence
of sequence numbers is more reliable than the old. Be warned, however, that
non-standard files should not be TECO'ed unless you use "/NOLSN",
which applies only to the input file.
This switch can be used with any ER, EW, EA, EB, EI, or EP command
to clear any existing "sticky" file defaults before applying the
new filespec (if any). Note that ":ER/DEFAULT$" will clear all ER
defaults without resetting any. The _: prevents an error message.
.hl 2 _^P and _^Y Commands
There is now a way of getting to any specified page in a file
accurately. This is intended primarily for editing of MACRO-10 programs.
The command "n_^P", where n is an absolute page number within the
file, and is not less than the current page number, will read (and output)
pages until page 'n' (or as much of page 'n' as fits) is in the editing
buffer. A page is defined as any string of text terminated by
a form feed. Similarly, the command "n_^Y" will input until
page n is in the input buffer, without outputting any text.
.par;The control-P command is at least twice as fast as searching, and
is preferred for this reason. In addition, it uses an absolute page
number, rather than relative (as in the case of "P"), and is accurate.
The page number is reset to zero whenever a new file is "ER"'d or "EB"'d.
If a MACRO in MACRO-10 generates a form feed, MACRO
will increment the page number, whereas TECO will not.
Control-P and control-Y, with no argument, both return the value of
the page counter. This is the number of form feeds which have been
seen in the file; generally, this is the page number of the current
page (but not always, as in the case of very large pages!).
.hl 2 _^U Command
It is now possible to perform a USETI on an "ER"'d file. The command
n_^U will position the file so that input will begin at block n when the
next input command is executed. The value of n must be positive, and
an EB cannot be in effect.
This command should be used with care. In particular, note that
the value of the page counter (_^P) will not be adjusted.
.hl 2 :A Command
It is now possible to append text to the buffer on a line-by-line basis,
rather than a "page" at a time. The ":nA" command will append n lines
of text to the buffer (but will stop on a page boundary). ":A" is
equivalent to ":1A". Use of this command is highly recommended
whenever a large number of substitutions, deletions or insertions needs
to be performed throughout a large file. This is because anytime a character needs to be inserted or
removed from the buffer, all the characters following it must be
shifted one position. By appending only a few lines at a time, a
tremendous amount of useless character shifting can be avoided.
.hl 1 Q-REGISTER "*" AND ASSOCIATED COMMANDS
There is a new Q-register, "*", which is used by a few new
commands mentioned below. Although it can be used in all Q-register
manipulation commands, we recommend that it be used only in conjunction
with these new commands, since these commands will generally destroy
the contents of "*".
.hl 2 EP Command
It is possible to read a file directly into Q-register "*".
The command "EP#filespec$" (for 'edit put') will put the specified
file into Q-register *, from which it can be stored anywhere
desired. This makes the task of inserting one file into another
somewhat easier in the case of small insertion files. The filespec
defaults come from the last "EP" or "EI" command, with the
initial default being "TECO.TEC". If neither an explicit device nor directory is specified, the following
areas are searched in order for the file:
.le;[-] Default directory
.le;[,,TEC] (if it exists)
.le;[,] Logged-in directory
.le;TED: The Text-Editting Library [5,10].
It does not affect the
state of TECO in any way other than destroying the original contents
.hl 2 EI Command
Files (generally TECO macros) may now be executed directly
without explicitly reading it into a Q-register. The command
"EI#filespec$" (for 'edit indirect') causes the specified file to be
read into Q-register "*", and then executes it by doing a "M*".
The default filespec is shared with the EP command, and the
search sequence is identical to that described above.
.hl 1 INITIALIZATION AND TERMINATION
.hl 2 TECO.INI
TECO now looks for a TECO initialization file upon startup.
If DSK:TECO.INI[,] exists, it will be "EI"'d. That is, it will be read into
Q-register "*", executed, and will remain in "*" until the user destroys
it. The format of the init file is simply that of a macro, containing
any legal TECO commands. Note that the init file is executed before
the "EB" or "EW" generated by a "MAKE" or "TECO" command which
entered TECO, so the init file may freely do any I/O desired.
Typically, the init file might open a log file (see Sec_. 8.0), set an error message
level, set any flags desired (such as "ES" or "EU"), etc.
If a fatal (not colon-modified) error occurs during init file
processing, a message is printed and TECO stops execution, as usual.
In this case, the EB or EW which would normally be done on CCL
entry will not be done. It is recommended that init files be made
intelligent enough to process all errors themselves.
Init files may check for CCL mode entry into TECO (by a
"MAKE" or "TECO" monitor command) by a variation of the colon _^T
command. ":1,8_^T" (any first argument will do) will test the CCL
mode flag and return -1 if TECO was entered via CCL, or 0 if not.
A typical use might be to decide whether to RESCAN the monitor
command which invoked TECO.
Note that the CCL flag may only be tested by the init file.
The flag no longer exists once TECO is done with
the startup sequence, and the command will always return 0.
(We realize that ":1,8_^T" is not very mnemonic for what it does,
but it was decided that a separate command for this purpose would not
.hl 2 Monitor Command Extensions
.hl 3;MAKE Command
TECO 124A supports the extended form of the MAKE command,
which causes oldfile to be read, edited, and output as newfile.
The above command is equivalent to
*EWnewfile$ ERoldfile$ EY$$
Note that TECO monitor commands will ignore any "=oldfile" portion of
the command, so that
will edit file NEW in the usual manner.
.hl 3;Auxillary Command String
An auxillary TECO command string can now be specified in the
MAKE and TECO monitor commands. For example,
will cause TECO to set the terminal type to DPT (see Sec_. 7.8) and to
automatically run RUNOFF when it exits (see Sec_. 4.3). The real value of this
feature is that the specified commands will be remembered in the same
way that the filename is remembered on all subsequent MAKE and TECO
commands. It is a good way to set up parameters of a temporary nature
which would not be appropriate in TECO.INI.
Certain facts should be kept in mind:
(1) The "$" symbols above are dollar signs; TECO will substitute an
altmode (escape) for each one since altmodes won't be processed properly in a monitor command.
(2) When processing the
initial command, COMPIL will change all occurrences of "(...)" to
"/...", so parentheses should not appear. (3)
TECO will execute this extra command string AFTER the EW's, EB's
ER's, and/or EY's generated by the MAKE or TECO command.
This feature also makes it possible for other programs to run TECO,
pass it a command string, and even regain control when TECO exits.
This can be done by creating TMP:EDT and then running TECO with
an offset of 1 (CCL entry point). For historical reasons,
the rather strange format of the
EDT file is as follows:
<filespec> is a normal file specification,
$ is either an escape or a dollar sign,
and <commands> is a string of normal TECO commands.
If <delimiter> is a carriage return, TECO will perform an "EBfilespec$EY"
as in the TECO command. If <delimiter> is lexically greater than
a carriage return (traditionally either "}" or escape), then TECO will
perform an "EWfilespec$" as in the MAKE command.
Note that "SFOO$EK$<commands>$"
can be used to simply perform <commands>, since the "EK"
serves to cancel the "EWFOO$".
.hl 2 ED Command
TECO can run programs upon exiting. The command "ED" (for
'edit do') in the form "ED#filespec$" will store the filespec to be run when
TECO is exited by either "EX" or "_^Z". The default device is SYS:.
If an argument is specified, it is used as the run offset.
Giving a null spec ('ED$') will remove the pending program, so that
exiting will not run anything.
.hl 2 EE Command
TECO can be saved after being set up as desired. This is
used to save TECO macros as programs, such that they
can be run directly from monitor level. The command is "EE#filespec$" (for 'edit
execute'), with filespec defaulting to TECO.SAV[-].
It writes out the state of TECO, excluding any I/O in progress,
as a .SAV file, without affecting the current state of TECO in any way.
When the saved program is run, it will GETSEG SYS:TECO, leaving all
Q-registers, flags, the editing buffer, and the command string intact,
but with no input, output, or log files open. Execution will start
with the command following the "EE".
.lm 10;.par;.lt 10
*!Open up a TECO macro for input! ER MACRO.TEC$$
*!Yank it into the buffer and put into a Q-register! EY HXA$$
*!Clear the text buffer! HK$$
*!Write it into a file called MACRO.SAV, such that it will
automatically execute the macro when run! EE MACRO$MA$$
.....the macro executes now....
^C ;get out of TECO
.RUN MACRO ;Run the saved macro
....it executes, since execution began with the "MA" command
.lm 0;.par;Note that the file MACRO.SAV contains the state of TECO at the time
it was saved, and that execution began with the command following
the "EE" (namely "MA") when it was run.
The version of TECO which is GETSEG'd
must be the same as that under which the .SAV file was created.
Otherwise, the low segment addresses may not match. To avoid this situation,
if the GETSEG'd version of TECO is different from that of the .SAV
file, "?TECWVT Wrong version of TECO" is printed, and it exits. In
this case you must re-generate the .SAV file. For this reason, it is
recommended that macros be saved as .TEC files when .SAV files
.hl 2 _^C, REENTER
Control-C followed by REENTER will always do the right thing
now, even if I/O is in progress. TECO will complete the current command
(single command, not command string), before stopping, so there is no
danger of text duplication or loss.
.par;Commands which do many pages of I/O (such as EX, P, and N) will
stop at the next linefeed or formfeed, but not necessarily at a page boundary.
If TECO dies with errors such as illegal memory reference (which
are not supposed to happen), the error will re-occur when the REENTER
is done;#simply type REENTER again and everything should be intact.
When you control-C TECO and type REENTER, do not type control-C again
before it prints the asterisk. Stopping TECO during this time may
leave it in a confused state.
There is now a way to exit to monitor level without closing
files. The command "_^C" (entered as control-C or uparrow-C) will
cause an exit to the monitor. There are two differences of this from
"_^Z": it does not close files; and if you type "CONTINUE", it will
continue execution at the next command after the "_^C", rather than
printing a "*".
.hl 1 SEARCHING AND INSERTING
.hl 2 Negative Searches
Negative searches now exist. A search with a negative
argument searches from the current position to the beginning of the
buffer. As always, the pointer is left positioned to the
right of the string. For example, "-SFOOBAR$" searches from "." to
0 for an occurrence of "FOOBAR".
Negative "N", "__", and "FN" searches are treated as
"S", "S", and "FS", respectively.
.hl 2 Bounded Searches
Bounded searches now exist. "m,nS_<STRING_>$" tries to
find the string within the specified bounds (mth through n-1th
character). If m _> n, the search is done in reverse. This always
finds the first occurrence. This also works with FS. Note that
N and __ searches are treated as S searches, and FN is treated as FS, when bounded,
rather than reading subsequent buffers.
.hl 2 FD Command
The command "FD_<STRING_>$" (for 'find and delete') now
exists. This causes an "S" search for the string, and if found,
characters from the position of the pointer before the search through
the new position of the pointer are deleted. In the case of
a forward search, this means that characters from the pointer
through the end of the specified string would be deleted. Negative,
bounded, and 'nFD_<STRING_>$' are legal.
.hl 2 Search Failures
Search failures now preserve the value of ".". Any search
which does not read another buffer (i.e. S, FS, FD, and bounded
or negative searches) will leave the pointer unchanged if it fails.
.hl 2 Null Replacement FS Commands
It is possible to do an "FS" which deletes a string without
stopping command execution. The command "FS_<STRING_>$$" will
delete the string, and will stop execution, since there are two escapes.
By using any control character which does not generate text in the
second argument, it is possible to delete the string but continue
execution. Use "FS_<STRING_>$_^V$" for this purpose. (In theory,
this should work in DEC TECO, but does not, due to a bug).
.par;Example: "_<FNFOO$_^V$_;_>" would go through the entire file,
deleting every occurrence of the word "FOO".
.hl 2 _^G Text Command
A new text argument command exists. "_^Gi" where i is the name of
a Q-register, causes the text in Q-register i to be inserted into
the text argument at that point. For example, if Q-register 9 contains
"DEF", then SABC_^G9GHI$$ will search for "ABCDEFGHI". Similarly,
I123_^G9456$$ will insert "123DEF456" into the buffer.
.hl 2 Searches Within Iterations
DEC TECO's "feature" which
treats all searches within iterations as "colon searches" has
been removed. This means that unless they are colon-modified, searches within iterations no
longer return a numeric value denoting success or failure.
A failing search within an iteration
will, as usual, cause TECO to ignore the failure and continue
to execute the command string without issuing an error message.
This change will not affect the use of the semi-colon to
exit from an iteration after a failing search. (See Sec_. 12 for further discussion.)
.hl 1 Q-REGISTERS AND MACROS
.hl 2 Text Type-out from a Q-register
"Qi=" where Q-reg i contains text will type the text.
.hl 2 U Command
The U command has been modified to accept two arguments. "m,nUi"
will store the value of n in Q-register i and return the value of
m. Thus, "m,n#Ui#Uj" will store the value of n in Q-reg i and
the value of m in Q-reg j. This technique is useful for passing
two arguments to a macro (see Sec_. 6.4).
.hl 2 [ Command
The [ command will now accept numeric arguments. "n[i" is
equivalent to "[i#nUi", and "m,n[i" is equivalent to
"[i#m,nUi". This makes it possible to save the original contents
of a Q-register on the Q-register stack before a new value (usually
an argument to a macro) is stored.
.hl 2 Arguments
Arguments may be passed to and from macros called by "M",
"W" or "EI". If an argument is given to the macro-calling command, that
argument will apply to the first command in the macro. Thus,
"7MA" where Q-register "A" contains "U1....." would result in the
"7" becoming an argument to the "U", and 7 would be placed in Q-register
1. Similarly, if the macro ends with an argument (such
as "QA"), that will become an argument to the next command in the
command string which called the macro.
Changes to the U and [ commands (see Secs. 6.2 _& 6.3) make it
more convenient to pass two arguments to a macro without destroying
the original contents of any Q-registers.
.hl 2 W Command
There is now a way to "jump" to a Q-register, rather than
"call" it as "M" does. The command "Wi" (mnemonic
only in that "W" is an upside-down "M") will "jump to" the macro in
It performs the same function as "M" but does not store anything on
the PDL, and therefore cannot return. This is primarily useful if
you wish to go from one Q-register to another with no intention of
returning, since "W" cannot cause PDL overflows.
.hl 1 TERMINALS, TYPE-IN, AND TYPE-OUT
.hl 2 V Command
The V command can be used to view several lines surrounding
the current line of text.
"nV" is equivalent to "(1-n)T#nT". "V" is equivalent to "0TT".
.hl 2 Extended TTCALLS
"_^T" may now be used to do almost any TTCALL. The format of
the new command is ":_<ARG1_>,_<ARG2_>_^T" where arg1 and arg2 are
optional and default to zero, and the colon is required to distinguish
it from the old form of control-T. _<ARG1_>, if present, is the argument for the TTCALL, such as a character
to be output or a line number for GETLCH. _<ARG2_> is the decimal number
of the TTCALL desired. If only one argument is given, it is the
number of the TTCALL function to be executed.
.par;TTCALLS which skip will return a value of -1 or 0 depending on
whether they succeed or not. Those that skip and input a character will
return a value of 0 (no character there) or the value of the character.
The following are available:
0 _ INCHRW; 1 _ OUTCHR; 2 _ INCHRS; 4 _ INCHWL; 5 _ INCHSL;
6 _ GETLCH; 7 _ SETLCH; 9 _ CLRBFI; 10 _ CLRBFO; 11 _ SKPINC;
12 _ SKPINL; 13 _ IONEOU
.par;In addition, ":8_^T" (RESCAN) will do a "RESCAN 1", which
does a RESCAN and returns either 0 (there was no command present) or
-1 (there was a command to rescan). These can be used to read the
"R TECO ..." command, if desired, by an init file. If a first
argument is present (:1,8_^T) it reads the value of the CCL
mode flag, described in item 28.
.par;See the Monitor Calls Manual for more complete information on TTCALLS.
Note that _^T without the colon modifier acts as it always has,
namely as an INCHRW. Note also that the old _^T forced out any buffered typeout to the
terminal; this is not so for :_^T commands. "_^A_^A" will force
output if that is desired.
.hl 2 Echoing
The ability to turn terminal echoing on and off now exists.
This feature is intended for use primarily by TECO macros which
perform activities similar to the SOS alter command. Echo control
is accomplished via two additional arguments to the extended _^T command
(see Sec_. 7.1). To turn echoing off, use ":-1_^T". To turn it back on,
use ":-2_^T". Echoing will in all cases be turned back on automatically
when TECO returns to top-level command mode and types an "*". Note that
the use of the SETLCH TTCALL (:n,7_^T) will NOT turn off echoing properly,
since free CRLF's, simulated TAB's, etc., will still be sent by the monitor.
.hl 2 Image Type-Out
.par; Image type-out mode can be specified by using the "2ET" command.
This mode is similar to literal type-out mode (1ET), causing all
characters to be sent to the terminal literally with no up-arrow
substitution for control characters, etc. Image mode is slightly
more powerful, since monitor substitutions (e.g_.tab and form feed simulation)
are also supressed.
.hl 2 _^A changes
Text printed by the "_^A" command is now forced out on the
second control-A, rather than on the next line feed. This enables
proper output of lines without CRLF's.
.hl 2 = Changes
The = command has been modified to provide more control
over the output.
n,m= or n,m== will output the value of m in decimal or octal respectively
and then take action as follows:
.lm +3;n _< 0##Output a carriage return-line feed.
.br;n = 0##Output nothing.
.br;n _> 0##Output the character whose value is n.
.lm -3;The old format of the = command, namely n= works as before.
.hl 2 _^G<period>
_^G<period> now serves to retype the entire command, in the same
way that _^G<space> retypes the current line. Also, both of these commands now ignore the ET
setting, and always type control characters using the up-arrow form.
.hl 2 EV Command
The command "EV<terminal#type>$" (for edit video) now exists. It activates elegant
rubout processing for certain CRT terminals.Unless otherwise noted, both the backspace (_^H) character and the rubout
(DEL) character can be used for rubbing out.
The terminals currently supported and their mnemonics are shown below:
ACT4 Micro Term ACT-IV
ACT5 Micro Term ACT-V
ADD580 ADDS 580
ADM2 Lear Siegler ADM-2
ADM3 Lear Siegler ADM-3
ADM3A Lear Sigler ADM-3A
BEE Beehive Mini Bee 4
CDC Control Data Corp. 713
H1200 Hazeltine 1200
H1500 Hazeltine 1500
H2000 Hazeltine 2000
HP2640 Hewlett Packard 2640
VT05 Digital Equip. Corp. VT-05
VT50 Digital Equip. Corp. VT-50
VT52 Digital Equip. Corp. VT-52
CRT All other CRT's. (Use _^H)
TTY Normal (DEC TECO) rubout processing. (Use RUBOUT)
An altmode is required after the terminal type.
TECO is initialized with terminal type "CRT", which handles
RUBOUT in the old traditional manner, but accepts BACKSPACE (_^H) as an auxiliary delete
character and provides a minimum of cursor control hopefully common to
most CRT's. Naturally, much improved performance can be obtained by
using one of the "customized" settings.
Users who wish to see other types of terminals
supported should contact the systems programmer at their installation.
For information on how to setup characteristics for non-supported
or locally modified terminals, refer to the Appendix.
.hl 1 LOG FILES
A log-file capability has been added to TECO. The command
"EL#filespec/switch/switch$" (for 'edit log') is used for this purpose.
It will close any currently-open log file, and open a new one.
The default filespec is 'DSK:TECO.LOG'.
Switches specify what goes into the file:
.lm 14;.i -9;/APPEND Append to the file, if it already exists; default is to supersede.
.par;.i -9;/NOOUT Don't put any of TECO's typeout into the file.
Only the user's typein will go into the log, verbatim. Normally, TECO
will translate special characters to their printable equivalents before
placing them into the log, but in this case, all characters
are stored literally.
.par;.i -9;/NOIN Don't put any of the user's typein into the log.
This converts all special characters to printable text. It also
suppresses the "*" prompt.
.par;The log is closed when you exit via "EX" or "_^Z", or when
another "EL" is given. The default, if no switches are given, is to
place all typein and typeout into the log, with special characters
translated to printable equivalents.
.par;The second form of "EL" is used to change what goes into the
log without opening a new file (primarily for use by intelligent
TECO macros). This form is:
.s;The terminating escape is required. The argument specifies what
goes into the log, and there must be no filespec. In addition,
a log file must already be open or an "NLF" error is given.
The values of the argument are:
.i 5;0###nothing into the log
.i 5;1###only output into the log (like /NOIN)
.i 5;2###only typein into the log (like /NOOUT)
.i 5;3###typein and typeout into the log
.i 4;-1###close the log file without opening a new one.
.hl 1 ERROR PROCESSING
.hl 2 Colon Modifier
Error processing may (in some cases) be controlled by the
user. This is intended for intelligent macros which may prefer to do
something more clever than simply give an error message and stop.
Certain commands can be preceeded by a colon modifier,
which is usually used to control error processing.
(Sometimes the colon has nothing to do with
error processing; for an example, see Sec_. 2.12.)
These commands will return a value of -1 if
they succeed, or 0 if they fail (i.e., 0 if an error message would
have been issued). Generally speaking, it should be intuitively
obvious whether any given command may be colon-modified, but if you
are not sure, try it. (The ones which are not modifiable are those
which would be ambiguous if they had colons, or errors which are more
.par;A few specific cases which can be modified:
.par;File manipulating commands may be modified; for example,
":ER#filespec$" returns -1 if it worked, or 0 if it failed for any
.par;Pointer manipulation commands may be modified, such as ":C", which moves
the pointer one character, if possible, returning -1 if it succeeded,
or 0 if it would have gotten a ?TECPOP error.
.par;Q-register manipulation commands may be modified, such as ":GA" which puts the text from Q-register A into the buffer and returns
-1, unless there was no text in A, in which case it returns 0.
A colon modifier must ALWAYS precede any numeric arguments given with
.hl 2 Error Message Levels
The error message levels in TECO now conform to the new
standard. TECO will GETTAB the watch bits for the job upon startup,
to determine what type of message to give, and "EH" commands may be
used to change the GETTAB'ed value.
.hl 2 Stack Overflows
TECO now traps PDL overflows, rather than dying. TECO will
tell you which PDL overflowed (error "PDL" for the main PDL, or
"PDQ" for the Q-register PDL). Neither type of overflow should
damage the text, but main stack overflows can do strange
.hl 1 MISCELLANEOUS
.hl 2 EC Command
Generally speaking, TECO would never reduce its core size;
once it grew, it stayed grown. The command "EC" (for 'edit core')
causes TECO to garbage collect and shrink to as small a size as
possible (but it will never shrink below its initial size). If it
actually did shrink, an "[nK#core]" message will be printed,
indicating the new size. This command can be useful before an EE command, so that
the .SAV file will not be cluttered with garbage.
.hl 2 GETTAB, PEEK
GETTAB's are now available. The command n,m_^G
has the value of the specified GETTAB. The two arguments specify the
left and right halves respectively of the AC used for the GETTAB
UUO. The command n_^G (one argument) will perform a PEEK UUO, where
n specifies the contents of the AC.
_^G with no argument will return the job number.
.hl 2 _^F Command
The _^F command (return the value of the console switches)
has been modified to provide the user with still another useless
quantity. If an argument is specified with _^F the TTY number +
200000 octal of job n is returned. If job n is not on a TTY,
zero is returned.
.hl 2 _\_\ Command
The "_\_\" command provides in radix 8 what the "_\" command provides
in radix 10. Specifically, "n_\_\" will insert the ASCII representation
of the octal integer n into the text buffer. "_\_\" with no preceding
argument will return the octal value of the digit string immediately
following the pointer, and move the pointer to the right end of the string.
.hl 2 _nA Command
The "nA" command has been generalized so that it will now return
the ASCII value of the nth character to the right of the pointer.
"0A" will return the character to the left of the pointer, and
"-nA" will return the n+1st character to the left of the pointer.
If a second argument is present, (e.g. "m,nA") then the value
of m is returned whenever the nth position falls outside the
bounds of the buffer. If m is not present, a 0 is returned.
Thus, "10,1A" will return a 10 if and only if the pointer is at the
end of the buffer or before a line feed.
.hl 2 Line Feed, Backspace, and Semicolon Commands
When typed as the first command following the prompting "*", a line feed
causes a "1LT$$" to be performed. Similarly, a backspace (_^H) will
perform a "-1LT$$", and a semicolon (;) will perform a "0LT$$". These
three characters will not cause any special action if they appear elsewhere
within a command, where they will be treated as usual. When possible, TECO
will use the features of the terminal in use (see Sec_. 7.8 and Appendix)
to eliminate blank lines on the screen when several of these commands are given
.hl 1 IMPROVEMENTS TO EXISTING FEATURES
.hl 2 EX Command
The "EX" command has been speeded up by 30-50%. Characters are now transferred
directly from the input buffer to the output buffer, bypassing the editing
.hl 2 New Search Algorithm
TECO 124A uses the Boyer-Moore fast string search algorithm (see
Comm. of the ACM, Oct. '77) for most of its searches. One interesting
feature of this technique is that it is sub-linear; that is, the
longer the search string, the faster the search will proceed.
TECO's old algorithm is still used for backwards searches (see Sec_. 5.1),
as well as for any search which must match an arbitrary length
string of blanks or tabs (_^ES).
.hl 1 BUGS AND INCOMPATIBILITIES
At present, there are no known bugs in TECO 124A. Many problems originally
present in DEC TECO have been fixed, and most new features are completely compatible.
TECO 124A has an EO level of 3. By using a "2EO" command, many features
originally present in DEC TECO can be restored if needed.
There are a few incompatibilities with TECO 24 which should be
.le;Whenever a file specified by an EB command is not found in
the default directory, the EB is changed to an ER-EW sequence, and
the new file will always be written in the default directory. The
/INPLACE switch can be used to overwrite the original file, but
no .BAK file will be created in this case.
.le;The position of the pointer is preserved after a failing search.
The pointer will not be set to the beginning of the buffer unless
EO _< 3.
.le;The use of the "nA" command where n is not equal to 1 is no
longer equivalent to "1A" unless EO _< 3.
Also, an expression such as 65-1A is now evaluated from left to
right to produce 64A, which yields the ASCII value of the 64th
character to the right of the pointer. TECO 24 will treat
this expression as 65-(1A).
.le;"Y" is illegal at top level unless EO _< 3.
.le;Non-colon searches within iterations will not return a
numeric value unless EO _< 3. The problem of searches within iterations has been a
long standing, hotly debated issue. The DEC TECO manual
explicitly states that searches within iterations will
be treated as colon searches. TECO 23B, however, did not
return a -1 after a successful searches, although it did
return a 0 after failing searches. When TECO 123
was developed, it was decided to fix this "bug" and
conform to the documentation. Unfortunately, many TECO
macros were broken by this decision, since the -1 now
being returned by successful searches became an often
unwanted argument to the following command. For example,
"<Sabc$D>" would cause the "c" to be deleted since the
"D" comand has an argument of -1. Ironically, DEC has now
modified TECO 24 to conform to the manual as well, although
this edit has not yet appeared in the official distributed
version. Due to overwhelming popular demand, non-colon
searches within iterations will no longer return any value,
regardless of the outcome of the search.
Note that the use of a semi-colon to exit from a loop
will not be affected in any way. As always, a semi-colon
with no numeric argument will base its action on the
outcome of the last search, and therefore will behave the same
It is probably the case that TECO was always meant
to behave this way, and the entire problem was caused
by a documentation bug in the TECO 23B manual.
.hl 1 NEW ERROR MESSAGES
The error message codes in TECO are now preceded by "TEC" in order
to conform to the standard. Error processing has been speeded up
significantly by the use of an indexed error message file (see TECERR.MAC).
The following are new error messages. Refer to TECO.ERR for full
?TECABS Ambiguous I/O switch abbreviation
?TECABT Ambiguous terminal abbreviation
?TECBFL BAK file lookup error
?TECBFS Bad file specification
?TECCTL Command string too long
?TECDDR Double directory illegal
?TECDDV Double device illegal
?TECDEX Double extension illegal
?TECDFN Double filename illegal
?TECDIR Illegal character <char> in directory specification
?TECDPR Double protection illegal
?TECEND EN with a device is illegal
?TECENO EN requires an open input file
?TECICG Illegal _^G command in text argument
?TECICV Illegal character <char> in EV specification
?TECILD Illegal device <device>:
?TECIPA Illegal _^P or _^Y argument <argument>
?TECITT Illegal TTCALL type value
?TECNAL No altmode after nEL
?TECNAV No altmode after EV
?TECNLF No log file open
?TECNXD Nonexistent device <device>:
?TECPDL Pushdown list overflow
?TECPDQ Q-register pushdown list overflow during <[/]> command
?TECPRO Illegal protection given in filespec
?TECPTL Page number <number> is too large
?TECRNF <Why the rename failed for EN>
?TECTMS Too many SFD's specified
?TECUCS Unterminated command string
?TECUEY Use EY instead of Y
?TECUST USETI error
?TECUTT Undefined terminal type <terminal>
?TECUTV Unterminated EV command
?TECVOR EV argument out of range
Almost all of TECO's behavior which is CRT-dependent can be specified
by setting 16 different parameters. A command of the form "nEV$" (altmode
required) will return the current value of parameter n. A command of
the form "n,mEV$" will give parameter n the value m. These commands can
be useful for setting up the behavior of non-supported CRT's, as well as
to "fine tune" terminals with local modifications.
MOST USERS SHOULD NEVER HAVE TO CHANGE THE DEFAULT SETTINGS.
The 16 parameters
.le;Flags for CRT in use. This parameter MUST be given a non-zero value
if any special behavior at all is desired. A value of 0 implies standard
TTY behavior, regardless of any other settings. The currently defined flags (in octal) are:
1 - Terminal is a CRT. (Should be set for all but TTY.)
2 - Don't send lone CR to terminal.
4 - RUBOUT gets traditional treatment. (For general "CRT".)
10 - Terminal doesn't wrap around on backspace from left margin.
.le;ASCII value of desired supplementary rubout character. The specified
character will be treated the same way as RUBOUT. Usually set to
8, the value of _^H (backspace).
.le;Horizontal width of a vertical tab (_^K). Usually 0.
.le;Horizontal width of a form feed (_^L). Usually 0.
.le;Repetition factor for parameter 11.
.le;Repetition factor for parameter 12.
Each of the following parameters is a character string which must be
specified as a 12 digit octal number. This number consists of up to
5 7-bit ascii characters left justified in the rightmost 35 bits of a 36 bit word.
(The shifting 1 place to the right of an otherwise normal left justified
character string is needed because TECO doesn't especially like large
negative numbers (anything less than _^O400001000000 cannot be stored
in a Q-register). This hack insures that the number is positive.)
.le;Sequence of characters that will cause a backspace on the screen.
.le;Sequence of characters that will cause a forward cursor movement
on the screen. Usually a blank, but possibly a non-destructive forward
cursor. Needed to cancel the effects of a backspace, when rubbing out a line
feed, for example.
.le;Sequence of characters used to destructively backspace. Usually
a (blank, backspace) sequence, but 0 if non-destructive backspacing
is desired. Note that one backspace has already been typed when this is used.
.le;Sequence of characters to rubout a line feed. Usually an up-cursor.
.le;Sequence of characters to rubout a vertical tab (_^K). Terminal
dependent, unless .TTY NO FORM is in effect, in which case use up-cursor
and give parameter 5 a value of 4. If flag 40 in parameter 1 is set, TECO will always rubout a
vertical tab by assuming it is 4 line feeds.
.le;Sequence of characters to rubout a form feed (_^L). Same as
parameter 11, except give parameter 6 a value of 8. TECO will assume 8 line feeds need to be
rubbed out if parameter 1 has flag 40 set.
.le;Sequence of characters used to rubout a carriage return. This
is usually used to cancel any undesirable cursor movement resulting
from the retyping of the previous line. Usually 0, but possibly an
up-cursor if the terminal does not "wrap around" (some Datapoints, for
.le;Sequence of characters used to make RUBOUT behave like a backspace.
Usually a _^H, since RUBOUT itself echoes nothing. On a CDC however,
RUBOUT produces a blob which must be backed over, deleted, and backed
over again, after which we do the backspace we originally wanted!
This results in a (_^H,blank,_^H,_^H) sequence.
.le;Sequence of characters used to make the supplementary rubout character
(parameter 2) behave like a backspace (_^H). Usually 0, unless the
character being used for rubout does not space backward one position.
This sequence is typed before anything else happens, so that TECO is
assured that the cursor has indeed backed up.
.le;Sequence of characters used to make _^U erase the unwanted line.
Usually a (carriage return, erase-to-end-of-line) sequence. The normal
(TTY) action is a (carriage return, line feed) sequence.
A value of 0 for this parameter will cause a CRLF to be used. Therefore,
users who want the deleted line left visible for retyping purposes
should use a 16,0EV$ command.
Users who adjust any of the above parameters to deviate from
the standard terminal settings should be aware of certain problems that
can arise. The most annoying one stems from the fact that the DEC-10
monitor keeps track of the width of each character sent to the terminal
in order to know how many spaces to generate for a horizontal tab. The trouble
is that practically no CRT behaves the way the monitor thinks it behaves.
For example, an ADM2 terminal uses an escape-T sequence to erase a line.
This causes no spacing at all on the screen, but the monitor thinks that
a "T" is sitting there, and consequently will generate one less space
than necessary for a subsequent tab. Some Datapoints do not space at all
on a _^H, when the monitor thinks they have backspaced; even worse, they
backspace on an underscore, when the monitor thinks they've spaced forward!
TECO attempts to get around this problem as much as possible by typing
some of the character sequences using image mode, which causes the monitor
width counter to remain unchanged.
Since this solution isn't always desireable, we must resort
to other tricks.
For example, on
a Datapoint, the character which spaces backwards is an octal 31, rather
than a 10. By specifying a string of 31,10 in parameter 7, we please the
monitor's width counter by including the 10, which doesn't space on the
terminal, and we please the terminal by including the 31, which does
space backwards, but has a width of 0 according to the monitor!
Another problem comes from the fact that some terminals have a "no space overwrite" feature.
This means that if a carriage return is not followed by a line feed,
blanks will not overwrite the characters already on the screen.
This causes problems
when trying to destructively delete characters, and can be overcome somewhat
by the use of flag 2 in parameter 1. Many terminals, such as the
ADM3A for example, have an internal switch that can be used to
disable this feature: obviously the best solution.
Lone carriage returns are needed principally by the _^U line-erase sequence
and by the line feed, backspace and semicolon commands (see Sec_. 10.6).