Trailing-Edge
-
PDP-10 Archives
-
steco_19840320_1er_E35
-
10,5676/teco/doc/teco.doc
There are 4 other files named teco.doc in the archive. Click here to see a list.
TECO Command Summary
September 19, 1981
Table of Contents
1.0 Symbols and Definitions . . . . . . . . . . . . . . 2
2.0 Creating and Editing a file . . . . . . . . . . . . 3
3.0 Exiting from TECO . . . . . . . . . . . . . . . . . 4
4.0 Buffer Positions . . . . . . . . . . . . . . . . . . 4
5.0 Pointer positioning . . . . . . . . . . . . . . . . 4
6.0 Arithmetic Operators . . . . . . . . . . . . . . . . 5
7.0 File Selection . . . . . . . . . . . . . . . . . . . 5
8.0 Advanced File selection . . . . . . . . . . . . . . 6
9.0 File Selection Switches . . . . . . . . . . . . . . 7
10.0 Log Files . . . . . . . . . . . . . . . . . . . . . 8
11.0 Terminal Initialization and Video editing . . . . . 8
12.0 Input . . . . . . . . . . . . . . . . . . . . . . 10
13.0 Output . . . . . . . . . . . . . . . . . . . . . . 10
14.0 Insertion . . . . . . . . . . . . . . . . . . . . 11
15.0 Advanced Insertion . . . . . . . . . . . . . . . . 11
16.0 Deletion . . . . . . . . . . . . . . . . . . . . . 12
17.0 Immediate Type-out Commands . . . . . . . . . . . 12
18.0 Immediate Video commands . . . . . . . . . . . . . 13
19.0 Type-out . . . . . . . . . . . . . . . . . . . . . 13
20.0 Advanced Terminal I/O . . . . . . . . . . . . . . 14
21.0 Searching . . . . . . . . . . . . . . . . . . . . 15
22.0 Advanced Searching . . . . . . . . . . . . . . . . 15
23.0 Q-Registers . . . . . . . . . . . . . . . . . . . 17
24.0 Predefined Q-Registers . . . . . . . . . . . . . . 18
25.0 Iteration Commands . . . . . . . . . . . . . . . . 19
26.0 Flow Control . . . . . . . . . . . . . . . . . . . 19
27.0 Conditional Execution Commands . . . . . . . . . . 19
28.0 Special Numeric Values . . . . . . . . . . . . . . 20
29.0 Aids . . . . . . . . . . . . . . . . . . . . . . . 21
30.0 Hints . . . . . . . . . . . . . . . . . . . . . . 24
30.1 Setting up video editing . . . . . . . . . . . . 28
TECO Command Summary Page 2
Table of Contents 19 Sep 81
TECO Command Summary
For complete descriptions and examples of TECO's
commands, refer to the TECO manual and
DOC:TEC200.DOC.
* * * * * * *
1.0 Symbols and Definitions
^ Designates the following letter or character as a
control character. In general, TECO will allow you to
type a control character in the "<up-arrow><character>"
form, unless it is part of a text string within a search
or insert command.
$ Altmode or escape key (^[).
<CR> Carriage return key (^M).
<LF> Line feed key (^J).
<TAB> Tab key (^I).
<FF> Form feed key (^L).
m or n Represents any integer number. Many TECO commands
accept a numeric argument, which, if missing, generally
defaults to 1.
i Represents a Q-register name. A Q-register name is
either a character string enclosed in parenthises or one
of A-Z, 0-9, *, %, . ?, (character-string).
Buffer A block of memory within TECO into which text is read or
inserted, edited, and output.
Page The amount of text read into the buffer by an input
command or output by an output command. Editing is
performed in the buffer on a page by page basis.
Buffer Pointer
Represents the current position within a buffer where
editing is taking place; always positioned between two
characters. There is one buffer pointer for each
buffer.
TECO Command Summary Page 3
Symbols and Definitions 19 Sep 81
Q-registers Data storage locations available as text buffers,
numeric storage, or TECO command buffers.
Filespec
node::dev:filnam.ext[proj,prog,sfd1,sfd2,..]/switch1/switch2..
Node names are parsed and checked for validity, but are not supported
at this point in time. The central site node name is
the only name allowed.
2.0 Creating and Editing a file
The following monitor commands automatically run the
TECO editor and perform standard file initialization.
MAKE filespec<CR>
Create a new file with TECO. Performs an automatic
EWfilespec$.
TECO filespec<CR>
Edit an existing file with TECO. Performs an automatic
EBfilespec$EY$ sequence.
TECO<CR> Enter TECO using the file named in the previous edit.
MAKE filespec1=filespec2<CR>
TECO will create "filespec1" from "filespec2".
(Performs an automatic EWfilespec1$ ERfilespec2$ EY$
sequence.) A "TECO" command will always ignore the
second filespec if given, causing filespec1 to be
editted normally. This allows "TECO <CR>" commands
following a MAKE command to continue to edit the newly
created file rather than read from the original one
again.
TECO filespec$command$...$command<CR>
Execute the specified commands following the filespec
automatically after entering TECO (works with MAKE too).
The command string will be remembered as part of the
filespec on subsequent "TECO<CR>" commands. Note that
the "$" characters shown are dollar-signs, not escapes.
Since real escapes on the command line would cause the
command to terminate prematurely, we make use of a
"pseudo-escape" character, the dollar sign. TECO will
substitute real escapes as it executes the command(s).
TECO Command Summary Page 4
Creating and Editing a file 19 Sep 81
R TECO<CR> Run the TECO editor without selecting any files for
editing. File selection must be made with the TECO
commands described under "File Selection".
3.0 Exiting from TECO
EX Output the remainder of the input files, close the
output files, and then exit to the monitor. If an ED
command is in effect, run the specified program.
EG Output the remainder of the input files, close the
output files and then re-execute the last compile class
command that was typed.
^C Exit immediately to the monitor. May also be used to
abort an editing session (leaves original file intact).
Typing CONTINUE (perhaps after performing some monitor
commands) will allow you to resume your editing session
where you left off. Typing REENTER will cause TECO to
abort any command string it may have been executing and
ask for the next command. (This is good for stopping
infinite search loops, etc.) ^C can be entered in the
command string by typing it as up-arrow C.
^Z Close the output file and exit to the monitor. (Simple
close; no files are renamed).
4.0 Buffer Positions
B Beginning of the buffer; 0.
. Current pointer position; number of characters to the
left of the pointer.
Z End of the buffer; number of characters in the buffer.
m,n m+1st through nth characters in the buffer. Used with
the K, P, S, T, and X commands.
H Entire buffer; B,Z.
TECO Command Summary Page 5
Pointer positioning 19 Sep 81
5.0 Pointer positioning
nJ Move pointer to position between nth and n+1st
characters. If n is ommitted, the value will default to
zero.
nEJ(Q-reg) Move the pointer to the position between the nth and
n+1st characters in the specified Q-register. If n is
ommitted, the value will default to zero.
nC Advance pointer n positions.
nR Move pointer back n positions. Equivalent to -nC.
nL Move pointer to beginning of nth line after current
pointer position.
0L Move pointer to beginning of current line.
n^D Move the pointer on the screen up or down n lines. This
command is valid only if "VIDEO" mode is enabled by an
EVON$ command.
6.0 Arithmetic Operators
m+n Add m and n.
m n Add m and n.
m-n Subtract n from m.
m*n Multiply m by n.
m/n Divide m by n and truncate the result.
m&n Bitwise logical AND.
m#n Bitwise inclusive OR.
() Perform enclosed operations first.
^On Accept following number in octal radix. Must be typed
as up-arrow O.
TECO Command Summary Page 6
File Selection 19 Sep 81
7.0 File Selection
The following commands may be used to control file
selection.
ERfilespec$ Select file for input.
EWfilespec$ Select file for output.
EBfilespec$ Select file for input and output, and save the original
file as the same name, but the extension BAK.
EAfilespec$ Select file for output--append rather than supersede.
8.0 Advanced File selection
EP(Q-reg)filespec$
Read a file and put it into the specified Q-register.
If no Q-register is specified, then it will default to
*.
EI(Q-reg)filespec$
Read a file, put it into the specified Q-register, and
execute it as a TECO macro. If no Q-register is
specified, then it will default to *.
EQ(Q-reg)filespec$
Write the text from the Q-register into a file.
ENfilespec$ Rename the current input file to filespec.
EN$ Delete the current input file.
EEfilespec$ Save the current state of TECO in filespec.
DSK:TECO.SAV is the default.
nEDfilespec$ Run filespec upon exit. (SYS: is the default device.
The optional argument n is the starting address offset).
Optional switches are /RUNCOR:n and /RUNOFFSET:m.
ED$ Cancel pending ED (do not run anything on exit from
TECO).
EK Cancel existing EW or EA.
nEM Position magnetic tape.
TECO Command Summary Page 7
Advanced File selection 19 Sep 81
EZfilespec$ Zero directory (DECtape) and select file for output.
E.(Q-reg) Used to select Q-register for editing. The initial
editing buffer is associated with Q-register '(.)'
(period).
9.0 File Selection Switches
These switches may also be used with the MAKE and TECO
monitor commands.
/READONLY Used with TECO command to cause ER instead of EB.
/INPLACE Used with EB to cause file to be overwritten with no
.BAK file.
/APPEND Used with MAKE command to cause EA instead of EW.
/DEFAULT Used with ER, EW, EA, EB, EI, EQ and EP to cancel any
filespec defaults previously in effect.
/NODEFAULT Performs the ER, EW, EA, EB, EI, EQ or EP without
modifiying and current defaults.
/GENLSN Used with EW or EB to cause line sequence numbers to be
generated. This is equivalent to /MODE:LSA or
/OMODE:LSA.
/SUPLSN Used with ER, EB, or EW to suppress line sequence
numbers. This is equivalent to /MODE:LSA or /IMODE:LSA.
/IMODE:mode This switch is used to EB to specify the input mode.
The modes are the same that are valid on the /MODE:
switch.
/OMODE:mode This switch is used to EB to specify the output mode.
The modes are the same that are valid on the /MODE:
switch.
/MODE:ASCII Used with ER, EW, EA, EB, EI, EQ and EP to cause the
file mode to be buffered ASCII.
/MODE:DUMP Used with ER, EW, EA, EB, EI, EQ and EP to cause dump
mode I/O to be used to read or write the file. This
causes the entire file to be read into core.
/MODE:LSA Used with the ER, EW, EA, EB, EI, EQ and EP commands to
cause the file to have line sequence numbers generated
on output and removed on input. This is the same as
TECO Command Summary Page 8
File Selection Switches 19 Sep 81
/SUPLSN and /GENLSN.
/MODE:SIXBIT Used with the ER, EW, EA, EB, EI, EQ and EP commands to
specify that the file is a COBOL SIXBIT file.
/PROTECTION:nnn Used with EW, EA, EB, EZ and EQ commands to
specify the file protection assigned.
/VERSION:ver Used to set the output version number of the file.
10.0 Log Files
ELfilespec$ Open a log file. Default is DSK:TECO.LOG.
nEL$ Further control of log file: 0=nothing in log, 1=/NOIN,
2=/NOOUT, 3=everything in log, 4=Dump video update
information in log, -1=close the log file.
/NOIN Used with EL to keep terminal input out of the log file.
/NOOUT Used with EL to keep terminal output out of the log
file.
/APPEND Used with EL to append to rather than supersede the log
file.
11.0 Terminal Initialization and Video editing
EVterminal$ Specifies the terminal type. The terminals that are
supported are:
Name Terminal
ACT4 ACT-IV.
ACT5 ACT-V.
ADD580 ADDS Consule 580.
ADM2 LSI ADM-2.
ADM3 LSI ADM-3.
ADM3A LSI ADM-3A. (Video editing supported).
CDC CDC(?) terminal.
CRT General CRT. Causes deletes to erase the
character.
DM1520 Datamedia 1520 and 1520A. (Video editing
supported).
TECO Command Summary Page 9
Terminal Initialization and Video editing 19 Sep 81
DPT Datapoint.
H19 Heathkit H19 in VT52 mode. (Video editing
supported).
H19A Heathkit H19 in ANSI mode. (Video editing
supported).
H1200 Hazeltine 1200.
H1500 Hazeltine 1500.
H1420 Hazeltine 1420. (Video editing supported).
H2000 Hazeltine 2000.
HMOD1 Hazeltine Mod-1.
HMOD1I Hazeltine Mod-1 with insert/delete line.
HP2621 HP 2621 terminal. (Video editing
supported).
HP2640 HP 2640.
HP2648 HP 2648 terminal. (Video editing
supported).
RGNT25 ADDS Regent 25. (Video editing supported).
TELRAY Teleray. (Video editing supported).
TELVID Televideo. (Video editing supported).
TK4025 Tektronics 4025. (Video editing supported).
TTY Hardcopy terminal.
VT05 DEC VT-05. (Video editing supported).
VT100 DEC VT-100. (Video editing supported).
VT132 DEC VT-100 in 132 wide mode. (Video editing
supported).
VT52 DEC VT-52. (Video editing supported).
VT61 DEC VT-61. (Video editing supported).
EVparameter$ Sets a parameter or returns a value depending on the
parameter.
Paramter Description.
NODE This command will return as a value the node
number that the user's teminal is connected
to.
LINE This command will return a value that is the
line number that the user's teminal is
connected to.
TRMOP This command will cause a TRMOP. UUO to be
executed. This command will return a value
if the TRMOP. is executing a read function
and no value will be returned if it is
executing a set functions. All functions
are to the terminal that TECO is currently
connected to. The first argument is the
value to set and the second argument is the
function number. Only those function codes
over 1000 (octal) are valid.
TECO Command Summary Page 10
Terminal Initialization and Video editing 19 Sep 81
WINDOW This command will return the screen size
that TECO is using. The value is number of
lines * 1000000 (octal) + width.
ON Causes the Q-registers that have been set up
by the E$ command to be displayed on the
screen on there respective lines. This
command will turn on "VIDEO" editing for
TECO.
OFF Causes TECO to not display any Q-registers.
TECO will act in a manner similar to DEC
TECO. This command will turn off "VIDEO"
editing.
UPDATE Causes the screen to be updated immediately.
This is only valid if an EVON$ command has
been issued.
REFRESH Causes the screen to be refreshed. This
command is only valid if an EVON$ command
has been issued.
n,mE$(Q-reg)$
Causes the specified Q-register to be displayed on the
nth through mth lines on the screen. The lines number
start at one. The text will not be displayed until the
EVON$ command has been issued.
12.0 Input
EY Clear buffer and input one page. (Y may be used at
macro level).
A Input one page and append to current buffer contents.
:nA Input n lines of text and append to current buffer
contents. (Won't read past a form feed.)
n^Y Input until page n is in the buffer.
n^U Perform a USETI. Positions input file to block n for
next input command. (ER'd files only; illegal with
EB). Must be typed as up-arrow U.
TECO Command Summary Page 11
Output 19 Sep 81
13.0 Output
nPW Output n copies of the current page and append a form
feed character to each. Does not change the buffer.
nP Output the current page, clear the buffer, 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. Do not
append a form feed character, and do not change the
buffer.
n^P Same as nP, but end up at the nth absolute page of the
file, rather than the nth page past the current page.
EF Close the output file.
14.0 Insertion
Itext$ Insert the text delimited by I and altmode.
<Tab>text$ Insert a tab followed by all the text up to the altmode.
15.0 Advanced Insertion
@I/text/ Insert the text delimited by the arbitrary character
following I.
nI$ Insert the character with ASCII value n (decimal).
n\ Insert the ASCII representation of the decimal integer
n.
n\\ Insert the ASCII representation of the octal integer n.
^V In an insert string, translate next character (if
alphabetic) to lower case.
^V^V In an insert string, translate remaining alphabetic
characters to lower case.
^W In an insert string, translate next character (if
alphabetic) to upper case.
TECO Command Summary Page 12
Advanced Insertion 19 Sep 81
^W^W In an insert string, translate remaining alphabetic
characters to upper case.
^^ In a insert string, translate next character (if @, [,
\, ], ^, or _) to "lower case" range.
^R In an insert string, accept next character as text.
^Gi Used inside an insert string to cause the contents of
Q-register i to be inserted into the string at that
point.
^T Used inside insert strings to cause all control
characters except ^R, ^T, and altmode to be taken as
text. Nullified by a second ^T. (Note: does not work
unless the monitor command "TTY RTCOMPATIBILITY" has
been given).
16.0 Deletion
nD Delete the n characters following the pointer position.
-nD Delete the n characters preceding the pointer position.
nK Delete all characters in the buffer from the current
pointer position to the beginning of the nth line from
the pointer position.
m,nK Delete the m+1st through the nth characters.
17.0 Immediate Type-out Commands
The following commands execute immediately when typed as
the first character following the prompting "*".
^J <LF> When typed immediately after the prompt, moves the
pointer to the beginning of the next line and types the
line. (Same as 1LT).
^H When typed immediately after the prompt, moves the
pointer to the beginning of the preceding line and types
the line. (Same as -1LT).
TECO Command Summary Page 13
Immediate Type-out Commands 19 Sep 81
; When typed immediately after the prompt, moves the
pointer to the beginning of the current line and types
the line. (Same as 0LT).
18.0 Immediate Video commands
TECO contains a different set of immediate commands if
in "VIDEO" mode (EVON$). These commands are only valid
as the first character of a command line.
^B This command will cause the positioning command "+1R" to
be executed.
<SPACE> This command will cause the positioning command "+1C" to
be executed.
^U This command will cause the cursor to move up to the
line above the current line. The command that is
executed is: "-1^D".
^D This command will cause the cursor to move down to the
line below the current line. The command that is
executed is: "+1^D".
^J <LF> This command will cause the positioning command "+1L" to
be executed.
; This command will cause the pointer to be positioned at
the beginning of the line. The command that is executed
is: "0L".
^H This command will cause the positioning command "-1L" to
be executed.
^W This command will cause the pointer to be advanced one
word. This command is the same as the "+1FW" command.
19.0 Type-out
nT Type all text in the buffer from the current pointer
position to the beginning of the nth line from the
pointer position.
m,nT Type the m+1st through the nth characters.
TECO Command Summary Page 14
Type-out 19 Sep 81
nV Type all text within n lines from the current line.
Equivalent to (1-n)T nT.
Qi= Type the contents of Q-register i. (Numeric or text).
n= Type the decimal integer n.
n== Type the octal integer n.
20.0 Advanced Terminal I/O
m,n= If m<0, same as n=; if m=0, don't output a CRLF after
the number; if m>0, output the ASCII character whose
value is m after the number.
1ET Set to literal typeout mode.
2ET Set to image typeout mode.
0ET Restore typeout mode to normal. (Type control
characters in up-arrow form, altmodes as dollar signs,
etc.).
0EU Flag lower case characters on typeout by preceding them
with a ' (standard unless "TTY LC" is in effect).
1EU Flag upper case characters on typeout.
-1EU No case flagging on typeout.
-1ES Set automatic typeout after searches.
nES (n>0) Set automatic typeout and use the character with ASCII
value n (decimal) to show the position of the pointer.
0ES Set to no automatic typeout after searches.
^Amessage^A Type the message enclosed.
^L <FF> Type a form feed.
^T Stop command execution, wait for the user to type a
character, and then take on the ASCII value (in decimal)
of the character typed.
:m,n^T Extended ^T operations: TTCALLS and echo control.
:0^T INCHRW :1,8^T CCL flag
:n,1^T OUTCHR n :9^T CLRBFI
:2^T INCHRS :10^T CLRBFO
:4^T INCHWL :11^T SKPINC
TECO Command Summary Page 15
Advanced Terminal I/O 19 Sep 81
:5^T INCHSL :12^T SKPINL
:6^T GETLCH :n,13^T IONEOU n
:n,7^T SETLCH n :-1^T ECHO OFF
:8^T RESCAN 1 :-2^T ECHO ON
21.0 Searching
(Note: the buffer pointer is left unchanged when a
search fails unless the search caused a new page to be
read into the buffer).
nStext$ Search for the nth occurrence (following the pointer) of
the text delimited by S and altmode, but do not go
beyond the end of the current page. If n<0, search
backwards.
m,nStext$ Same as S, but search only between pointer positions m
and n. If m>n, search backwards.
nFSoldtext$newtext$
Search for the nth occurrence (following the 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 the text is not
found on the current page, pages are input and output
until it is found.
nFNoldtext$newtext$
Equivalent to FS except that if the text is not found on
the current page, pages are input and output until it is
found.
nFKtext$ Search for the nth occurrence of the text and delete the
text. This is the same as FStext$$.
nFDtext$ Search for nth occurrence of text and delete everything
from the current pointer position to the end of text.
nFW Search for the nth word after the pointer. If n is zero
then the pointer is moved to the beginning of the
current word.
TECO Command Summary Page 16
Advanced Searching 19 Sep 81
22.0 Advanced Searching
n_text$ Equivalent to nNtext$ except that it does input only, no
output.
:nStext$ Equivalent to nStext$ except that it returns a value of
-1 if the search succeeds or 0 if it fails instead of an
error message. The : command can also be used with FS,
N, FN, FD, and _.
@nS/text/ Equivalent to nStext$ except that the text is delimited
by the arbitrary character following the S. The @
command may also be used with FS, N, FN, FD, and _.
0^X Reset search mode to accept either case.
n^X (n#0) Set search mode to "exact" mode.
^V In a search string, translate next character (if
alphabetic) to lower case.
^V^V In a search string, translate remaining alphabetic
characters to lower case.
^W In a search string, translate next character (if
alphabetic) to upper case.
^W^W In a search string, translate remaining alphabetic
characters to upper case.
^^ In a search string, translate next character (if @, [,
\, ], ^, or _) to "lower case" range.
^R In a search string, accept next character as text.
^T Used inside text arguments to cause all control
characters except ^R, ^T, and altmode to be taken as
text. Nullified by a second ^T. (Requires "TTY
RTCOMPATIBILITY" monitor command).
^\ Used inside search arguments to indicate accept either
case for following characters. Nullified by a second
^\.
^X When used inside a text argument, accept any character
at this position in the search string.
^S Accept any separator character at this position. A
separator is any character except a letter, digit,
period, dollar sign, or percent sign. (Note: does not
work unless the monitor command "TTY NO PAGE" has been
given).
TECO Command Summary Page 17
Advanced Searching 19 Sep 81
^Na Accept any character except the arbitrary character a
following ^N.
^Q Take the next character in the search string literally,
even if it is a control character. (Note: does not
work unless the monitor command "TTY NO PAGE" has been
given).
^Gi Substitute the contents of Q-reg i into the text string
at this point.
^EA Accept any alphabetic character as a match.
^EV Accept any lower case alphabetic character as a match.
^EW Accept any upper case alphabetic character as a match.
^ED Accept any digit as a match.
^EL Accept any end-of-line character as a match.
^ES Accept any string of spaces and/or tabs as a match.
^E<nnn> Accept the ASCII character whose octal value is nnn as a
match.
^E[a,b,c...] Accept any one of the characters in the brackets as a
match.
23.0 Q-Registers
nUi Store the integer n in Q-register i.
m,nUi Store the integer n in Q-register i and return the value
of m. (For example, the command m,nUiUj is equivalent
to nUi mUj).
Qi Return the value stored in Q-register i (for use as a
numeric argument to another command).
n%i Increment the value in Q-register i by the value of n.
If n is omitted then the default of one is used.
nXi Store, in Q-register i, all characters from the current
pointer position to the beginning of the nth line from
the pointer.
m,nXi Store the m+1st through nth characters in Q-register i.
TECO Command Summary Page 18
Q-Registers 19 Sep 81
Gi Insert a copy of the text in Q-register i at the current
pointer position.
m,nMi Execute the text in Q-register i as a command string.
The arguments m,n are optional, and are passed to the
first command of the string.
m,nWi Execute the text in Q-register i as a command string by
a "jump" rather than a "call".
[i Push the current contents of Q-register i onto the
Q-register pushdown list.
n[i Equivalent to [i nUi.
m,n[i Equivlent to [i m,nUi.
]i Pop the last stored entry from the Q-register pushdown
list into Q-register i.
*i If typed immediately after the prompt, save the
preceding command string in Q-register i.
EP(q-name)filespec$
Read a file and put it into a Q-register. The (q-name)
is optional and will default to *.
EI(q-name)filespec$
Read a file, put it into a Q-reg, and execute it as an
TECO macro. The q-name will default as above.
EQ(q-name)filespec$
Write the text from Q-register q-name into the file. If
(q-name) is absent q-register * is used.
24.0 Predefined Q-Registers
The following are predefined Q-Registers that serve some
special purpose.
AUTO-BUFFER This Q-Register is executed after ever N commands, where
N is the number that is contained in the AUTO-COUNT
Q-Register.
AUTO-COUNT This Q-Register contains a value. If this Q-register
contains a positive value, n, then the Q-Register
AUTO-BUFFER will be executed after n command lines are
executed. (One command line is until the two altmodes).
TECO Command Summary Page 19
Predefined Q-Registers 19 Sep 81
COMMAND-BUFFER This is the Q-Register that all TECO commands
are stored in as they are typed in. If this Q-Register
is displayed on the screen by an n,mE$(COMMAND-BUFFER),
then the commands typed will echo on those lines.
ERROR-TEXT This Q-register contains the text of the last error
message.
TEXT-BUFFER This is the Q-Register that contains the text that is
currently being edited.
25.0 Iteration Commands
n<commands> Perform the enclosed command string n times.
; Jump out of the current iteration field, if the last
search executed failed.
n; If n>=0, jump out of the current iteration field.
26.0 Flow Control
!tag! Define a label in the command string with the name
"tag".
Otag$ Jump to the label defined by !tag!. WARNING: Don't use
O to jump into or out of iteration brackets <..>.
27.0 Conditional Execution Commands
These commands are of the form
n"x.......'
If the numeric value of n satisfies condition x, all the
commands between "x and ' are executed; execution falls
through the apostrophe unless the command string
contains a jump. If n does not satisfy x, execution
resumes with the command following the '.
TECO Command Summary Page 20
Conditional Execution Commands 19 Sep 81
n"Ecommands' If n=0, execute the commands specified between "E and ';
otherwise, skip to the '.
n"Ncommands' If n#0, execute the enclosed commands.
n"Lcommands' If n<0, execute the enclosed commands.
n"Gcommands' If n>0, execute the enclosed commands.
n"Ccommands' If n is the ASCII value (decimal) of a symbol
constituent character (a letter, digit, period, percent
sign, or dollar sign), execute the enclosed commands.
n"Dcommands' If n is a digit execute the enclosed commands.
n"Acommands' If n is alphabetic, execute the enclosed commands.
n"Vcommands' If n is lower case alphabetic, execute the enclosed
commands.
n"Wcommands' If n is upper case alphabetic, execute the enclosed
commands.
n"Tcommands' If n is true, execute the enclosed commands.
n"Fcommands' If n is false, execute the enclosed commands.
n"Scommands' If n is "successful", execute the enclosed commands.
n"Ucommands' If n is "unsuccessful", execute the enclosed commands.
28.0 Special Numeric Values
nA The ASCII value (decimal) of the character n positions
to the right of the pointer. 0A gives the character to
the left of the pointer, -nA gives the character n+1
positions to the left of the pointer. If the position
lies outside the buffer boundaries, return 0.
m,nA Same as nA, but returns m if the position is outside the
buffer boundaries.
^E The form feed flag. Equals 0 if no form feed character
was read on the last input, -1 otherwise.
^N The end-of-file flag; equals -1 if end of input file
seen on last input. Otherwise equals 0.
TECO Command Summary Page 21
Special Numeric Values 19 Sep 81
^F Decimal value of the console data switches.
-1^F TTY number (+ 200000 octal) of this job.
n^F TTY number (+ 200000 octal) of job n.
^H The time of day in 60th's of a second. Must be typed as
up-arrow H.
ET The value of the type-out mode switch. (0=normal,
1=literal, 2=image).
ES The value of the autotype after successful searches
switch. -1 = auto typeout, 0 = no typeout, n>0 =
autotype using ASCII character n to show position of
pointer.
^X Value of the search mode flag. (0=either case mode,
-1=exact mode).
EU The value of the EU flag. +1 = flag upper case
characters. 0 = flag lower case characters. -1 = no
case flagging on typeout.
EO The value of the EO flag. 1 = version 21A; 2 =
versions 22, 24; 3 = TECO 123 and 124; 4 = TECO 200
without string arguments; 5 = TECO 200 with string
arguments and FC command processing.
EH The value of the EH flag. 1 = code only, 2 = code plus
one line, 3 = all of error message.
^^x The ASCII value (decimal) of the arbitrary character x
following ^^.
\ The decimal value of the digit string following the
pointer. Leaves pointer at right end of the digit
string.
\\ The octal value of the digit string following the
pointer. Leaves pointer at right end of the digit
string.
^G Returns job number.
n^G Monitor PEEK UUO, using n as an argument.
m,n^G Monitor GETTAB call, using m,n as arguments.
TECO Command Summary Page 22
Aids 19 Sep 81
29.0 Aids
: Enables error control. Many commands (especially search
and file commands), if preceded by a :, will not cause
an error message if they fail. The : modifier will
cause the command to return a value of 0 if it fails, -1
if it is successful. Exception: :nA command uses : to
distinguish it from nA.
EC Perform a garbage collection and reduce the amount of
core as much as possible. If preceded by a negative
argument, EC will do a garbage collection and not print
the [nP core] (or [nK core]) message. If EC is preceded
by a positive argument it will expand the low segment to
n pages where n is the arg.
/ When used after an error message, this causes a more
detailed explanation of the error to be typed.
*i When used at the beginning of a command string, this
causes the entire previous command string (minus one of
the two concluding altmodes) to be moved into Q-register
i.
? 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.
<DEL> Rubout last character typed in the command string.
^H If a CRT has been specified, erases and backs over
previously typed character. (Must be typed as a control
character.)
^G^G Erase the entire command string.
^G <space> Retype current line of command string.
^G. Retype entire command.
^U Erase everything typed in back to the last CRLF. (Must
be typed as a control character.)
0EO Restore the EO value to standard (5).
nEO (n not 0) Set the EO value to n.
1EH Type only code part of error messages.
TECO Command Summary Page 23
Aids 19 Sep 81
2EH Type error code plus one line.
3EH Type all three parts of error.
0EH Equivalent to 2EH.
^V Set prevailing mode for insertions and searches to lower
case.
^W Set prevailing mode for insertions and searches to upper
case.
TECO Command Summary Page 24
Hints 19 Sep 81
30.0 Hints
TECO's buffer pointer is always positioned between two characters
in the editing buffer. It is never positioned exactly on a particular
character. This concept is fundamental to TECO and must be clearly
understood. Make frequent use of the semicolon type-out command until
you are familiar with the positioning and movement of the buffer
pointer.
Disk area TED: contains many useful TECO macros that may be
executed with the EI command. Of particular interest is TED:HELP.TEC.
This macro makes an interactive help facility available at any time
during an editing session simply by typing "EIHELP$$". Try it!
The use of an TECO initialization file can be very powerful.
TECO commands placed in a file named TECO.INI on your disk area will
be executed automatically each time you enter TECO. It can be used to
specify the type of terminal you use, to load your favorite TECO
macros into appropriate q-registers, to set up default values for
filenames, type messages, etc. Here are the contents of a sample
TECO.INI file:
EVADM3A$ EPTED:LINE$ [*]L ^AWelcome to TECO!
^A
This command string will specify the terminal in use as an ADM3A,
store the TECO macro LINE.TEC into Q-register L, and type a welcoming
message. You may now type "ML=" at any time to find out what line in
the text buffer the pointer is at.
Q-registers can be used to recover text "lost" because you forgot
to type an "I" at the beginning of an insert command. TECO usually
types an error message like "SEARCH STRING TOO LONG" or "MISSING TAG"
when this happens. A "*i" typed as the first command after the error
message will place the text you intended to insert in q-register i. A
subsequent "Gi" command will copy the text into the buffer. Remember
to delete the altmode (-D$$ works fine) at the end of the restored
text.
TECO error messages actually consist of three parts: 1) a six
letter error code, 2) a one line description of the error, and 3) a
detailed explanation of the cause of the error. The command "nEH"
(n=1,2,3) will tell TECO how much of every error message you wish to
see. Novice users should put "3EH" into their TECO.INI command
string. Advanced users may wish to use "1EH". In any case, typing a
slash after an error message appears will cause TECO to type the next
portion of the error message.
The "?" command has two uses. Immediately after an error
message, a "?" will type out the command that caused the detected
error. At any other time, a ? puts TECO in trace mode. Trace mode
displays each command as it is executed. A subsequent ? turns off
tracing.
TECO Command Summary Page 25
Hints 19 Sep 81
Q-registers can be used to save positions within the buffer for
use as arguments to other commands. You can move around in the
buffer, saving the current value of the buffer pointer at places of
interest by typing ".Ui". "Qi" is then used to return the value
stored in q-register i. For example, suppose different buffer
positions have been saved in q-regs a, b, and c. Then Qa,QbT types
out the text in the buffer between a and b; Qa,QbXd stores a copy of
the text between a and b in q-reg d; Qa,QbK deletes the text between
a and b; QcJ moves the buffer pointer to position c; Gd gets a copy
of the text in q-reg d and inserts it at c (our current buffer
position).
At the conclusion of any K or D command, the buffer pointer is
positioned between the characters that preceded and followed the
deletion. In the above example, note that this means a "QcJ" followed
by a "Qa,QbK" will leave you at the position of the deletion, not c.
Further, remember that the values stored in q-regs a, b, and c do not
refer to particular character strings, but to locations within the
buffer. Following a deletion (or insertion), they may no longer point
to the same text as before.
Q-registers can be used to save and execute command strings.
"*i", when typed as the first command of a new string, saves the
previous command string in q-reg i. Subsequently, "Mi" can be used to
execute the commands stored in i, much like calling a subroutine.
Saves a lot of typing if you find yourself repeatedly using the same
set of commands!
If you forget what is in a q-register, simply type "Qi=".
To copy the contents of q-register i into q-register j, use
"[i]j".
<FStext1$text2$;> is a fast way to change all occurrences of
text1 in the buffer (starting at the pointer) to text2. This leaves
the pointer positioned at the last place a change was made. Note that
<FStext1$$;> will NOT cause all occurences of text1 to be deleted,
since the two adjacent altmodes will terminate the command
prematurely. To make this work, we must use use a control character
which doesn't generate text to separate the two altmodes (e.g.
<FStext1$^V$;>). Use an FN search instead of FS if you want to
continue beyond the current page in the buffer and change all
occurrences of text1 in the file. At the end of an FN search, all
pages in the file have been input and output and the buffer cleared.
It is a good idea to exit and then reenter TECO every 5-15
minutes (EX$$ followed by TECO<CR> works fine). This will keep your
source and .BAK files as current as possible as a safeguard against a
system crash. If the system does crash while you are editing,
everything typed in the current session will be lost.
The maximum length of a search string is 36 character positions.
However, the search string itself may contain up to 80 characters, if
needed, to specify special control commands (like "^E<nnn>").
TECO Command Summary Page 26
Hints 19 Sep 81
In order to insert or search for control characters, they must be
preceded by a ^R which "quotes" them. ^R is preferable to ^Q, since
^Q will not allow insertion of $ (altmode) as a text character while
^R will.
To save a command string (without having to execute it first)
simply type the command as if it were to be executed and replace the
final two altmodes ($$) at the end of the string with two control-G's
(^G^G). Then type *i. This stores the command, ready for execution,
in q-reg i.
The maximum depth of the Q-register pushdown list is 32 entries.
The Q-register pushdown list is cleared after the execution of
each complete command string (eg, every time TECO types an * to
indicate readiness to accept a new command string).
When used as a command, the two character sequence "up-arrow x"
is equivalent to the single character "control-x" (made by pressing
the CTRL and x keys simultaneously). 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 alphanumeric argument.
B, ., Z, and H are symbolic values often used as arguments with
the K, J, P, T, and X commands. For example, BJ (or simply J) moves
the pointer to the beginning of the buffer. ZJ moves the pointer to
the end of the buffer. Two letter combinations of B, ., and Z can be
used to selectively delete, page-out, type, or copy (to a Q-register)
different sections of text in the buffer. B,Z means everything from
the beginning to the end of the buffer (same as H). B,. means
everything from the beginning of the buffer up to the current pointer
position. .,Z means everything from the current pointer position
through the end of the buffer.
TECO's editing buffer normally holds about 3000 characters, or
roughly 50 lines of text. The text in the buffer is known as the
current page. Text is read in and out of the buffer a page at a time.
Form feeds may be placed in an input file to delimit pages and control
the amount of text read by an input command.
On input, TECO accepts text until one of the following occurs:
1) the end of the input file is reached, 2) a form feed character is
read, 3) the buffer is two-thirds full and a line feed is read (or
filled to within 128 characters of capacity), or 4) the buffer is
completely filled. If the buffer is not large enough to accomodate at
least 3000 characters (or 3000 more characters if appending to the
buffer), TECO automatically expands its buffer by 1K, if possible,
before beginning to input.
Except as text or numeric arguments, the carriage return, line
feed, and space characters are ignored by TECO and may be used to
improve the readability of macros and command strings. NEVER use a
<TAB> (control-I) for this purpose; it is an insert command!
TECO Command Summary Page 27
Hints 19 Sep 81
If you try to exit from TECO and are told "No File for Output",
you probably typed an "EF" command by mistake during the editing
session. This is often the result of an "EC" mistyped as "EF" or by
the partial execution of an insert string that was not preceded by
"I". To recover from this error, open a new output file with the "EW"
command (use a name different from the file being edited) and exit.
Your original file should contain all the text output up to the point
where the "EF" occurred and the new file you created should contain
the rest. Then combine the two files with a copy command (it may be
necessary to delete a few lines duplicated in both files). If all
else fails, you can start over with the .BAK file.
Always try to use the FS command rather than a delete-insert
sequence, since fewer characters need to be shuffled around.
When saving the state of TECO with an EE command, try to reduce
the size of the resulting .SAV file as much as possible by making sure
there is no unwanted text stored in Q-registers (put there by
TECO.INI, for example) and by doing an EC (garbage collect) command
just before the EE.
The ^V (translate to lower case) and ^W (translate to upper case)
commands are very powerful. When used inside an insert or search text
argument, two successive ^V or ^W commands cause translation, to the
specified case, of all following alphabetic characters in that text
argument. A single ^V or ^W command causes translation of the next
single character (if it is alphabetic) to the specified case. The
single ^V or ^W in a text argument takes precedence over the case
conversion mode defined by double ^V or ^W commands.
When used as independent commands, ^V and ^W set TECO to a
prevailing case conversion mode that affects all insert and search
text arguments (except as specified by ^V and ^W commands within the
text arguments). Thus, you can use a terminal without a lower case
keyboard to create and edit files containing both upper and lower case
alphabetic characters. First, use an independent ^V command to set
the prevailing case conversion mode so that all upper case alphabetic
characters are translated to lower case. Then use the ^W command
within individual text arguments to "shift" temporarily to upper case.
An independent 0^V or 0^W command will reset the prevailing mode so
that no case conversion is performed (TECO default). These commands
provide a quick method for converting the case of characters in the
buffer. For example, HXA$HK$^V$I^GA$0^V$$ will convert all the upper
case characters in the buffer to lower case.
An TECO command string is not executed until you type two escapes
($$) in succession. This allows you to concatenate as many commands
as desired into one command string (this is, in fact, what TECO macros
are). Single escapes are required within the string only to delimit
commands with variable length arguments.
It is possible for a TECO macro stored in a Q-register to receive
and return arguments. For example, if the string in Q-register A
contains "U1 U2 ... Q3", then the command "5,10MA=" will cause the
TECO Command Summary Page 28
Hints 19 Sep 81
5,10 to be passed to the first U command, which will store the 10 in
Q-reg 1 and send the 5 on to the second U command, which will store it
in Q-reg 2. The Q3 command at the end of the macro returns the number
in Q-register 3, and this value becomes an argument to the command
following the "MA", in this case an "=" which causes the value to be
typed on the terminal. When writing TECO macros, however, it is a
good idea to save and restore the original contents of any Q-registers
needed. This can be done with the help of the "[" and "]" commands.
Assuming that the macro in our above example makes use of Q-regs 1, 2,
and 3, we could rewrite the macro as "[1 [2 [3 ... ]3 ]2 ]1", which
will preserve the contents around the macro call. Arguments may still
be passed to the macro, since "m,n [i [j" is equivalent to
"[i [j m,nUiUj". Note that our original macro returned the value in
Q-reg 3 by having "Q3" as the last command. It is a little harder to
return a value from a macro if all Q-regs must be restored to their
original contents. The idea is to use parentheses in a
non-conventional manner: "[1 [2 [3 ...Q3+(]3 ]2 ]1 0)". This will
result in the return of the value Q3+0; the trick is that we have
performed some non-arithmetic functions within the parentheses,
something which is perfectly legal as long as a numeric value precedes
the closing right paren. Another example of this technique:
".+(ZJ IHello$ 0)J" will allow you to go to the end of the buffer,
insert "Hello", and then restore your original pointer.
TECO is really a programming language for writing editing
programs. If you want anybody to understand what you've written,
remember to make extensive use of spaces and crlf's. Each line of a
TECO program should be no more complicated than a line of code in any
other programming language.
You may insert comments in TECO programs by enclosing them in
exclamation points; in effect, making them into very long tags.
See the TED: area for examples of several well-formatted TECO
macros. In particular, see TED:MAKTEC.TCO for an explanation of a
simple convention which makes writing TECO macros much more pleasant.
30.1 Setting up video editing
To set up the terminal for video editing the following will cause
you to get the text buffer to be displayed on the first 20 lines of
the screen and the command buffer to be displayed n the last 4 lines
of a terminal that has 24 lines.
"1,20E$(TEXT-BUFFER)$20,24E$(COMMAND-BUFFER)$" After that command has
been issued you must now turn on "VIDEO" mode, to do this the command
"EVON$" should be executed. If the terminal supports the full video
mode it will clear the screen and place the command prompt "*" on the
21st line, column 1 of the screen.