Google
 

Trailing-Edge - PDP-10 Archives - steco_19840320_1er_E35 - 10,5676/teco/manual/teco.man
There is 1 other file named teco.man in the archive. Click here to see a list.



                         TECO - User's Manual

                   Stevens Institute of Technology



                            *** DRAFT ***


                              23 Jun 82




















Copyright (c) 1982 by
Stevens Institute of Technology, Hoboken, New Jersey, 07030
All rights reserved.

This software is furnished under a license and may be used and  copied
only  in  accordance  with  the  terms  of  such  license and with the
inclusion of the above copyright notice.  This software or  any  other
copies  thereof may not be provided or otherwise made available to any
other person.  No title to and ownership of  the  software  is  hereby
transferred.


The information in this software is subject to change  without  notice
and  should  not  be construed as a commitment by Stevens Institute of
Technology.
TECO %200A(1146) Manual -- DRAFT                                Page 2
Table of Contents                                            23 Jun 82


CHAPTER 1       INTRODUCTION

        1.1     Acknowledgements . . . . . . . . . . . . . . . . . . 9
        1.2     Introduction . . . . . . . . . . . . . . . . . . . . 9
        1.3     Version  . . . . . . . . . . . . . . . . . . . . . . 9


CHAPTER 2       GENERAL CONCEPTS

        2.1     Conventions  . . . . . . . . . . . . . . . . . . .  10
        2.2     Characters . . . . . . . . . . . . . . . . . . . .  10
        2.2.1     Control Characters . . . . . . . . . . . . . . .  10
        2.2.2     Escape or Altmode  . . . . . . . . . . . . . . .  11
        2.3     Pointer  . . . . . . . . . . . . . . . . . . . . .  11
        2.4     Text buffer  . . . . . . . . . . . . . . . . . . .  11
        2.5     Q-registers  . . . . . . . . . . . . . . . . . . .  11


CHAPTER 3       SIMPLE EDITING

        3.1     Making and changing files  . . . . . . . . . . . .  12
        3.1.1     The TOPS-10 Operating System . . . . . . . . . .  12
        3.1.1.1     Making a new file  . . . . . . . . . . . . . .  12
        3.1.1.2     TECO . . . . . . . . . . . . . . . . . . . . .  13
        3.1.2     The TOPS-20 Operating System . . . . . . . . . .  13
        3.2     Executing Commands . . . . . . . . . . . . . . . .  13
        3.3     Commands . . . . . . . . . . . . . . . . . . . . .  13
        3.3.1     Positioning the Pointer  . . . . . . . . . . . .  14
        3.3.1.1     Moving Character by Character  . . . . . . . .  14
        3.3.1.2     Moving Line by Line  . . . . . . . . . . . . .  14
        3.3.1.3     Jumping to Absolute Positions  . . . . . . . .  15
        3.3.2     Inserting text into the buffer . . . . . . . . .  15
        3.3.2.1     I command  . . . . . . . . . . . . . . . . . .  15
        3.3.2.2     Control I command (Tab)  . . . . . . . . . . .  16
        3.3.3     Type out . . . . . . . . . . . . . . . . . . . .  16
        3.3.4     Delete . . . . . . . . . . . . . . . . . . . . .  16
        3.3.4.1     Deleting Character by Character  . . . . . . .  17
        3.3.4.2     Killing Lines  . . . . . . . . . . . . . . . .  17
        3.3.5     Searching and Replacing  . . . . . . . . . . . .  17
        3.3.5.1     Searching for a string . . . . . . . . . . . .  17
        3.3.5.2     Replacing one string with another  . . . . . .  18
        3.3.6     Exiting  . . . . . . . . . . . . . . . . . . . .  18
        3.3.6.1     Saving your changes  . . . . . . . . . . . . .  18
        3.3.6.2     Aborting TECO  . . . . . . . . . . . . . . . .  18


CHAPTER 4       COMMAND LINES

        4.1     Introduction . . . . . . . . . . . . . . . . . . .  20
        4.2     Editing command lines  . . . . . . . . . . . . . .  20
        4.2.1     Delete . . . . . . . . . . . . . . . . . . . . .  20
        4.2.2     Backspace (Control H)  . . . . . . . . . . . . .  21
        4.2.3     Control U  . . . . . . . . . . . . . . . . . . .  21
        4.2.4     Control W  . . . . . . . . . . . . . . . . . . .  22
TECO %200A(1146) Manual -- DRAFT                                Page 3
Table of Contents                                            23 Jun 82


        4.2.5     Control G  . . . . . . . . . . . . . . . . . . .  22
        4.3     Immeditate commands  . . . . . . . . . . . . . . .  22
        4.3.1     Non-video mode . . . . . . . . . . . . . . . . .  22
        4.3.2     Video mode . . . . . . . . . . . . . . . . . . .  22


CHAPTER 5       INSERT STRINGS AND STRING ARGUMENTS

        5.1     Insert strings . . . . . . . . . . . . . . . . . .  23
        5.1.1     Insert subcommands . . . . . . . . . . . . . . .  23
        5.1.1.1     ^A and ^V subcommands  . . . . . . . . . . . .  23
        5.1.1.2     ^B and ^W subcommands  . . . . . . . . . . . .  24
        5.1.1.3     ^G subcommand  . . . . . . . . . . . . . . . .  24
        5.1.1.4     ^R subcommand  . . . . . . . . . . . . . . . .  24
        5.1.1.5     ^T subcommand  . . . . . . . . . . . . . . . .  24
        5.1.1.6     ^^ subcommand  . . . . . . . . . . . . . . . .  25
        5.1.2     Delimited insert command . . . . . . . . . . . .  25
        5.2     String arguments . . . . . . . . . . . . . . . . .  25


CHAPTER 6       SEARCHING

        6.1     Search strings . . . . . . . . . . . . . . . . . .  26
        6.1.1     Simple search string . . . . . . . . . . . . . .  26
        6.1.2     Special character(s) . . . . . . . . . . . . . .  26
        6.1.2.1     ^G (Control G) . . . . . . . . . . . . . . . .  26
        6.1.2.2     ^E (Control E) . . . . . . . . . . . . . . . .  27
        6.1.2.2.1     ^EA  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.2.2     ^EV  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.2.3     ^EW  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.2.4     ^ED  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.2.5     ^EL  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.2.6     ^ES  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.2.7     ^E<  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.2.8     ^E[  . . . . . . . . . . . . . . . . . . . .  27
        6.1.2.3     ^X (Control X) . . . . . . . . . . . . . . . .  27
        6.1.2.4     ^N (Control N) . . . . . . . . . . . . . . . .  27
        6.1.2.5     ^S (Control S) . . . . . . . . . . . . . . . .  27
        6.1.2.6     ^A (Control A) . . . . . . . . . . . . . . . .  27
        6.1.2.7     ^B (Control B) . . . . . . . . . . . . . . . .  27
        6.1.2.8     ^V (Control V) . . . . . . . . . . . . . . . .  27
        6.1.2.9     ^W (Control W) . . . . . . . . . . . . . . . .  27
        6.1.2.10    ^\ (Control backslash) . . . . . . . . . . . .  27
        6.1.2.11    ^^ (Control circumflex)  . . . . . . . . . . .  27
        6.1.2.12    ^T (Control T) . . . . . . . . . . . . . . . .  27
        6.1.2.13    ^Q (Control Q) . . . . . . . . . . . . . . . .  27
        6.1.2.14    ^R (Control R) . . . . . . . . . . . . . . . .  27
        6.1.2.15    $ (Escape) . . . . . . . . . . . . . . . . . .  27
        6.2     Normal . . . . . . . . . . . . . . . . . . . . . .  27
        6.2.1     S command  . . . . . . . . . . . . . . . . . . .  28
        6.2.2     N command  . . . . . . . . . . . . . . . . . . .  28
        6.3     Substitution . . . . . . . . . . . . . . . . . . .  28
        6.3.1     FS command . . . . . . . . . . . . . . . . . . .  28
        6.3.2     FN command . . . . . . . . . . . . . . . . . . .  28
TECO %200A(1146) Manual -- DRAFT                                Page 4
Table of Contents                                            23 Jun 82


        6.4     Word . . . . . . . . . . . . . . . . . . . . . . .  28
        6.4.1     FW command . . . . . . . . . . . . . . . . . . .  28
        6.5     Deleting . . . . . . . . . . . . . . . . . . . . .  28
        6.5.1     FK command . . . . . . . . . . . . . . . . . . .  28
        6.5.2     FD command . . . . . . . . . . . . . . . . . . .  28
        6.5.3     _ command  . . . . . . . . . . . . . . . . . . .  28
        6.6     Bounded  . . . . . . . . . . . . . . . . . . . . .  28


CHAPTER 7       Q-REGISTERS

        7.1     Introduction . . . . . . . . . . . . . . . . . . .  29
        7.2     Single character . . . . . . . . . . . . . . . . .  29
        7.3     Multiple character . . . . . . . . . . . . . . . .  30
        7.4     Predefined Q-registers . . . . . . . . . . . . . .  30
        7.4.1     AUTO-COMMAND . . . . . . . . . . . . . . . . . .  30
        7.4.2     AUTO-COUNT . . . . . . . . . . . . . . . . . . .  30
        7.4.3     COMMAND-BUFFER . . . . . . . . . . . . . . . . .  30
        7.4.4     COMMAND-PROMPT . . . . . . . . . . . . . . . . .  31
        7.4.5     CONTROL-C-INTERCEPT-COMMAND  . . . . . . . . . .  31
        7.4.6     ERROR-TEXT . . . . . . . . . . . . . . . . . . .  31
        7.4.7     EXIT-COMMAND . . . . . . . . . . . . . . . . . .  31
        7.4.8     TERMINAL-INPUT-BUFFER  . . . . . . . . . . . . .  31
        7.4.9     TEXT-BUFFER  . . . . . . . . . . . . . . . . . .  32
        7.4.10    Question mark ("?")  . . . . . . . . . . . . . .  32
        7.4.11    Period (".") . . . . . . . . . . . . . . . . . .  32
        7.4.12    Asterisk ("*") . . . . . . . . . . . . . . . . .  32


CHAPTER 8       EXPRESSIONS

        8.1     Introduction . . . . . . . . . . . . . . . . . . .  33
        8.2     Evaluation . . . . . . . . . . . . . . . . . . . .  33
        8.3     Operators  . . . . . . . . . . . . . . . . . . . .  33
        8.3.1     Addition . . . . . . . . . . . . . . . . . . . .  34
        8.3.2     Unary plus . . . . . . . . . . . . . . . . . . .  34
        8.3.3     Subtraction  . . . . . . . . . . . . . . . . . .  34
        8.3.4     Unary minus  . . . . . . . . . . . . . . . . . .  34
        8.3.5     Division . . . . . . . . . . . . . . . . . . . .  34
        8.3.6     Multiplication . . . . . . . . . . . . . . . . .  34
        8.3.7     Logical AND  . . . . . . . . . . . . . . . . . .  34
        8.3.8     Logical OR . . . . . . . . . . . . . . . . . . .  34
        8.3.9     Parentheses  . . . . . . . . . . . . . . . . . .  34
        8.4     Values . . . . . . . . . . . . . . . . . . . . . .  34
        8.4.1     Numerics . . . . . . . . . . . . . . . . . . . .  34
        8.4.1.1     Decimal  . . . . . . . . . . . . . . . . . . .  34
        8.4.1.2     Octal  . . . . . . . . . . . . . . . . . . . .  34
        8.4.2     Strings  . . . . . . . . . . . . . . . . . . . .  34
        8.4.3     Q-registers  . . . . . . . . . . . . . . . . . .  34


CHAPTER 9       VIDEO EDITING

        9.1     Introduction . . . . . . . . . . . . . . . . . . .  35
TECO %200A(1146) Manual -- DRAFT                                Page 5
Table of Contents                                            23 Jun 82


        9.2     Video mode editing . . . . . . . . . . . . . . . .  35
        9.2.1     E$ Command . . . . . . . . . . . . . . . . . . .  35
        9.2.2     EV . . . . . . . . . . . . . . . . . . . . . . .  36


CHAPTER 10      IMMEDIATE MODE EDITING

        10.1    Introduction . . . . . . . . . . . . . . . . . . .  39
        10.2    Immediate mode editing . . . . . . . . . . . . . .  39
        10.2.1    Concepts . . . . . . . . . . . . . . . . . . . .  39
        10.2.1.1    Command Table  . . . . . . . . . . . . . . . .  40
        10.2.1.2    Command Table Interaction  . . . . . . . . . .  40
        10.2.1.3    Saving a command table . . . . . . . . . . . .  40
        10.2.2    key words  . . . . . . . . . . . . . . . . . . .  40
        10.2.2.1    PUSH . . . . . . . . . . . . . . . . . . . . .  41
        10.2.2.2    POP  . . . . . . . . . . . . . . . . . . . . .  41
        10.2.2.3    DELETE . . . . . . . . . . . . . . . . . . . .  41
        10.2.2.4    INSERT . . . . . . . . . . . . . . . . . . . .  41
        10.2.2.5    REPLACE  . . . . . . . . . . . . . . . . . . .  41
        10.2.2.6    OVERLAY  . . . . . . . . . . . . . . . . . . .  42
        10.2.2.7    REMOVE . . . . . . . . . . . . . . . . . . . .  42
        10.2.2.8    SAVE . . . . . . . . . . . . . . . . . . . . .  42
        10.2.2.9    RESTORE  . . . . . . . . . . . . . . . . . . .  42
        10.2.2.10   RESET  . . . . . . . . . . . . . . . . . . . .  42
        10.2.2.11   OFF  . . . . . . . . . . . . . . . . . . . . .  42
        10.2.2.12   ON . . . . . . . . . . . . . . . . . . . . . .  43
        10.2.3    Command table format . . . . . . . . . . . . . .  43
        10.2.3.1    Immediate command  . . . . . . . . . . . . . .  43
        10.2.3.1.1    Quoted string  . . . . . . . . . . . . . . .  44
        10.2.3.1.2    NULL . . . . . . . . . . . . . . . . . . . .  44
        10.2.3.1.3    DELETE . . . . . . . . . . . . . . . . . . .  44
        10.2.3.1.4    DECIMAL  . . . . . . . . . . . . . . . . . .  44
        10.2.3.1.5    DIGIT  . . . . . . . . . . . . . . . . . . .  44
        10.2.3.1.6    OCTAL  . . . . . . . . . . . . . . . . . . .  44
        10.2.3.1.7    ALPHABETIC . . . . . . . . . . . . . . . . .  45
        10.2.3.1.8    ALPHANUMERIC . . . . . . . . . . . . . . . .  45
        10.2.3.1.9    ANY  . . . . . . . . . . . . . . . . . . . .  45
        10.2.3.1.10   VALUE  . . . . . . . . . . . . . . . . . . .  45
        10.2.3.1.11   RANGE  . . . . . . . . . . . . . . . . . . .  45
        10.2.3.1.12   OTHER  . . . . . . . . . . . . . . . . . . .  46
        10.2.3.1.13   ALWAYS . . . . . . . . . . . . . . . . . . .  46
        10.2.3.2    Command type . . . . . . . . . . . . . . . . .  46
        10.2.3.2.1    BASE . . . . . . . . . . . . . . . . . . . .  46
        10.2.3.2.2    IMMEDIATE  . . . . . . . . . . . . . . . . .  46
        10.2.3.2.3    TECO . . . . . . . . . . . . . . . . . . . .  46
        10.2.3.2.4    PREVIOUS . . . . . . . . . . . . . . . . . .  47
        10.2.3.3    Command to execute . . . . . . . . . . . . . .  47
        10.2.3.4    Examples . . . . . . . . . . . . . . . . . . .  47


CHAPTER 11      FLAGS

        11.1    Introduction . . . . . . . . . . . . . . . . . . .  48
        11.2    Case Conversion  . . . . . . . . . . . . . . . . .  48
TECO %200A(1146) Manual -- DRAFT                                Page 6
Table of Contents                                            23 Jun 82


        11.3    Exact case match . . . . . . . . . . . . . . . . .  48
        11.4    End of File  . . . . . . . . . . . . . . . . . . .  49
        11.5    Form feed  . . . . . . . . . . . . . . . . . . . .  49


CHAPTER 12      COMMAND SUMMARY

        12.1    Control A (^A) . . . . . . . . . . . . . . . . . .  50
        12.2    Control C (^C) . . . . . . . . . . . . . . . . . .  50
        12.3    Control D (^D) . . . . . . . . . . . . . . . . . .  51
        12.4    Control E (^E) . . . . . . . . . . . . . . . . . .  51
        12.5    Control F (^F) . . . . . . . . . . . . . . . . . .  52
        12.6    Control G (^G) . . . . . . . . . . . . . . . . . .  52
        12.7    Control H (^H) . . . . . . . . . . . . . . . . . .  53
        12.8    Control I (^I) . . . . . . . . . . . . . . . . . .  53
        12.9    Control J (^J) . . . . . . . . . . . . . . . . . .  53
        12.10   Control L (^L) . . . . . . . . . . . . . . . . . .  53
        12.11   Control M (^M) . . . . . . . . . . . . . . . . . .  54
        12.12   Control N (^N) . . . . . . . . . . . . . . . . . .  54
        12.13   Control O (^O) . . . . . . . . . . . . . . . . . .  54
        12.14   Control P (^P) . . . . . . . . . . . . . . . . . .  55
        12.15   Control T (^T) . . . . . . . . . . . . . . . . . .  55
        12.16   Control U (^U) . . . . . . . . . . . . . . . . . .  56
        12.17   Control V (^V) . . . . . . . . . . . . . . . . . .  56
        12.18   Control W (^W) . . . . . . . . . . . . . . . . . .  57
        12.19   Control X (^X) . . . . . . . . . . . . . . . . . .  57
        12.20   Control Y (^Y) . . . . . . . . . . . . . . . . . .  58
        12.21   Control Z (^Z) . . . . . . . . . . . . . . . . . .  58
        12.22   Space  . . . . . . . . . . . . . . . . . . . . . .  58
        12.23   !  . . . . . . . . . . . . . . . . . . . . . . . .  59
        12.24   "  . . . . . . . . . . . . . . . . . . . . . . . .  59
        12.25   #  . . . . . . . . . . . . . . . . . . . . . . . .  62
        12.26   %  . . . . . . . . . . . . . . . . . . . . . . . .  62
        12.27   &  . . . . . . . . . . . . . . . . . . . . . . . .  62
        12.28   '  . . . . . . . . . . . . . . . . . . . . . . . .  63
        12.29   (  . . . . . . . . . . . . . . . . . . . . . . . .  63
        12.30   )  . . . . . . . . . . . . . . . . . . . . . . . .  63
        12.31   * (multiply operator)  . . . . . . . . . . . . . .  63
        12.32   + (plus operator)  . . . . . . . . . . . . . . . .  64
        12.33   ,  . . . . . . . . . . . . . . . . . . . . . . . .  64
        12.34   -  . . . . . . . . . . . . . . . . . . . . . . . .  64
        12.35   .  . . . . . . . . . . . . . . . . . . . . . . . .  64
        12.36   :  . . . . . . . . . . . . . . . . . . . . . . . .  65
        12.37   ;  . . . . . . . . . . . . . . . . . . . . . . . .  65
        12.38   <  . . . . . . . . . . . . . . . . . . . . . . . .  65
        12.39   =  . . . . . . . . . . . . . . . . . . . . . . . .  66
        12.40   >  . . . . . . . . . . . . . . . . . . . . . . . .  66
        12.41   /  . . . . . . . . . . . . . . . . . . . . . . . .  66
        12.42   @  . . . . . . . . . . . . . . . . . . . . . . . .  66
        12.43   A  . . . . . . . . . . . . . . . . . . . . . . . .  67
        12.44   B  . . . . . . . . . . . . . . . . . . . . . . . .  67
        12.45   C  . . . . . . . . . . . . . . . . . . . . . . . .  67
        12.46   D  . . . . . . . . . . . . . . . . . . . . . . . .  68
        12.47   E. . . . . . . . . . . . . . . . . . . . . . . . .  68
TECO %200A(1146) Manual -- DRAFT                                Page 7
Table of Contents                                            23 Jun 82


        12.48   E$ . . . . . . . . . . . . . . . . . . . . . . . .  68
        12.49   E< . . . . . . . . . . . . . . . . . . . . . . . .  68
        12.50   E> . . . . . . . . . . . . . . . . . . . . . . . .  69
        12.51   E? . . . . . . . . . . . . . . . . . . . . . . . .  69
        12.51.1   CURRENT-TEXT-BUFFER  . . . . . . . . . . . . . .  69
        12.51.2   DISPLAY-LINES  . . . . . . . . . . . . . . . . .  69
        12.51.3   INPUT-FILE . . . . . . . . . . . . . . . . . . .  69
        12.51.4   LAST-SEARCH-STRING-LENGTH  . . . . . . . . . . .  69
        12.51.5   LEAVE-BLANK-LINE . . . . . . . . . . . . . . . .  69
        12.51.6   OUTPUT-FILE  . . . . . . . . . . . . . . . . . .  69
        12.51.7   Q-DIRECTORY  . . . . . . . . . . . . . . . . . .  69
        12.51.8   SCREEN-ADDRESS . . . . . . . . . . . . . . . . .  70
        12.51.9   TERMINAL-TYPE  . . . . . . . . . . . . . . . . .  70
        12.52   EA . . . . . . . . . . . . . . . . . . . . . . . .  70
        12.53   EB . . . . . . . . . . . . . . . . . . . . . . . .  70
        12.54   EC . . . . . . . . . . . . . . . . . . . . . . . .  70
        12.55   ED . . . . . . . . . . . . . . . . . . . . . . . .  70
        12.56   EE . . . . . . . . . . . . . . . . . . . . . . . .  71
        12.57   EF . . . . . . . . . . . . . . . . . . . . . . . .  71
        12.58   EG . . . . . . . . . . . . . . . . . . . . . . . .  71
        12.59   EH . . . . . . . . . . . . . . . . . . . . . . . .  71
        12.60   EI . . . . . . . . . . . . . . . . . . . . . . . .  72
        12.61   EJ . . . . . . . . . . . . . . . . . . . . . . . .  72
        12.62   EK . . . . . . . . . . . . . . . . . . . . . . . .  72
        12.63   EL . . . . . . . . . . . . . . . . . . . . . . . .  72
        12.64   EM . . . . . . . . . . . . . . . . . . . . . . . .  73
        12.65   EN . . . . . . . . . . . . . . . . . . . . . . . .  73
        12.66   EO . . . . . . . . . . . . . . . . . . . . . . . .  73
        12.67   EP . . . . . . . . . . . . . . . . . . . . . . . .  73
        12.68   EQ . . . . . . . . . . . . . . . . . . . . . . . .  74
        12.69   ER . . . . . . . . . . . . . . . . . . . . . . . .  74
        12.70   ES . . . . . . . . . . . . . . . . . . . . . . . .  74
        12.71   ET . . . . . . . . . . . . . . . . . . . . . . . .  74
        12.72   EU . . . . . . . . . . . . . . . . . . . . . . . .  75
        12.73   EV . . . . . . . . . . . . . . . . . . . . . . . .  75
        12.73.1   LINE . . . . . . . . . . . . . . . . . . . . . .  75
        12.73.2   MODE . . . . . . . . . . . . . . . . . . . . . .  75
        12.73.3   NODE . . . . . . . . . . . . . . . . . . . . . .  75
        12.73.4   OFF  . . . . . . . . . . . . . . . . . . . . . .  75
        12.73.5   ON . . . . . . . . . . . . . . . . . . . . . . .  75
        12.73.6   REFRESH  . . . . . . . . . . . . . . . . . . . .  75
        12.73.7   SCREEN . . . . . . . . . . . . . . . . . . . . .  75
        12.73.8   SCROLL . . . . . . . . . . . . . . . . . . . . .  76
        12.73.9   TRMOP  . . . . . . . . . . . . . . . . . . . . .  76
        12.73.10  UPDATE . . . . . . . . . . . . . . . . . . . . .  76
        12.73.11  WINDOW . . . . . . . . . . . . . . . . . . . . .  76
        12.74   EW . . . . . . . . . . . . . . . . . . . . . . . .  76
        12.75   EX . . . . . . . . . . . . . . . . . . . . . . . .  76
        12.76   EY . . . . . . . . . . . . . . . . . . . . . . . .  76
        12.77   EZ . . . . . . . . . . . . . . . . . . . . . . . .  77
        12.78   FC . . . . . . . . . . . . . . . . . . . . . . . .  77
        12.78.1   PUSH . . . . . . . . . . . . . . . . . . . . . .  77
        12.78.2   POP  . . . . . . . . . . . . . . . . . . . . . .  77
        12.78.3   DELETE . . . . . . . . . . . . . . . . . . . . .  77
TECO %200A(1146) Manual -- DRAFT                                Page 8
Table of Contents                                            23 Jun 82


        12.78.4   INSERT . . . . . . . . . . . . . . . . . . . . .  77
        12.78.5   REPLACE  . . . . . . . . . . . . . . . . . . . .  77
        12.78.6   OVERLAY  . . . . . . . . . . . . . . . . . . . .  77
        12.78.7   REMOVE . . . . . . . . . . . . . . . . . . . . .  77
        12.78.8   SAVE . . . . . . . . . . . . . . . . . . . . . .  77
        12.78.9   RESTORE  . . . . . . . . . . . . . . . . . . . .  77
        12.78.10  RESET  . . . . . . . . . . . . . . . . . . . . .  78
        12.78.11  OFF  . . . . . . . . . . . . . . . . . . . . . .  78
        12.78.12  ON . . . . . . . . . . . . . . . . . . . . . . .  78
        12.79   FD . . . . . . . . . . . . . . . . . . . . . . . .  78
        12.80   FI . . . . . . . . . . . . . . . . . . . . . . . .  78
        12.81   FK . . . . . . . . . . . . . . . . . . . . . . . .  78
        12.82   FN . . . . . . . . . . . . . . . . . . . . . . . .  78
        12.83   FS . . . . . . . . . . . . . . . . . . . . . . . .  79
        12.84   G  . . . . . . . . . . . . . . . . . . . . . . . .  79
        12.85   H  . . . . . . . . . . . . . . . . . . . . . . . .  79
        12.86   I  . . . . . . . . . . . . . . . . . . . . . . . .  80
        12.87   J  . . . . . . . . . . . . . . . . . . . . . . . .  80
        12.88   K  . . . . . . . . . . . . . . . . . . . . . . . .  80
        12.89   L  . . . . . . . . . . . . . . . . . . . . . . . .  80
        12.90   M  . . . . . . . . . . . . . . . . . . . . . . . .  81
        12.91   N  . . . . . . . . . . . . . . . . . . . . . . . .  81
        12.92   O  . . . . . . . . . . . . . . . . . . . . . . . .  81
        12.93   P  . . . . . . . . . . . . . . . . . . . . . . . .  81
        12.94   Q  . . . . . . . . . . . . . . . . . . . . . . . .  82
        12.95   R  . . . . . . . . . . . . . . . . . . . . . . . .  82
        12.96   S  . . . . . . . . . . . . . . . . . . . . . . . .  83
        12.97   T  . . . . . . . . . . . . . . . . . . . . . . . .  83
        12.98   U  . . . . . . . . . . . . . . . . . . . . . . . .  84
        12.99   V  . . . . . . . . . . . . . . . . . . . . . . . .  85
        12.100  W  . . . . . . . . . . . . . . . . . . . . . . . .  86
        12.101  X  . . . . . . . . . . . . . . . . . . . . . . . .  86
        12.102  Y  . . . . . . . . . . . . . . . . . . . . . . . .  87
        12.103  Z  . . . . . . . . . . . . . . . . . . . . . . . .  87


CHAPTER 13      HINTS

        13.1    Introduction . . . . . . . . . . . . . . . . . . .  88
        13.2    TECO initialization  . . . . . . . . . . . . . . .  88
        13.3    Error recovery . . . . . . . . . . . . . . . . . .  89
        13.4    Editting Techniques  . . . . . . . . . . . . . . .  89
        13.5    Video editting . . . . . . . . . . . . . . . . . .  92
        13.6    Efficiency . . . . . . . . . . . . . . . . . . . .  92
        13.7    Miscellaneous  . . . . . . . . . . . . . . . . . .  92











                              CHAPTER 1

                             INTRODUCTION



1.1  Acknowledgements

The version of TECO that is described  herein  was  developed  by  the
staff of the Computer Center at Stevens Institute of Technology.  This
version is based on the work done at the University of Texas at Austin
and  University  of  New  Orleans  (version  124A) and by work done at
Stevens (version 123 and 123A).



1.2  Introduction

TECO stands for Text Editor and COrector.  It is a text editor for the
DECsystem-10  and the DECSYSTEM-20.  TECO may be used to edit any form
of ASCII text, such as program sources, manuscripts, etc.,  and  COBOL
SIXBIT  files.  TECO is a character oriented editor rather than a line
editor.  Text edited by TECO does not  have  line  numbers  associated
with  it  as  other  editors do.  Although it is possible to edit text
with line sequence numbers on it.

This manual is intended to  be  a  reference  manual  except  for  the
chapter  on the basic editing.  After that chapter is assumed that the
reader has a general familiarity with TECO  and  is  referencing  this
manual for detailed information.



1.3  Version

This manual describes the  features  and  commands  found  in  version
200A(1146)   of  TECO.   This  version  currently  only  runs  on  the
DECsystem-10 and not the DECSYSTEM-20.  Work is currently underway  to
produce  a version that will run native on the DECSYSTEM-20.  TECO has
been tested under TOPS-10 version 7.01 and TOPS-10 version 7.02.











                              CHAPTER 2

                           GENERAL CONCEPTS



This chapter contains descriptions of various concepts and definitions
of  symbol  conventions.  This chapter should be read before any other
chapters in this document, so that the reader has a complete grasp  on
the conventions used in this manual and the concepts used in TECO.



2.1  Conventions

The following conventions are observed in this document:

     1.  Underlining is used to indicate things typed by the computer.

     2.  Lower case indicates items supplied by you.

     3.  Upper case indicates key  words  and  symbols  recognized  by
         TECO.




2.2  Characters

Normally characters  that  are  shown  in  the  manual  represent  the
characters  that  are typed.  There are a few exceptions to this rule.
These execeptions are:



2.2.1  Control Characters

Any character following a ^ is considered  a  control  character.   In
general,   TECO  will  allow  you  to  type  a  control  character  as
"<carrot><character>", unless it is part of of a text string within  a
search  or  insert command.  This allows you to use TECO commands that
conflict with the monitor control character commands (e.g. Control C).
GENERAL CONCEPTS                                              Page 2-2
Characters                                                   23 Jun 82


2.2.2  Escape or Altmode

The escape key is usually near the top left of the  keyboard.   It  is
labeled  ESC  or  ALT  unless it is spelled out.  The Escape character
looks exactly like a $ (dollar sign).  This character is equivalent to
the ^[ (Control [).



2.3  Pointer

The pointer is a number that represents a position in the text buffer.
The  location  of  the  pointer determines where certain commands will
take effect.  This pointer  always  points  to  the  position  between
characters;  it never points at a character.  In video mode the cursor
on the video screen will be positioned over  the  character  following
the pointer (if any).



2.4  Text buffer

A text buffer is a place where text is stored and changed.   All  text
buffers  have  associated with them a pointer, and optionally an input
or output file or both.



2.5  Q-registers

A Q-register is a temporary data storage location with a name.   Text,
numeric  values,  strings  of  TECO  commands, or user-defined command
tables can be stored in them.  They can be manipulated in  many  ways.
For  example,  they  can be used to move blocks of text or to save you
from repetitively typing long strings of commands.











                              CHAPTER 3

                            SIMPLE EDITING



This is a working subset of TECO.  It presents enough TECO for one  to
create  and  modify  files.  However, the material presented herein is
correct (hopefully)  but  not  complete.   Complete  descriptions  and
explanations can be found in the remainder of this document.



3.1  Making and changing files

TECO can be invoked either to edit an existing file or to create a new
file.  The way TECO is invoked depends on the operating system and may
vary from system to system.



3.1.1  The TOPS-10 Operating System

The commands that invoke TECO are MAKE and TECO.



3.1.1.1  Making a new file


     .MAKE filespec


The command "MAKE filespec" invokes TECO.  When the  user  exits  from
TECO  the  file specified by "filespec" is saved permanently.  If that
file already existed and is not protected, it will be destroyed by the
new one.  If the file already exists you will be warned:

     %TECSUP Superseding existing file 'filename'

If the file exists and is protected TECO will give the error message:

     ?TECPRT Protection failure or directory full  on  a  DECtape  for
     'filename'

          However if one does not wish  to  superceed  the  old  file,
SIMPLE EDITING                                                Page 3-2
Making and changing files                                    23 Jun 82


          typing  "^C"  (control-C)  twice  will kill TECO without any
          damage to the original file.



          3.1.1.2  TECO


               .TECO oldfile

          The TECO command is used to edit an already  existing  file.
          If  the  file  does not exist or is protected then TECO will
          respond with an error message.  One  can  then  escape  from
          TECO by typing "^C" (control C) twice.



          3.1.2  The TOPS-20 Operating System

          NOT YET SUPPORTED.



          3.2  Executing Commands

          When TECO prompts with an asterisk "*", it  is  waiting  for
          input;  at this point you may enter commands.  What you type
          will not be executed until you type two escape characters in
          succession.   The  escape  key is marked either ESC, ESCAPE,
          ALT or ALTMODE.  If there is no escape key on the  termimal,
          use  "^["  (control-[).   Escape echos like dollar sign ($).
          For example,

               *HT$$

          types the contents of the buffer.  To correct typing  errors
          before  them,  use  "^H"  or  the  delete  key to delete one
          character at a time;   to  erase  the  whole  command,  type
          "^G^G".



          3.3  Commands

          Elementary  commands  for  moving  the  pointer,  inserting,
          deleting  and typing out are explained in this section.  The
          complete explainations of all the commands can be  found  in
          the command summary chapter.
SIMPLE EDITING                                                Page 3-3
Commands                                                     23 Jun 82


          3.3.1  Positioning the Pointer

          TECO is a position oriented text editor.  The pointer is the
          number  of  characters  from  the  beginning  of the buffer.
          Where many commands take effect depends on the  position  of
          the pointer.



          3.3.1.1  Moving Character by Character

          The C command takes a number as an argument  and  moves  the
          pointer  that  number  of characters.  Positive numbers move
          the pointer to the end of the text buffer;  negative numbers
          moves the pointer towards the beginning of the buffer.  This
          means  that  a  "1C"  command  will  move  the  pointer  one
          character  position  towards  the  end  of the file, while a
          "-1C" command will  move  the  pointer  one  character  back
          towards the beginning.

          Here is an example of the C  command:   If  the  pointer  is
          between   represented   by   the  "^"  symbol  in  the  text
          "DEC^system" then a "3C" command will result in the  pointer
          being positioned as follows:  "DECsys^tem".


                                   ** Note **

              An end of line is two charcters, a  carriage  return
              and  a  line  feed.   This  means  that  you must be
              careful moving the pointer over the end of a line.





          3.3.1.2  Moving Line by Line


          The L command causes the pointer to be advanced to after the
          Nth  end of line character, where N is the argument given to
          the command.  A negative number will cause the  the  pointer
          to  be  moved  backwards  and  a  zero means to position the
          pointer at the beginning of the line  it  is  currently  in.
          Examples:

               *5L$$    ;  Advance five lines.
               *0L$$    ;  Position to the beginning  of  the  current
               line.
SIMPLE EDITING                                                Page 3-4
Commands                                                     23 Jun 82


          3.3.1.3  Jumping to Absolute Positions


          The J command allows you  to  position  the  pointer  to  an
          absolute   character  location  in  the  text  buffer.   The
          character locations is specified by  the  argument  that  is
          given  before  the  command.   The location before the first
          character in the text  buffer  is  considered  to  be  zero,
          before  the  second,  one,  and  so on.  The two most useful
          forms of the "J" command are:

               *J$$ ;  puts the pointer before the first character  in
               the text buffer and
               *ZJ$$ ;  puts the pointer after the last  character  in
               the text buffer.

          "J" is identical to "0J".  "Z" is the number  of  characters
          in the buffer.



          3.3.2  Inserting text into the buffer

          There are two basic ways to insert text using TECO.   The  I
          command and ^I (or tab) command.  Both of these commands are
          terminated by an escape character to denote the end  of  the
          string that is to be input.  Some control characters can not
          be directly inserted into the buffer.



          3.3.2.1  I command


          The I command will insert the text that follows it into  the
          current  text  buffer.   The text being inserted is normally
          refered to as an insert string;   it  is  terminated  by  an
          escape character.


                                   ** Note **

              If you continue typing after  you  reach  the  right
              margin,  the  rest  of the line will be displayed on
              successive lines even though you did  not  type  any
              <returns>.  TECO treats this as one long line!  Line
              oriented commands, like L and K, operate on the line
              as it is not as it appears.



          An example of an I command is:

               *IThis is inserted on the first line.
SIMPLE EDITING                                                Page 3-5
Commands                                                     23 Jun 82


               This is inserted on the second line.
               $$



          3.3.2.2  Control I command (Tab)


          The Control I insert command is identical to the I  command,
          except that the ^I (tab) is also inserted.

          An example of this is:

               *        This text follows a tab.$$


                                   ** Note **

              It is a good habit to type a carrage return  at  the
              end of each insertion.  Consistency will help you to
              avoid mistakes like  entering  two  lines  that  are
              actually  one  because  there  is  no carrage return
              between  them.   Furthermore,  some   programs   and
              compilers cannot read the last line of a file unless
              it is followed by a carrage return.





          3.3.3  Type out

          In order to see what you are doing and where the pointer  is
          you  must  list  portions  of  the text.  To type n lines of
          text, enter "nT".  If n is positive, then n lines after  the
          pointer will be typed, if n is zero then the line containing
          the pointer up to the pointer will be  typed  and  if  n  is
          negative  then  n lines before the pointer are typed.  Note:
          the T command does not move  the  pointer.   Here  are  some
          typial command strings:

               HT$$ ;  Types the whole contents of the buffer.
               -5T5T$$ ;  Types the five lines before  and  after  the
               pointer.




          3.3.4  Delete

          There are two basic ways of deleting text in  TECO.   The  D
          command will delete a specified number of characters.  The K
          command will delete a specified number of lines.
SIMPLE EDITING                                                Page 3-6
Commands                                                     23 Jun 82


          3.3.4.1  Deleting Character by Character


          The D command deletes a specified number of characters.   It
          takes  a  single  numeric  argument before it to specify the
          number of characters to be deleted.  If the argument is  not
          supplied it will default to one.



          3.3.4.2  Killing Lines


          To save yourself from much unnecessary  character  counting,
          you  can delete whole lines with the K command.  The syntax,
          as you may have guessed, is nK, where n  is  the  number  of
          lines  to  delete;   positive values of n delete towards the
          end of the buffer and negative towards the beginning.   Zero
          is  special.   0K  deletes from the beginning of the current
          line to the pointer.



          3.3.5  Searching and Replacing

          TECO contains a set of command that search  for  a  specific
          string and optionally modify it.



          3.3.5.1  Searching for a string


          The S command searches for a specific string.  The string is
          specified  directly  after  the  S command and must be ended
          with an escape character.

          Example:

               *Sstring to look for$$


          The above example will search for the string "string to look
          for".   If the string is not found, TECO will give the error
          message,

               "?TECSRH Cannot Find 'string to look for'"

          and leave the pointer where it was.  If the string was found
          then the pointer will be left after the end of the string.
SIMPLE EDITING                                                Page 3-7
Commands                                                     23 Jun 82


          3.3.5.2  Replacing one string with another


          This command will search for the specified text  string  and
          then  replace  the  text that was found with the second text
          string specified in the command.  The format of the  command
          is:

               *FSold string$new string$$


          This searches for the "old string" and replaces it with  the
          "new  string".   If  the  "old  string"  is  not  found then
          "?TECSRH Cannot find 'old  string'"  is  displayed  and  the
          pointer  is  left where it was.  If successful, that is, the
          "new string" replaces the "old string" then the pointer will
          point  to  the  end of "new string".  You may include end of
          line characters in search or replace strings.



          3.3.6  Exiting

          When you are finished  editing,  you  can  either  save  the
          changes and additions you made or you can abort them leaving
          the file as it was before you started editing.



          3.3.6.1  Saving your changes

          The EX command will cause the editing session  to  be  saved
          and  TECO  to  exit  directly to the operating system.  Type
          EX$$ and your changes will be saved.  The  obselete  version
          of the file (if there was one) then becomes a backup file.


                                   ** Note **






          3.3.6.2  Aborting TECO


          Typing ^C stops TECO.  The monitor will prompt  and  monitor
          commands  can  then  be  given.   No changes are made to the
          original file if there was one and if  the  file  was  newly
          created   it  will  not  be  made  permanent.   However,  if
          inadvertently you type ^C, do  not  panic  --  the  file  is
          intact but you must immediately type:
SIMPLE EDITING                                                Page 3-8
Commands                                                     23 Jun 82


               .REENTER

          If you do anything else in between you may "smash your  core
          image",  i.e.   lose  everything  done  in the previous TECO
          session.











                              CHAPTER 4

                            COMMAND LINES



4.1  Introduction

A command string in TECO is a sequence of TECO commands terminated  by
two escapes (altmodes).  The command string can contain a large number
of TECO commands or a single command.



4.2  Editing command lines

Until the two closing escapes are typed, any portion  of  the  command
string  can  be edited (i.e.  changed).  This is done in much the same
way that monitor commands are edited.  When  you  are  using  a  video
terminal and TECO knows that it is a video terminal, TECO will attempt
to keep the copy of the command string on the  screen  identical  with
what  it has as the current command string being input.  In video mode
the text on the screen will always reflect the current command string.
In non-video mode, the text on the screen will usually be correct.



4.2.1  Delete

The delete (may be labelled RUBOUT  on  some  terminals)  is  used  to
delete  the  last character typed in the command string.  If more than
one delete is typed, successive characters in the command  string  are
deleted until there are none left.


                              ** Note **

               The delete allows you to delete carriage
               returns  and line feeds.  Since each end
               of line sequence is made of  of  both  a
               carriage  return  and  a  line feed, two
               deletes must  be  typed  to  delete  the
               entire end of line sequence.


COMMAND LINES                                                 Page 4-2
Editing command lines                                        23 Jun 82


In video mode, the screen will be updated to reflect the current state
of the command string.  When a character is deleted, it will be erased
from the  screen,  and  the  cursor  positioned  after  the  new  last
character.   If  the line feed of a carriage return line feed sequence
is deleted, the carriage return will be printed as ^M.

In non-video mode, the result of typing a delete depends upon the type
of  terminal  that  TECO  thinks is being used.  If TECO knows (or has
been told) that the terminal is a specific  type  of  video  terminal,
then  typing  a  delete will cause the character to be erased from the
screen.  If a line feed is deleted, the cursor will be  moved  up  one
line  on  the  screen.   If the line feed is part of a carriage return
line feed sequence, and the carriage return is then deleted, TECO will
re-type  the  line  (hopefully  in  the same place on the screen), and
leave the cursor positioned at the end of the line.  If TECO does  not
know  what type of terminal is being used (or does not know about that
type of terminal), each character being deleted will  be  printed  out
when  the  delete  key is struck.  Unlike the monitors response to the
delete key on this type of terminal, TECO will not  print  backslashes
("") as delimiters around the text that is being deleted.



4.2.2  Backspace (Control H)

The backspace key (or control-H) may be used to delete  characters  in
exactly  the  same way as the delete key.  The only difference between
using the delete key and using the backspace key occurs  in  non-video
mode  when  using  a  terminal  which  TECO  does  not know is a video
terminal.  In this case, backspace will attempt to erase the character
being deleted from the screen.


                              ** Note **

               If TECO is told that the terminal  is  a
               "TTY"   (using  the  EV  command),  then
               backspaces are not  treated  as  editing
               characters.   Instead  they  are entered
               into the command string  just  like  any
               other non-editing character.





4.2.3  Control U

The control-U character is used to delete an  entire  line  on  input.
When  a  control-U  is  typed,  all input back to the last end of line
(carriage return line feed,  vertical  tab,  or  form  feed)  will  be
deleted.
COMMAND LINES                                                 Page 4-3
Editing command lines                                        23 Jun 82


In video mode, if a control-U is typed at the start of a line, it will
delete  the  previous  end of line sequence and the previous line.  In
non-video mode, a control-U at the start of a line has no effect.

In video mode, the text which is deleted  by  the  control-U  will  be
erased  from the screen, and the cursor positioned at the start of the
current line.

In non-video mode,  if  TECO  knows  that  the  terminal  is  a  video
terminal,  it  will  erase the text being deleted from the screen.  On
non-video terminals, and certain video terminals which do not  have  a
feature  to  make  it reasonable for TECO to erase the text, TECO will
type out ^U at the end of the line being deleted and type  a  carriage
return line feed to position the terminal to a new line.



4.2.4  Control W

The control-W character is used to delete  the  last  word  typed  in.
This  is  identical  to  the use of the control-W character in editing
monitor commands.  After the  control-W  is  used,  the  text  on  the
terminal  will  appear  just  as  if  an  equivalent  number of delete
characters had been typed.



4.2.5  Control G

4.3  Immeditate commands

4.3.1  Non-video mode

4.3.2  Video mode












                              CHAPTER 5

                 INSERT STRINGS AND STRING ARGUMENTS



The most basic function of text editing  programs  is  inserting  text
into  a  file.  There are several ways of accomplishing this, however,
the I command is the easiest and the most useful.



5.1  Insert strings

The basic format of the insert command is:

          Itext$

where "text" is the text to be inserted.  This is all that  is  needed
so  long  as  the  text  does not contain any control characters other
than:  backspace (^H), horizontal tab (^I), line feed  (^J),  vertical
tab  (^K),  form feed (^L), or carriage return (^M).  Escapes are used
for the purpose of terminated a normal insert  string,  and  therefore
cannot  be  used  within  the  string  without  special  handling (see
delimited  mode  insert  and  insert  subcommand  ^R).   The   control
characters  other  than  these  are  either currently special commands
within the insert string, or are reserved for future  use  as  special
commands.   Those  that  are currently special commands are documented
below.



5.1.1  Insert subcommands

The control characters other than the  normal  motion  characters  are
used for special commands within insert strings.



5.1.1.1  ^A and ^V subcommands

These subcommands (along with ^B and ^W) are used to convert the  case
of  the  text  that follows.  When a single ^A or ^V is encountered in
the insert string, the following character, if  it  is  an  alphabetic
character,  is  converted to lower case.  When two consecutive ^A's or
^V's are encountered, the lower case lock is set, i.e., all subsequent
INSERT STRINGS AND STRING ARGUMENTS                           Page 5-2
Insert strings                                               23 Jun 82


alphabetic characters are converted to lower case.



5.1.1.2  ^B and ^W subcommands

These subcommands are the upper case equivalents  of  ^A  and  ^V.   A
single ^B or ^W will cause the next character to be converted to upper
case (if it is a lower case alphabetic).  Two consecutive ^B's or ^W's
will set the upper case lock.



5.1.1.3  ^G subcommand

This subcommand is used to insert the contents of a Q-register in  the
current position in the insert string.  The formats of this subcommand
are:
     ^Gi
or
     ^G(q-register)
where "i" is any single character Q-register name, and "q-register" is
any  Q-register  name.   Note  that  the  text  in  the  Q-register is
processed just like the rest of the text in the  insert  command  with
one exception:  If the terminating character appears, it is treated as
a normal character.  This means that subcommands are processed even if
the  text is coming from a Q-register, and case conversion is done (if
the upper or lower case lock is set).  This can be a  convienient  way
to  up-case  or  down-case  all the text in a given Q-register.  Also,
since the ^G subcommand is valid with the Q-register text, the text in
the Q-register may specify the inclusion of yet another Q-register.



5.1.1.4  ^R subcommand

This subcommand is used (just like in command input) to quote the next
character.   This  character  will  cause  the  next character to next
character to be inserted without checking if  it  is  the  terminating
character or if it is a subcommand character.



5.1.1.5  ^T subcommand

This subcommand is used to toggle a flag to indicate  whether  any  of
the  other subcommands (except ^R) are to be treated as commands or as
normal text characters.  At the beginning of each  insert  string  the
flag  is  set to treat the subcommand characters as subcommands.  Note
that this subcommand (like the others) must be entered  as  a  control
character,  not  as up-arrow ("^") character.  This can cause problems
since TOPS-10 and the  TOPS-20  EXEC  use  ^T  as  a  special  command
character  themselves.   Under  TOPS-10,  doing  the  monitor  command
"TERMINAL RTCOMP" will cause the monitor to pass ^T's  to  TECO  as  a
INSERT STRINGS AND STRING ARGUMENTS                           Page 5-3
Insert strings                                               23 Jun 82


character instead of doing a "USESTAT" command.



5.1.1.6  ^^ subcommand

This subcommand is used to convert the following  character  into  its
lower case range equivalent.  The following conversions are done:

     "@" => "`"
     "[" => "{"
     "\" => "|"
     "]" => "}"
     "^" => "~"
     "_" => DELETE

This subcommand has no effect on any other characters,  and  does  not
affect the setting of the case lock.



5.1.2  Delimited insert command

At times it is desirable to have  some  character  other  than  escape
terminate  the  insert  string.   This  is  particularly  useful  when
inserting TECO commands, or any other text that contains a  number  of
escapes.   This  can  be done by prefixing the insert command with the
character "@".  The format  of  the  delimited  insert  command  which
results is:

     @I<delim>text<delim>

where  "<delim>"  is  any  character  which  will  be  the  delimiting
character for "text", the insert string.



5.2  String arguments

String arguments are used for immediate input of text to  be  used  by
commands which take strings for arguments.  (Examples of such commands
are "U", and "=".) The format of a string argument is:

i+5;{text}

where "text" is  an  insert  string  format  string.   Note  that  all
characters  valid  within  an  insert string are valid within a string
argument, except that to include  a  "}",  it  must  be  quoted  by  a
control-R (^R).











                              CHAPTER 6

                              SEARCHING



TECO contains a sophisticated method  of  searching  for  a  specified
string  and moving the pointer to that position.  Search commands will
scan through the text until  the  specified  string  given  matches  a
string of characters.



6.1  Search strings

A search string is a string of characters that are to be found in  the
current  editing  buffer.   This  string  can  contain a maximum of 36
characters.



6.1.1  Simple search string

A simple search string is one that does not contain any of the special
characters.  That is it would contain only alphanumeric characters.



6.1.2  Special character(s)

The special characters that are described in this section are used  to
represent  logical  groups  of characters.  A logical group may be any
numeric character (eg.  0,1,2,3,4,5,6,7,8,9), so that you could search
for  string  which contains any numeric character in a single position
(eg.  "ab0", "ab1", "ab2", ..., "ab9").



6.1.2.1  ^G (Control G)

SEARCHING                                                     Page 6-2
Search strings                                               23 Jun 82


6.1.2.2  ^E (Control E)

6.1.2.2.1  ^EA

6.1.2.2.2  ^EV

6.1.2.2.3  ^EW

6.1.2.2.4  ^ED

6.1.2.2.5  ^EL

6.1.2.2.6  ^ES

6.1.2.2.7  ^E<

6.1.2.2.8  ^E[

6.1.2.3  ^X (Control X)

6.1.2.4  ^N (Control N)

6.1.2.5  ^S (Control S)

6.1.2.6  ^A (Control A)

6.1.2.7  ^B (Control B)

6.1.2.8  ^V (Control V)

6.1.2.9  ^W (Control W)

6.1.2.10  ^\ (Control backslash)

6.1.2.11  ^^ (Control circumflex)

6.1.2.12  ^T (Control T)

6.1.2.13  ^Q (Control Q)

6.1.2.14  ^R (Control R)

6.1.2.15  $ (Escape)

6.2  Normal

The normal search command do not change the text in any  manner,  they
only  position the pointer at the string that is found.  There are two
different types of normal search strings;  one that will  search  only
the  current  buffer and one that will page through the file until the
string is found.
SEARCHING                                                     Page 6-3
Normal                                                       23 Jun 82


6.2.1  S command

6.2.2  N command

6.3  Substitution

6.3.1  FS command

6.3.2  FN command

6.4  Word

6.4.1  FW command

6.5  Deleting

6.5.1  FK command

6.5.2  FD command

6.5.3  _ command

6.6  Bounded












                              CHAPTER 7

                             Q-REGISTERS



7.1  Introduction

A Q-register is a temporary,  named,  data  storage  location.   These
Q-register  names  may be a single character or a long Q-register name
delimited by parentheses.  Note that  a  single  character  Q-register
name  may  optionally be enclosed by parentheses, but denotes the same
register.  Due to the nature of TECO, references to  single  character
Q-registers are slightly quicker than long Q-register names.  The data
contained in Q-registers will be one of  three  possible  data  types:
Textual, numeric, or a "saved" FC command table.

For text storage, a Q-register can be used to hold  character  strings
of  any  length,  and  may have input and output files associated with
them.  The text in a Q-register can be used in several different ways.
Storing  text  in  a Q-register is useful for functions such as making
many copies of a given segment  of  text  throughout  a  file  without
retyping it each time, for moving a block of text from one position to
another in a file, and for moving a block of  text  to  another  file.
Another  use is to save text that is frequently used as TECO commands,
that will later be invoked by an "M" or "W"  command,  or  to  hold  a
string argument for another command.

For numeric storage, a Q-register can be used to hold a single  signed
integer  number  in  the  range  -2**35 to 2**35-1.  Numbers stored in
Q-registers  can  be  incremented,  tested,   or   recalled.    Hence,
Q-registers  can  be  used  as  switches  and counters, as well as for
simple data-save functions.



7.2  Single character

Single character Q-register names are A-Z, 0-9, *, and %.
Q-REGISTERS                                                   Page 7-2
Multiple character                                           23 Jun 82


7.3  Multiple character

Multiple character Q-register names may be used in the same places  as
single   character   Q-register  names.   Long  Q-register  names  are
delimited by parenthesis, and all characters, except a ")" may be used
in  their  name,  even  escapes  are allowed.  The names of Q-register
names are actually processed in the same fashion as string  arguments.
This  implies that ^A and ^B (or ^V and ^W) may be used to control the
upper and lower casing of the  names.   Additionally,  other  commands
such  as  ^G,  ^R,  ^T,  etc.  are useful.  For example, the ^G<single
character Q-register name>$ capability may  be  used  to  reference  a
Q-register  indirectly,  where  the  single  character Q-register will
contain the name of a long Q-register name.

Examples:
     3X(Long Q-register name)
     M(^GAroutine)  ;If  A  contains  "check",   then   the   complete
                    Q-register name is "checkroutine"



7.4  Predefined Q-registers

TECO contains several predefined Q-registers.  These  Q-registers  are
used  for special purpose items.  These items range from a Q-registers
that gets executed every n commands to a Q-register that contains  the
text of the commands that are being typed in to TECO.



7.4.1  AUTO-COMMAND

This Q-register  contains  commands  that  are  executed  after  every
'AUTO-COUNT' commands.



7.4.2  AUTO-COUNT

The number contained by AUTO-COUNT is the number of complete  commands
that  are to be processed before the 'AUTO-BUFFER' Q-register is to be
executed.  This number must be greater than zero for 'AUTO-BUFFER'  to
be  executed.   A complete command is any command that terminates with
two escape characters.



7.4.3  COMMAND-BUFFER

This Q-register, which is also only needed by the E$ command,  is  the
predefined  name  for  the  section of the screen where typein will be
echoed, and typeout printed.
Q-REGISTERS                                                   Page 7-3
Predefined Q-registers                                       23 Jun 82


7.4.4  COMMAND-PROMPT

This Q-register contains the prompt text that TECO uses to prompt  the
user.   It  can be changed to contain an arbitrary text string, or the
decimal value of an ASCII character.



7.4.5  CONTROL-C-INTERCEPT-COMMAND

The TECO commands in this Q-register will only be executed if the user
types  a  ^C.  Note that this is different from a ^C command appearing
as part of a TECO command.  If no command which causes TECO to exit is
used in this Q-register, TECO will NOT return to monitor.  For safety,
several rapid ^Cs will always exit.  No command used here  will  cause
EXIT-COMMAND  to  be  executed.   An  example,  which  also happens to
illustrate a use of the ^C (up-arrow C) command is:

^A[Monitor]^A ^C ^A[TECO]^A

When a ^C is typed on the keyboard, [Monitor] is printed  before  TECO
exits.   If  the  user then types the monitor command CONTINUE, [TECO]
will now be printed before TECO continues from where it was originally
interrupted.



7.4.6  ERROR-TEXT

This Q-register will contain the  complete  text  of  the  last  error
message.   Note that when TECO is in video mode (EVON$ command given),
and this Q-register is displayed, TECO will not print  out  the  error
message in the 'COMMAND-BUFFER' section.



7.4.7  EXIT-COMMAND

The TECO commands stored in this  Q-register  will  be  executed  just
before  TECO returns to monitor except if TECO is returning to monitor
through a command  in  Q-register  CONTROL-C-INTERCEPT-COMMAND.   This
feature  may  be  used, for example, to set terminal parameters before
exiting.



7.4.8  TERMINAL-INPUT-BUFFER

This Q-register contains text that has been read from the terminal but
not  yet  processed  by  TECO.   All  characters  which  are  in  this
Q-register will be read  into  the  command  buffer  or  processed  as
immediate  commands  the next time TECO returns to command level.  The
contents of this Q-register are  normally  indeterminate,  unless  the
peek-ahead form of the control-T command has been used.
Q-REGISTERS                                                   Page 7-4
Predefined Q-registers                                       23 Jun 82


7.4.9  TEXT-BUFFER

This Q-register is used only for purposes of the E$ command.  This  is
a predefined name that always refers to the current editing buffer.



7.4.10  Question mark ("?")

This Q-register contains the last command in error.  This  allows  the
user to still obtain the command in error if they forgot to star ("*")
the erroneous command into a Q-register for later.



7.4.11  Period (".")

The normal editing buffer is preconnected to the "." Q-register.



7.4.12  Asterisk ("*")

This Q-register is used  as  the  default  register  for  reading  and
writing  of  files with the EP, EQ, and EI commands.  If only the file
specification is given for these commands than the asterisk Q-register
will be used for the command.











                              CHAPTER 8

                             EXPRESSIONS



8.1  Introduction

Expressions in TECO do not follow the  normal  rules  for  evaluation.
That  is the expression 2+1*3 does not have the same result in FORTRAN
as it does in TECO.  This chapter will explain how expressions in TECO
differ  from those found in the normal programming languages (FORTRAN,
BASIC, etc.).



8.2  Evaluation

Expressions are evaluated from left to right in  TECO.   That  is  the
expression   2+1*3   will   first   do   the  addition  and  then  the
multiplication.  The result of this expression is 9, while programming
languages  like  FORTRAN  would  produce the result of 5.  If the user
wishes to override the normal evaluation  the  user  can  enclose  the
expression  in  parentheses that is to be evaluated first.  An example
of this is the expression 2+(1*3) will cause the 1*3 to  be  evaluated
first then 2 will be added to the result of the multiplication.



8.3  Operators

TECO  contains  the  normal  addition,   subtraction,   division   and
multiplication  operators.   Additionally it has operators for logical
AND and logical OR.  An operator may appear between any two values.


                                BEWARE

               A common user error is to have  a  unary
               minus after some command that returned a
               value.  That is a command that  returned
               either a true or false value.  TECO will
               cause the minus to become a  subtraction
               instead of the unary operator because of
               the returned value.
EXPRESSIONS                                                   Page 8-2
Operators                                                    23 Jun 82


8.3.1  Addition

The addition operator in TECO is the plus  sign,  "+".   The  operator
must appear between two values.



8.3.2  Unary plus

The unary plus operator in TECO is the plus sign, "+".   The  operator
must appear before a single value to be considered the unary operator.



8.3.3  Subtraction

The subtraction operator in TECO is the minus sign, "-".  The operator
appears  between  two  values.   If the operator is before an operator
then it is not a subtraction operator, but the unary minus operator.



8.3.4  Unary minus

8.3.5  Division

8.3.6  Multiplication

8.3.7  Logical AND

8.3.8  Logical OR

8.3.9  Parentheses

8.4  Values

8.4.1  Numerics

8.4.1.1  Decimal

8.4.1.2  Octal

8.4.2  Strings

8.4.3  Q-registers












                              CHAPTER 9

                            VIDEO EDITING



9.1  Introduction

TECO has the facility for displaying  a  portion  of  the  text  being
edited  on  the screen of a video terminal and updating the display as
commands are being  executed.   This  mode  makes  it  unnecessary  to
explicitly have TECO type out text to verify where one is in the text,
or what changes have been made.  All commands are typed the  same  way
in video mode as they are while not in video mode, the only difference
is the display.

In video display mode, TECO will  normally  display  text  around  the
pointer,  which  will  be  represented  on  the  screen by the cursor.
Therefore  the  character  the  cursor  is  positioned  under  is  the
character  position  just  after the pointer.  If the pointer is moved
outside the bounds of the displayed text, a different portion  of  the
file  will  be  displayed.  Several "immediate" commands are available
for moving the pointer with a minimal amount of typing.

To enter video mode, TECO must be told on which lines of the screen to
display the text, and where to display the commands from the terminal.
Special commands and Q-registers are provided for this purpose.



9.2  Video mode editing

The video mode editing is entered by a combination of the  E$  and  EV
commands.   The  E$  command  is  used  to define a what Q-register to
display on what lines on the screen, while the EV command is  used  to
turn  on/off  the  video processing to and define the type of terminal
that is being used.



9.2.1  E$ Command

The E$ command defines the lines that a Q-register will  be  displayed
on.  The format of the command is:

     *n,mE$(Q-reg)$
VIDEO EDITING                                                 Page 9-2
Video mode editing                                           23 Jun 82


The n and m arguments are numeric  arguments  that  specify  the  line
numbers  that the Q-register is to be displayed on.  The Q-register is
the item that is enclosed in the parens  after  the  E$  command.   An
example of the E$ command would be:

     *1,19E$(TEXT-BUFFER)$20,24E$(COMMAND-BUFFER)$$

This command would cause the text buffer to be displayed on the  first
through  the  nineteenth  line.   The  command  buffer  would  then be
displayed on the 20th through 24th lines.



9.2.2  EV

The EV command is used to  specify  either  a  video  parameter  or  a
terminal  type.   The  terminal  types that are currently supported in
TECO are:

Type                Comment

TTY                 Hardcopy terminal.

CRT                 CRT terminal  that  is  currently  not  supported.
                    Deletes  will  cause  the cursor to be backed up a
                    space output to clear the 'deleted' character.

ACT4                ACT4 terminal.  No full video support.

ACT5                ACT5 terminal.  No full video support.

ADD580              ADDS 580 terminal.  No full video support.

ADM2                Lear  Sigler  ADM-2  terminal.   No   full   video
                    support.

ADM3                Lear  Sigler  ADM-3  terminal.   No   full   video
                    support.

ADM3A               Lear Sigler ADM-3A terminal.  Full video support.

BEE                 Beehive terminals.

CDC                 CDC terminal (?).

DM1520              Datamedia 1520 and 1520A  terminals.   Full  video
                    support.

DPT                 Datapoint terminal.  No full video support.

H19                 Heathkit H19 terminal.  Full video support.

H19A                Heathkit H19 terminal in ANSI  mode.   Full  video
                    support.
VIDEO EDITING                                                 Page 9-3
Video mode editing                                           23 Jun 82


H1200               Hazeltine 1200.

H1500               Hazeltine 1500.

H1420               Hazeltine 1420.

H2000               Hazeltine 2000.

HMOD1               Hazeltine Modular I.

HMOD1I              Hazeltine Modular I with insert/delete line.

HP2621              HP 2621.

HP2640              HP 2640.

HP2648              HP 2648.

RGNT25              ADDS Regent 25.

TELRAY              Teleray terminals

TELVID              Televideo terminals

TK4025              Tektronics 4025 terminal.

VT05                Digital Equipment Corporation VT05 terminal.

VT100               Digital Equipment Corporation VT100 terminal.

VT132               Digital Equipment Corporation VT132 terminal.

VT50                Digital Equipment Corporation VT50 terminal.

VT52                Digital Equipment Corporation VT52 terminal.

VT61                Digital Equipment Corporation VT61 terminal.


The video parameters that can be read or set with the EV command are:

Parameter           Comment

LINE                

MODE                

NODE                

OFF                 This keyword will turn the video mode editing off.
                    It is the inverse of the ON keyword.

ON                  This keyword will cause the video mode editing  to
                    be  turned on.  The E$ and EV<Terminal-type>$ will
VIDEO EDITING                                                 Page 9-4
Video mode editing                                           23 Jun 82


                    have no effect until the video editing is  'turned
                    on' with this keyword.

REFRESH             

SCREEN              

SCROLL              

TRMOP               

UPDATE              

WINDOW              











                              CHAPTER 10

                        IMMEDIATE MODE EDITING



10.1  Introduction

TECO contains a means of defining key strokes so  that  you  can  have
commands immediately execute upon them.  This is done by associating a
character string with the commands that are to be executed.



10.2  Immediate mode editing

Immediate mode editing is  controlled  by  the  FC  command.   The  FC
command  will allow you to define the immediate commands, delete them,
turn off and on the immediate mode, and save or restore  an  immediate
command table.  The format of the FC command is:

                       FC(Q-register)key word$

The Q-register may be required, optional or not allowed on the command
depending  on  which of the key words is specified.  If the Q-register
is specified then it will contain text which describes  the  immediate
commands.   The  key  word determines the exact function to perform on
the command table.

If an error occurs during the processing of an  FC  command  then  the
command is aborted.  When the command is aborted nothing is destroyed,
but left in the state it was before the command was started.



10.2.1  Concepts

The following descibes some the of basic concepts used  in  describing
the FC command and the FC command tables.
IMMEDIATE MODE EDITING                                       Page 10-2
Immediate mode editing                                       23 Jun 82


10.2.1.1  Command Table

Each set of immediate mode commands is  represented  by  an  immediate
mode  command table.  The command table is built from text supplied to
an FC command in a Q-register.  This text descibes the  strings  which
are  acceptable as immediate commands, and specifies what commands are
to be executed when the strings are typed on the terminal.



10.2.1.2  Command Table Interaction

Command tables can interact in one of two ways.  You can build  a  new
command  table  from  a  current  command table or you can build a new
command table after saving the current command table.

The first we consider to be overlaying a new command table on  top  of
the  current  command table.  This is accomplished by first creating a
copy of the current command table.  Then the new commands are inserted
into  this command table.  If there is a conflict an error message may
or may not be given depending on the key  word  specified  (INSERT  or
REPLACE).   The current command table is saved so that the new command
table can be removed at some later date.

The other interaction is saving the command tables on  a  stack.   The
initial command table and any command tables overlayed on that one are
considered to be the first item on the  stack.   The  current  command
table  can be pushed onto the stack and a new command table created as
the command table on the top of the stack.  The stacked command tables
may  be  removed from the stack by poping off the command table on the
top of the stack.  This is accomplished by the PUSH and POP key  words
for the FC command



10.2.1.3  Saving a command table

A command table can be saved  into  a  Q-register.   This  allows  the
editer  to  by  pass  the process of compiling a commonly used command
table again and again.



10.2.2  key words

The following describes each of the FC command key words.
IMMEDIATE MODE EDITING                                       Page 10-3
Immediate mode editing                                       23 Jun 82


10.2.2.1  PUSH

The PUSH key word will cause the current command table to be saved  on
the command table stack and optionally define a new command table.  If
a Q-register is given with this key word, the  current  command  table
will be saved and a new command table defined from the Q-register.  If
the Q-register contains a saved command table then the  command  table
is restored as the current command table.  If the Q-register contained
text it will then compile the text in the  Q-register  to  create  the
current  command  table.   If  the  Q-register  is not given, then the
current command table will be saved on the stack and a copy made of it
to remain as the current command table.



10.2.2.2  POP

The POP key word will cause the current command table to be  discarded
and restore the saved command table from the command table stack.



10.2.2.3  DELETE

The DELETE key word will cause commands to be deleted from the current
command  table.   The  Q-register  is  required  on  this  command and
contains a command table.  The immediate commands are matched to  ones
that are already defined and then deleted.  If a command is not in the
current command table then an error message will  be  issued  and  the
command is aborted.



10.2.2.4  INSERT

This INSERT key word will cause the immediate commands to be  inserted
into  the current command table.  An error will occur if the immediate
command being defined conflicts  with  a  currently  defined  command.
This key word requires the Q-register.



10.2.2.5  REPLACE

The REPLACE key word will work in the same manner as  the  INSERT  key
word,  except  that  it  will not give an error if there is a conflict
with a currently defined command.  This key  word  also  requires  the
Q-register.
IMMEDIATE MODE EDITING                                       Page 10-4
Immediate mode editing                                       23 Jun 82


10.2.2.6  OVERLAY

This key word will cause the current  command  table  to  have  a  new
command  table  overlayed  on  top of it.  That is the current command
table  will  be  copied,  the  the  new  commands  inserted  from  the
Q-register  that  must  be  specified in the command.  The old command
table is saved so that the user can restore it at some future point in
the editing.



10.2.2.7  REMOVE

The action that is taken on an the "FCREMOVE" command is to delete the
current  command  table and restore an the last command table that was
overlayed.  The FC command with the REMOVE key word does not accept  a
Q-register as part of the command syntax.



10.2.2.8  SAVE

The FC(Q-reg)SAVE$ command will cause the current command table to  be
saved  in the specified Q-register.  Only the current command table is
saved and an implied FCREMOVE$ command is executed.



10.2.2.9  RESTORE

The FC(Q-reg)RESTORE$ command will cause the command  table  saved  in
the  Q-register  by  the  FC(Q-reg)SAVE$ command to be restored as the
current command table.  The command table that was the current command
table on the execution of the command will be deleted.



10.2.2.10  RESET

This key word does not allow a Q-register  as  part  of  the  command.
This  key  word causes the FC data base to be reset to a virgin state.
This should be used if the current command tables  have  been  mangled
beyond repair.  TECO will not mangle the tables, but a programmer will
when implementing and debugging immediate commands.



10.2.2.11  OFF

This key word does not allow a Q-register as part of this FC  command.
The  key  word  will cause the immediate mode command processing to be
turned off.
IMMEDIATE MODE EDITING                                       Page 10-5
Immediate mode editing                                       23 Jun 82


10.2.2.12  ON

This key word does not allow a Q-register.  This key word  will  cause
the immediate mode command processing to be turned on.



10.2.3  Command table format

The text that is used to define a  command  table  consists  of  three
basic  parts;  Immediate command, command type and command to execute.
The format is:

     Immediate command :  Command type { Command to execute }

These three basic parts are  repeated  on  different  lines  for  each
command  that  is  to be defined.  A command table would look like the
following:

     Immediate command :  Command type { Command to execute }

     Immediate command :  Command type { Command to execute }




10.2.3.1  Immediate command

The immediate command consists of command terms seperated by  or  bars
("|")  or  just a command term.  If the terms are seperated by the "|"
it means the command that is accepted is either the first term or  the
second  or  the  third and so on.  A command term consists of a set of
quoted strings and keywords separated by spaces.  Any  of  the  quoted
strings  or  keywords, except the last, may be followed by a plus sign
(+).  This indicates that  the  characters  allowed  in  the  previous
character  position  may  be repeated one or more times.  For example,
"1"+ "0" refers to a string consisting of any non-zero number of ones,
followed by a zero.


                              ** Note **

               The plus operator can only  be  used  to
               repeat   one   character  position.   It
               cannot  be  used  to  indicate  that   a
               complete  string  can be repeated one or
               more  times.   This  is   due   to   the
               complexity  involved in building a table
               from a set or strings of this type.


IMMEDIATE MODE EDITING                                       Page 10-6
Immediate mode editing                                       23 Jun 82


10.2.3.1.1  Quoted string

A quoted string is one or more characters inclosed in double quotation
marks.   If  the  quoted  string is to contain a double quotation mark
then it is quoted by another double quotation mark (eg.  a  string  of
just a double quotation mark is """").



10.2.3.1.2  NULL

The NULL key word is a way to specify the charcter with the  value  of
zero.  This keyword is included since often nulls will be removed from
ASCII text, making a table which actually included a null unreliable.



10.2.3.1.3  DELETE

The DELETE key word represents the character having  the  octal  value
177.



10.2.3.1.4  DECIMAL

DECIMAL represents the characters "0" through "9".   This  allows  the
command table entry:

     DECIMAL "A" :  TECO { .....  }

to be the same as:

     "0A" | "1A" | "2A" | "3A" | "4A" | "5A" | "6A" |
     "7A" | "8A" | "9A" :  TECO { .....  }




10.2.3.1.5  DIGIT

DIGIT is a synonym for DECIMAL.



10.2.3.1.6  OCTAL

OCTAL represents the characters "0" through "7"  in  the  same  manner
that DECIMAL represents "0" through "9".
IMMEDIATE MODE EDITING                                       Page 10-7
Immediate mode editing                                       23 Jun 82


10.2.3.1.7  ALPHABETIC

ALPHABETIC represents the characters "A" to "Z"  and  the  lower  case
characters  "a"  to "z".  The ALPHABETIC keyword functions in the same
manner that OCTAL and DECIMAL do.



10.2.3.1.8  ALPHANUMERIC

ALPHANUMERIC is a union of the ALPHABETIC digit keywords.  That is  it
allows "A" to "Z", "0" to "9" and "a" to "z".



10.2.3.1.9  ANY

The ANY keyword allows specification of a number of characters  to  be
specified for a single character position.  ANY takes a list of quoted
characters or octal values enclosed in parentheses as an argument.

Example:

          ANY:("A",1,"a")

This would allow both upper and lower  case  A  and  control-A  to  be
accepted in the character position.



10.2.3.1.10  VALUE

The VALUE keyword allows specification of a single character or string
of characters by giving their octal value.  The VALUE keyword may take
a single argument, or a list of octal values in parentheses.

Examples:

          VALUE:100

          VALUE:(100,101,102,60)

The VALUE keyword is useful in specifying control characters.



10.2.3.1.11  RANGE

RANGE allows you to specify a range of items.  The first items is  the
lower  bounds  of the range and the second item is the upper bounds of
the range.  The items can be either a quoted  cahracter  or  an  octal
number seperated by a colon.  An example of this is:  RANGE:40:45.
IMMEDIATE MODE EDITING                                       Page 10-8
Immediate mode editing                                       23 Jun 82


10.2.3.1.12  OTHER

The commands in the to be executed part will be executed if  no  other
immediate commands match the charcter(s) that were input.



10.2.3.1.13  ALWAYS

This will cause the commands to be executed to be always executed when
an immediate command is processed.



10.2.3.2  Command type

The command type part of the command table  definition  specifies  the
type of commands that are to be executed.  These commands could be one
of three types of immediate commands, or TECO commands.  The different
types  of immediate commands specify different command tables that the
command should be mapped through.

The command type is optional in the command table definition.  If  the
command  type  is  left  off  then  the  default will be to assume the
commands are normal TECO commands or that the command type is TECO.



10.2.3.2.1  BASE

The BASE command type specifies that  the  commands  that  are  to  be
executed  are immediate commands.  The commands will be mapped through
the first command table that was defined or  the  base  command  table
upon which all others are built.



10.2.3.2.2  IMMEDIATE

The IMMEDIATE command type specifies that the commands  are  immediate
commands and they are to be mapped through the current command table.



10.2.3.2.3  TECO

The TECO command  type  specifies  that  the  commands  that  will  be
executed are normal TECO commands.
IMMEDIATE MODE EDITING                                       Page 10-9
Immediate mode editing                                       23 Jun 82


10.2.3.2.4  PREVIOUS

This command type indicates the command to execute is  mapped  through
the last command table that was overlayed.



10.2.3.3  Command to execute

The command to execute is text that is enclosed in braces ("{}").  The
string  that  caused  the  command  to  executed to passed as a string
argument to the command.  That is if the immediate command  Control  X
Control  A caused a command to execute a string argument of ^X^A would
be passed to the command.



10.2.3.4  Examples

The first example will define a very simple set of commands.  The only
commands that will be legal are:

     1.  Control Z - Exit from TECO.

     2.  RUBOUT - Delete the previous character

     3.  All others - Insert them.



     {^Z} :  TECO {$EX}
     DELETE :  TECO {$-1D}
     OTHER :  TECO {I}



The second example will define a command table  that  will  cause  the
function keys on a VT-100 to do the correct positioning.

     1.  Up arrow key generates - $[A

     2.  Down arrow key generates - $[B

     3.  Left arrow key generates - $[D

     4.  Right arrow key generates - $[C


     "$[A" :  TECO {$:-1D}
     "$[B" :  TECO {$:+1D}
     "$[C" :  TECO {$:+1C}
     "$[D" :  TECO {$:+1R}












                              CHAPTER 11

                                FLAGS



11.1  Introduction

TECO contains various flags.  These flags are either TECO wide or just
apply   to  an  individual  text  buffer.   This  chapter  contains  a
description  of  all  the  flags  that  TECO  contains  and   has   an
explaination of how they work.



11.2  Case Conversion

The case conversion flag indicates to TECO whether text input from the
terminal  should be converted to upper case, to lower case, or left in
the case that was typed.  This is  mainly  useful  on  terminals  that
cannot  generate  lower case, or in cases where all text is desired to
be in either upper or lower case.  This flag is TECO wide and  is  set
by  the control-V and control-W commands.  A control-V command with no
argument set the case conversion flag to convert all text  input  from
the  terminal  to  lower case.  The control-W command with no argument
sets the flag to convert all text typed on the terminal to upper case.
Either  control-V or control-W with an argument of 0 sets the flag for
no case conversion.  The case conversion flag may be overridden within
an  insert  string,  search  string,  or string argument by use of the
control-A (control-V) and control-B (control-W) subcommands.



11.3  Exact case match

The exact case match flag is used to determine whether upper and lower
case  alphabetic characters are to be considered the same or different
when performing searches or string comparisions.  This TECO wide  flag
is  set  or cleared by use of the control-X command.  A value of 0 for
the flag indicates that upper and lower  case  characters  are  to  be
considered  identical  when  searching  for  a string or comparing two
strings.  A non-zero value for the flag indicates the upper and  lower
case characters are to be considered different in these cases.
FLAGS                                                        Page 11-2
End of File                                                  23 Jun 82


11.4  End of File

The end of file flag is a per text buffer flag that indicates  whether
the  current  input  file is at end of file or not.  If the flag has a
value of 0, the current input file (if any) is not at end of file.  If
the flag has a non-zero value, the current input file is positioned at
its end.  The value of the flag may be  referenced  by  the  control-N
command.



11.5  Form feed

The form feed flag is set if the character that caused the A, P or  EY
command to stop reading data from the file was a form feed.  This flag
is on a per text buffer basis.  The value of this flag is zero (0)  if
the terminating character was not a form feed (L) and a minus one (-1)
if the terminating character was a form feed.  The value of  the  flag
is returned by the E (Control E) command.











                              CHAPTER 12

                           COMMAND SUMMARY



12.1  Control A (^A)

The ^A (Control A) command will cause the text  to  be  typed  on  the
users terminal.  The text will be terminated by another ^A, it can not
be terminated by the <Up-arrow>A form of ^A.

Command format:  ^Atext^A ;  Output the text between the control As.

Example(s):

     *^AText to be output^A$$   This will cause the text "Text  to  be
                    output" to be printed on the user's terminal.



Related command(s):  ET



12.2  Control C (^C)

The Control C (^C), in up arrow mode only, will cause TECO to exit  to
command  level.  After TECO has exited to command level it is possible
to continue TECO by the CONTINUE operating system command.  If you are
in  video  mode  the  terminal parameters will be restored before TECO
exits.  On the CONTINUE it will clear the screen and restart the video
mode processing.

It should be noted that if you do not CONTINUE the editing session all
editing  will  be  lost  for  files still associated with Q-registers.
Command format:

     ^C             ;  Stop the program

Example(s):

     *^C$$          Exit to the monitor
                         .  Or @ for TOPS-20
COMMAND SUMMARY                                              Page 12-2
Control C (^C)                                               23 Jun 82


Related command(s):  EX, Control Z (^Z)



12.3  Control D (^D)

The control D (^D) command will  move  the  pointer  up  or  down  the
specified  number  of  lines  as  displayed  on the CRT.  This doesn't
correspond to actual lines if the lines wrap around  on  the  display.
This  command  will take one argument, which is the number of lines to
move the cursor.   A  positive  argument  denotes  movement  down  the
editing buffer and a negative argument denotes movement up the editing
buffer.  If the argument is not present the command  will  default  to
one.

Command Format:

     n^D

Examples:

     *-5^D$$        Move the cursor up five lines

     *^D            Move the cursor down one line

     *10^D          Move the corsor down ten lines



Related command(s):  L



12.4  Control E (^E)

This command will return the value of the form feed  flag.   The  flag
will  be  set to a minus one if the last buffer input into the editing
buffer ended on a form feed character (^L).  The flag will be  set  to
zero  if  the last buffer input into the editing buffer was not a form
feed (^L, Control L).

Command format:

     ^E             ;  Return the value of the form feed flag

Examples:

     *^E$=$$        Return the form feed flag and print it out



Related command(s):  Control N (^N)
COMMAND SUMMARY                                              Page 12-3
Control F (^F)                                               23 Jun 82


12.5  Control F (^F)

This command will return one of two parameters.  If the Control F (^F)
is  given without any arguments it will return the value of the switch
register by doing a SWITCH UUO.  If  the  command  is  given  with  an
argument it assumes that the argument is a job number and it will do a
TRMNO. UUO to return the terminal UDX (Universal device index) for the
job.

Command formats:

     ^F             ;  Return the value of the switch register

     n^F            ;  Return the UDX for job n

Example(s):

     *^F$=$$        This will return the value of the switch register

     *5^F$=$$       This will return the UDX for job 5



Related command(s):  None



12.6  Control G (^G)

The Control G command will  return  various  items  depending  on  the
arguments  that are given it.  If the command is given no arguments it
will return the current job number.  If one argument is given then  it
will return the result of a PEEK UUO using the argument as the address
to peek on.  If two arguments are given it will do a GETTAB UUO  using
the two arguments as the table number and the item in the table.

Command format:

     ^G             ;  Return job number

     n^G            ;  Peek on location n

     n,m^G          ;  Return value of GETTAB table m item n

Examples:

     *^G=$$         Will type out the current job number

     *1000^G=$$     Will PEEK on location 1000 and type the contents

     *-1,2G==$$     Will type the user  project-programmer  number  in
                    octal.
COMMAND SUMMARY                                              Page 12-4
Control G (^G)                                               23 Jun 82


Related command(s):  None



12.7  Control H (^H)

This command will return the time of day in jiffies.   It  will  do  a
TIMER UUO.  The number of jiffies equals the ((hours * 24 + minutes) *
60 + seconds) * the frequency of your power (either 50 or 60).

Command format:

     ^H             ;  Return the time of day in jiffies.

Examples:

     *^H=$$         This will type the time of day in jiffies.



Releated command(s):  None



12.8  Control I (^I)

The Control (tab) is identical to the insert command  with  an  insert
string,  except  that  the  tab (Control I)) is treated as part of the
insert string.

Command format:  <Tab>Insert string$ ;  Insert the tab and string

Example:

     *      Text$$  Will insert "TAB>TEXT"


Releated command(s):  I



12.9  Control J (^J)

The Control J command does nothing.  This is  a  formatting  character
only.



12.10  Control L (^L)

The Control L command will cause a form feed to be typed on the user's
teminal  if  TECO is in non-video mode.  If TECO is in video mode then
the screen will be refreshed.
COMMAND SUMMARY                                              Page 12-5
Control L (^L)                                               23 Jun 82


Command format:

     ^L             ;  Refresh the screen or type a form feed

Examples:

     *EVON$$        ;  Turn of video processing
     *5l^L$$        ;  Advance 5 lines and force a refresh
     *EVOFF$$       ;  Turn off video processing

     *^L$$          Type a form feed



Related command(s):  EVREFRESH



12.11  Control M (^M)

The Control M command does nothing.  This is  a  formatting  character
only.



12.12  Control N (^N)

This command will return the value of the end of file flag.  The  flag
will  have the value of zero if there is no input file associated with
this text buffer or it is not at end of file.  The flag will return  a
minus one if we are at the end of file.

Command format:  ^N Return the value of the end of file flag

Example:

     *^N=$$         Type out the value of the EOF flag



Related command(s):  Control E (^E)



12.13  Control O (^O)

The Control O (^O) command will set the radix for the number following
the  ^O  to  be  octal.   This will allow octal number processing in a
command line.

Command format:

     ^On            ;  Treat n as an octal number
COMMAND SUMMARY                                              Page 12-6
Control O (^O)                                               23 Jun 82


Examples:

     *^O77=$$       Will print the octal number 77 as decimal



Related commands:  None



12.14  Control P (^P)

The ^P command will cause a scan ahead for a given page number in  the
file.   When  the command is given with no argument it will return the
current page number in the file.  The page is considered to end with a
form feed (^L).  This command is faster than the correct number of "P"
commands, and does not encounter any problems with pages in  the  file
which contain more characters than are normally read on a "P" command.

Command format:

     n^P            ;  Position to the nth page

     ^P             ;  Return the current page number

Examples:

     *^P=$$         Print the current page number

     *10^P$$        Position to page number 10



Related command(s):  Control Y (^Y), P



12.15  Control T (^T)

The command will do various terminal functions.  If the command has no
colon it will input a character from the terminal and return the ASCII
value of the character.  If the command has a colon modifier  and  the
argument  is  within the range of 0 to 17 it will to a TTCALL UUO.  If
the command is colon modified and the argument has a negative value it
will do a special TECO function.

Command format:

     ^T             ;  Input a single character and return  the  ASCII
value

     :+n^T          ;  Do a TTCALL N, UUO

     :m,+n^T        ;  Do a TTCALL N,[M]
COMMAND SUMMARY                                              Page 12-7
Control T (^T)                                               23 Jun 82


     :-n^T          ;  Do a special TECO function
The negative functions are:

-1      Clear echoing

-2      Set echoing

-3      Set packed image mode input

-4      Clear packed image mode input.

Examples:

     *:-3^T$$       This will set packed iamge mode input

     *T=$$          This will input one character.



Related command(s):



12.16  Control U (^U)

The Control U command will set the next block number to be read.  This
can  only  be  done for a file that has been ER'd.  This command takes
only one argument, which is the block number to USET to.

Command format:

     n^U            ;  Set the next block for input as n.

Examples:

     *10^U$$        Set the next block to be read as 10.



Related command(s):



12.17  Control V (^V)

The ^V (Control V) command will clear the case conversion flag or  set
the  case  conversion flag for lower case.  To set the case conversion
flag for lower case the ^V command is given  with  no  arguments.   To
clear the case conversion flag a 0^V command is given.

Examples:

     *^V$$          Set lower case conversion
COMMAND SUMMARY                                              Page 12-8
Control V (^V)                                               23 Jun 82


     *0^V$$         Clear the case conversion flag



Related command(s):  Control W (^W)



12.18  Control W (^W)

The ^W (Control W) command will clear the case conversion flag or  set
the  case  conversion flag for upper case.  To set the case conversion
flag for upper case the ^W command is given  with  no  arguments.   To
clear the case conversion flag a 0^W command is given.

Examples:

     *^W$$          Set upper case conversion

     *0^W$$         Clear the case conversion flag



Related command(s):  Control V (^V)



12.19  Control X (^X)

This command is used to determine whether the case of a letter  is  to
matter  in  a search.  If an argument is given it is used to set/clear
the exact match flag.  To set the exact match flag a non-zero argument
is  given  to  the  command.  An argument of zero will clear the exact
match flag.

If no argument is given the current value of the exact match flag will
be  returned.   If  the  flag  is  set  a  value  of minus one will be
returned, otherwise a value of zero is returned.

Command Format:

     n^X            Set/clear the exact match flag

     ^X             Return the exact match flag value

                    Examples:

     *5^X$$         Set the exact match flag

     *0^X$$         Clear the exact match flag

                         *^X$=$$        Print the value of  the  exact
                    match flag
COMMAND SUMMARY                                              Page 12-9
Control X (^X)                                               23 Jun 82


Related command(s):  None



12.20  Control Y (^Y)

The control-Y (^Y) will cause TECO to read forward in the  input  file
to a given page, without outputting any text.  This command is exactly
equivalent to the control-P (^P)  command,  except  that  no  text  is
output.

Command format:

     n^Y            ;  Read forward to page "n"

^Y=$$               ;  Return current page number and type it out


Examples:

     10^Y           Skip to page number 10



Related command(s):     Control-P (^P), EY, Y



12.21  Control Z (^Z)

The control-Z (^Z) command is used to  exit  from  TECO,  closing  all
output files, without outputting any text.

Command format:

     ^Z             ;  Exit from TECO

Examples:

     ^Z$$           Exit from TECO



Related command(s):  EX



12.22  Space

The space in TECO is treated the same as a addition operator (+).

Command format:

     n m            ;  Add n to m
COMMAND SUMMARY                                             Page 12-10
Space                                                        23 Jun 82


Examples:

     *123 234$$     ;  This will add 123 to 234



Related command(s):  Plus (+)



12.23  !

An exclamation point (!) is used to  start  the  beginning  of  a  tag
(label).   The  tag  continues up to the next exclamation point.  Tags
are used within TECO macros for transfers of control.  Another purpose
of  tags is as comments, since the text between the exclamation points
is not treated as commands.  Note that tags can contain any characters
except  exclamation  points.   Tags  can  be  as long as can be fit in
available memory.

Command format:

     !tag!          ;  Define a tag called "tag"

Examples:

     !This is the text of the tag!



Related command(s):  O



12.24  "

The  double  quote  command  is  used  for  conditional  execution  of
commands.  This command has three possible formats.  One format is for
checking a single value,  another  for  comparing  one  value  against
another and for comparing strings against each other.

If the condition is true then the TECO commands that  follow  the  the
condition  character  are  executed,  otherwise  TECO will scan to the
matching single quote.  The conditional will return  a  value  if  and
only  if  the  character following the single quote is a double quote.
This will allow you to check to see if the  condition  has  failed  or
succeeded,  i.e.,  whether  it executed the commands before the single
quote.  This makes it possible to construct an "IF...THEN...ELSE" type
conditional.

Command format(s):

     n"<Char> TECO-COMMANDS '
COMMAND SUMMARY                                             Page 12-11
"                                                            23 Jun 82


     n,m"<Char> TECO-COMMANDS '

     str,str"<Char> TECO-COMMANDS '

          The following is a list of the individual commands  the  the
          function that they perform.

Command             Purpose


"<                  Determine if a single argument is less than  zero.
          If two arguments then detemine if the first is less than the
          second argument.  If the arguments are  strings  then:   the
          shorter  of  the two strings is treated as if it were padded
          with spaces to the same length as the  longer  string;   the
          comparision is done on a character by character basis.

"L                  Determine if a single argument is less than  zero.
          If two arguments then detemine if the first is less than the
          second argument.  If the arguments are  strings  then:   the
          shorter  of  the two strings is treated as if it were padded
          with spaces to the same length as the  longer  string;   the
          comparision is done on a character by character basis.

"=                  Determine if a single argument is equal  to  zero.
          If  two arguments then detemine if the first is equal to the
          second argument.  If the arguments are  strings  then:   the
          shorter  of  the two strings is treated as if it were padded
          with spaces to the same length as the  longer  string;   the
          comparision is done on a character by character basis.

"E                  Determine if a single argument is equal  to  zero.
          If  two arguments then detemine if the first is equal to the
          second argument.  If the arguments are  strings  then:   the
          shorter  of  the two strings is treated as if it were padded
          with spaces to the same length as the  longer  string;   the
          comparision is done on a character by character basis.

"N                  Determine if a single argument  is  not  equal  to
          zero.   If  two  arguments then detemine if the first is not
          equal to the second argument.  If the arguments are  strings
          then:   the  shorter  of the two strings is treated as if it
          were padded with spaces to the same  length  as  the  longer
          string;  the comparision is done on a character by character
          basis.

">                  Determine if a single  argument  is  greater  than
          zero.   If  two  arguments  then  detemine  if  the first is
          greater than the second  argument.   If  the  arguments  are
          strings  then:  the shorter of the two strings is treated as
          if it were padded with spaces to  the  same  length  as  the
          longer  string;   the  comparision is done on a character by
          character basis.
COMMAND SUMMARY                                             Page 12-12
"                                                            23 Jun 82


"G                  Determine if a single  argument  is  greater  than
          zero.   If  two  arguments  then  detemine  if  the first is
          greater than the second  argument.   If  the  arguments  are
          strings  then:  the shorter of the two strings is treated as
          if it were padded with spaces to  the  same  length  as  the
          longer  string;   the  comparision is done on a character by
          character basis.

"A                  Alphabetic character value.  This form only  takes
          the single argument version of the command.

"V                  Lower case character value.  This form only  takes
          the single argument version of the command.

"W                  Upper case character value.  This form only  takes
          the single argument version of the command.

"C                  Symbolic (alphanumeric, dollar, percent or period)
          character  value.   This form only takes the single argument
          version of the command.

"D                  Digit (numeric) character value.  This  form  only
          takes the single argument version of the command.

"S                  Successful.   This  form  only  takes  the  single
          argument version of the command.

"U                  Unsuccessful.  This form  only  takes  the  single
          argument version of the command.

"T                  True.  This form only takes  the  single  argument
          version of the command.

"F                  False.  This form only takes the  single  argument
          version of the command.

Examples:

     *{A},{B}"L ^ALess than^A'$$        This will print the text 'Less
                    than' because the comparision is true.

     *0"G ^AWill fail^A'$$  This condition will  fail.   It  will  not
                    print any text.

     *^O61"D ^AWill succeed^A'$$        This text will succeed because
                    61 octal is the character value for a 1.



Related Commands:  None
COMMAND SUMMARY                                             Page 12-13
#                                                            23 Jun 82


12.25  #

The # operator is used to perform a logical or of the two operands.

Command format:

     n#m            ;  Logical or the values of n and m

Examples:

     1#2=$$         Or 1 with 2 and type out the result (3)



Related command(s):  +, -, *, /



12.26  %

The % command will add a value to a  Q-register  and  return  the  new
value.

Command format:

     %i             ;  Add one to Q-register i and return the value
n%i                 ;  Add n to Q-register i and return the value
%(q-reg)            ;  Add one to  Q-register  q-reg  and  return  the
value n%(q-reg)     ;  Add n to Q-register q-reg and return the value

Examples:

     %A=$$          Add one to Q-register A and type out the new value

     100%(FOOBAR)=  Add 100 to Q-register FOOBAR and type out the  new
                    value



Related command(s):  None



12.27  &

The & command will do a logical AND of the two operands specified.

Command format(s):

     n&m

Examples:

     *^O77&^O7$     Will produce a value of 7, since  77  octal  anded
COMMAND SUMMARY                                             Page 12-14
&                                                            23 Jun 82


                    with 7 octal is 7 octal.



Related Commands:  None



12.28  '

This command indicates the end of a  conditional  portion  of  a  TECO
command.  See the description of the double quote (") command.



Related Commands:  "



12.29  (

The open parenthesis command is the start of an expression.   See  the
chapter describing expressions.



Related Commands:  )



12.30  )

The close parenthesis command is the end of an  expression.   See  the
chapter describing expressions in TECO.



Related Commands:  (



12.31  * (multiply operator)

The "*" is used as the multiplication operator for expressions.

Command format(s):


Examples:



COMMAND SUMMARY                                             Page 12-15
* (multiply operator)                                        23 Jun 82


Related Commands:  None



12.32  + (plus operator)

The plus sign is either the addition or unary plus operator  in  TECO.
If  the  plus  sign  is  between  two  numeric  values  it is the plus
operator.  If the plus sign is before a value it is considered  to  be
the unary plus operator.

Command format(s):


Examples:




Related Commands:  None



12.33  ,

The comma is  used  as  a  separator  between  the  first  and  second
arguments for TECO commands which take two arguments.



12.34  -

The minus sign is the TECO subtraction or negation operator.  See  the
chapter on expressions.



12.35  .

The period command returns the value of the pointer  for  the  current
text buffer.  It is often used as an argument for other commands.

Example:

     .,ZK$$         kill text from current position to end of buffer



Related Commands:  None
COMMAND SUMMARY                                             Page 12-16
:                                                            23 Jun 82


12.36  :

The colon is used as a command modifier.  For certain commands it will
totally  change the effect of the command.  For most other commands it
will suppress any error message which might be output by  the  command
and  continue execution with the next TECO command.  With this purpose
of the colon, the command being modified will always return  a  value.
It  will either return a command dependant value (if the command would
return a value without the colon), or 0  to  indicate  that  an  error
occured or minus one to indicate that the command was successful.

Command format(s):


Examples:




Related Commands:  None



12.37  ;

Command format(s):


Examples:




Related Commands:  None



12.38  <

Command format(s):


Examples:




Related Commands:  None
COMMAND SUMMARY                                             Page 12-17
=                                                            23 Jun 82


12.39  =

Command format(s):


Examples:




Related Commands:  None



12.40  >

Command format(s):


Examples:




Related Commands:  None



12.41  /

Command format(s):


Examples:




Related Commands:  None



12.42  @

Command format(s):


Examples:



COMMAND SUMMARY                                             Page 12-18
@                                                            23 Jun 82


Related Commands:  None



12.43  A

There are a number for forms to the A command.  It  is  used  for  two
basic  functions:   appending  text from the input file to the buffer,
and returning the ASCII value of a given character in the buffer.

Command format(s):


Examples:




Related Commands:  None



12.44  B

Command format(s):


Examples:




Related Commands:  None



12.45  C

Command format(s):


Examples:




Related Commands:  None
COMMAND SUMMARY                                             Page 12-19
D                                                            23 Jun 82


12.46  D

Command format(s):


Examples:




Related Commands:  None



12.47  E.

Command format(s):


Examples:




Related Commands:  None



12.48  E$

Command format(s):


Examples:




Related Commands:  None



12.49  E<

Command format(s):


Examples:



COMMAND SUMMARY                                             Page 12-20
E<                                                           23 Jun 82


Related Commands:  None



12.50  E>

Command format(s):


Examples:




Related Commands:  None



12.51  E?

Command format(s):


Examples:




Related Commands:  None



12.51.1  CURRENT-TEXT-BUFFER

12.51.2  DISPLAY-LINES

12.51.3  INPUT-FILE

12.51.4  LAST-SEARCH-STRING-LENGTH

12.51.5  LEAVE-BLANK-LINE

12.51.6  OUTPUT-FILE

12.51.7  Q-DIRECTORY

COMMAND SUMMARY                                             Page 12-21
E?                                                           23 Jun 82


12.51.8  SCREEN-ADDRESS

12.51.9  TERMINAL-TYPE

12.52  EA

Command format(s):


Examples:




Related Commands:  None



12.53  EB

Command format(s):


Examples:




Related Commands:  None



12.54  EC

Command format(s):


Examples:




Related Commands:  None



12.55  ED

Command format(s):


Examples:

COMMAND SUMMARY                                             Page 12-22
ED                                                           23 Jun 82


Related Commands:  None



12.56  EE

Command format(s):


Examples:




Related Commands:  None



12.57  EF

Command format(s):


Examples:




Related Commands:  None



12.58  EG

Command format(s):


Examples:




Related Commands:  None



12.59  EH

Command format(s):


Examples:

COMMAND SUMMARY                                             Page 12-23
EH                                                           23 Jun 82


Related Commands:  None



12.60  EI

Command format(s):


Examples:




Related Commands:  None



12.61  EJ

Command format(s):


Examples:




Related Commands:  None



12.62  EK

Command format(s):


Examples:




Related Commands:  None



12.63  EL

Command format(s):


Examples:

COMMAND SUMMARY                                             Page 12-24
EL                                                           23 Jun 82


Related Commands:  None



12.64  EM

Command format(s):


Examples:




Related Commands:  None



12.65  EN

Command format(s):


Examples:




Related Commands:  None



12.66  EO

Command format(s):


Examples:




Related Commands:  None



12.67  EP

Command format(s):


Examples:

COMMAND SUMMARY                                             Page 12-25
EP                                                           23 Jun 82


Related Commands:  None



12.68  EQ

Command format(s):


Examples:




Related Commands:  None



12.69  ER

Command format(s):


Examples:




Related Commands:  None



12.70  ES

Command format(s):


Examples:




Related Commands:  None



12.71  ET

Command format(s):


Examples:

COMMAND SUMMARY                                             Page 12-26
ET                                                           23 Jun 82


Related Commands:  None



12.72  EU

Command format(s):


Examples:




Related Commands:  None



12.73  EV

Command format(s):


Examples:




Related Commands:  None



12.73.1  LINE

12.73.2  MODE

12.73.3  NODE

12.73.4  OFF

12.73.5  ON

12.73.6  REFRESH

12.73.7  SCREEN

COMMAND SUMMARY                                             Page 12-27
EV                                                           23 Jun 82


12.73.8  SCROLL

12.73.9  TRMOP

12.73.10  UPDATE

12.73.11  WINDOW

12.74  EW

Command format(s):


Examples:




Related Commands:  None



12.75  EX

Command format(s):


Examples:




Related Commands:  None



12.76  EY

Command format(s):


Examples:




Related Commands:  None
COMMAND SUMMARY                                             Page 12-28
EZ                                                           23 Jun 82


12.77  EZ

Command format(s):


Examples:




Related Commands:  None



12.78  FC

The FC command is used to manipulate immediate command tables.  The FC
command  is  used  to  defined,  delete  and modify these tables.  The
general format of the command is:

        FC(Q-register)key word$

For some of the key words the "(Q-register)" is optional, others it is
required  and  others  it  is  not  allowed.   The  description on the
individual key words will tell you which  of  the  key  words  require
what.



12.78.1  PUSH

12.78.2  POP

12.78.3  DELETE

12.78.4  INSERT

12.78.5  REPLACE

12.78.6  OVERLAY

12.78.7  REMOVE

12.78.8  SAVE

12.78.9  RESTORE

COMMAND SUMMARY                                             Page 12-29
FC                                                           23 Jun 82


12.78.10  RESET

12.78.11  OFF

12.78.12  ON

12.79  FD

Command format(s):


Examples:




Related Commands:  None



12.80  FI

Command format(s):


Examples:




Related Commands:  None



12.81  FK

Command format(s):


Examples:




Related Commands:  None



12.82  FN

Command format(s):

COMMAND SUMMARY                                             Page 12-30
FN                                                           23 Jun 82


Examples:




Related Commands:  None



12.83  FS

Command format(s):


Examples:




Related Commands:  None



12.84  G

Command format(s):


Examples:




Related Commands:  None



12.85  H

Command format(s):


Examples:




Related Commands:  None
COMMAND SUMMARY                                             Page 12-31
I                                                            23 Jun 82


12.86  I

Command format(s):


Examples:




Related Commands:  None



12.87  J

Command format(s):


Examples:




Related Commands:  None



12.88  K

Command format(s):


Examples:




Related Commands:  None



12.89  L

Command format(s):


Examples:



COMMAND SUMMARY                                             Page 12-32
L                                                            23 Jun 82


Related Commands:  None



12.90  M

Command format(s):


Examples:




Related Commands:  None



12.91  N

Command format(s):


Examples:




Related Commands:  None



12.92  O

Command format(s):


Examples:




Related Commands:  None



12.93  P

Command format(s):


Examples:

COMMAND SUMMARY                                             Page 12-33
P                                                            23 Jun 82


Related Commands:  None



12.94  Q

The Q command is used to return the value of the data in the specified
Q-register.   The  value can be either a string argument or a numeric.
The value in the Q-register is unchanged by the Q command.

Command format(s):

     QQ-reg

Examples:

     *QA=$$         This will type the value of the item in Q-register
                    A.

     *Q(FOO),{A}"E ... '    This will return the value  in  Q-register
                    FOO  and compare the value against the string "A".
                    This assumes the the contents of Q-register FOO is
                    a string, otherwise an error will occur.



Related commands:  None



12.95  R

The R command is used for moving the pointer in the text buffer.   The
R  command  is the complement of the C command.  That is the R command
takes one argument which will cause the pointer to be backed  up  that
many  characters.   If the argument is not present the default for the
command will be one.

Command format(s):  nR


Examples:

     *5R$$          This command will cause the pointer to  be  backed
                    up five characters.

     *-4R$$         This command will cause the pointer to be advanced
                    four  characters.   This  command is equivalent to
                    the command 4C.


COMMAND SUMMARY                                             Page 12-34
R                                                            23 Jun 82


Related commands:  C



12.96  S

The S command allows the user to search for an arbitrary  string  that
is  less  than  36  characters  in  length.   The string that is being
searched for or 'search string' can contain  special  characters  that
allow  the matching of various character groups (eg.  digits).  A full
description of the search faculity in TECO can be found in the chapter
on SEARCHING.

This search will stop at the first occurance of  the  string.   The  S
search  differs from the others in that it will stop searching for the
serch string at the end of the buffer.

Command format(s):

     nSsearch-string$

Examples:

     *SFOO$$        This will search for the first  occurance  of  the
                    string 'FOO'.

     *S.HL^ED$$     This will search for the first  occurance  of  the
                    string '.HL' followed by a digit.



Related Commands:  N, _, FD, FK



12.97  T

The T command is used to type  text  on  the  user's  terminal.   This
command  is  normally  only used in non-video mode.  It can be used in
video mode, but the text will be  typed  only  in  the  COMMAND-BUFFER
area.

This command has two formats.  One format is with one argument and the
other  is with two arguments.  The one argument version of the command
specifies the number of lines to type on the user's terminal.  The one
argument version will default to a one.

The two argument version specifies the  bounds  for  the  text  to  be
printed  from.  The first argument specifies the beginning of the text
to start printing from and the second specifies the  ending  character
address.
COMMAND SUMMARY                                             Page 12-35
T                                                            23 Jun 82


Command format(s):

     nT

     n,mT

Examples:

     *0LT$$         This will cause the pointer to  be  positioned  to
                    the beginning of the line and then the entire line
                    printed out.

     *HT$$          This will cause the entire contents of the editing
                    buffer to be printed out.

     *B,.T$$        This will cause the text buffer to be printed from
                    the start of the buffer to the current position of
                    point.



Related commands:  None



12.98  U

The U command is used for storing a  value  into  a  Q-register.   The
value  can  either  be  a  numeric  value  or  a string.  The value is
specified as the argument  to  the  command  as  the  Q-register  name
follows  the U.  If a second argument is given it is passed through to
the next command.

Command format(s):

     nUQ-reg$

     {String}UQ-reg$

Examples:

     *5UA$$         This will store the value 5 into Q-register A.

     *{Text}U(ONE)  This  will  store  the  text   "Text"   into   the
                    Q-register ONE.

     *5,10UAUB      This will store the value 10 into Q-register A and
                    the value 5 into Q-register B.



Related commands:  X, [
COMMAND SUMMARY                                             Page 12-36
V                                                            23 Jun 82


12.99  V

This command will do two different things.  If video mode  editing  is
on  the  command  will  cause the text on the screen to be moved up or
down.  If video mode is off then it will  two  a  specific  number  of
lines  before and after the pointer.  The format of the command is the
same for both editing modes.

In video mode this command will 'glitch'  the  screen  up  or  down  a
specific number of lines, or cause a character address to be frozen to
a specific line on the screen.  To cause the text on the screen to  be
moved  up  or  down  a  single  argument is given to the command which
specifies the number of lines to move the text.  If  the  argument  is
positive  then the text will be moved toward the top of the screen and
new text supplied from the bottom.  If the argument is  negative  then
the text will be moved to the bottom of the screen and new text filled
in on the top of the screen.

Giving  two  arguments  to  this  command  will  cause  the  specified
character  address  to  be  frozen  to  the specified line.  The first
argument is the line number and the second argument is  the  character
address.  The line number is relative to the section on the screen and
starts with line zero.

If the V command is used in non-video mode then a single  argument  is
valid.  The single argument is a numeric which specifies the number of
lines to view around point.  This command is similar  to  the  command
"-nT+nT" where "n" is the argument given to the V command.

Command format(s):

     nV             Glitch the screen or view around point.

     n,mV           Freeze a point on the screen.

Examples (Video mode):

     *5V$$          This will cause the screen to  be  moved  up  five
                    lines.

     *-3V$$         This will cause the screen to be moved down  three
                    lines.  New text will be filled in from top of the
                    screen.  *5,ZV$$    This will cause the end of the
                    ending  buffer  to  be frozen to the sixth line of
                    the section.

Examples (Non-video mode):

     *8V$$          This will cause the eight lines around point to be
                    viewed.  This command is equivalent to the command
                    "-8T+8T".


COMMAND SUMMARY                                             Page 12-37
V                                                            23 Jun 82


Related commands:  T



12.100  W

The W command will cause the  text  in  the  named  Q-register  to  be
executed.  This command is similar to the M command, except that the W
command will not continue executing commands after the W command  when
the  Q-register  finishes  execution  if  the  W  was  executed from a
Q-register.  The W command can be thought of  as  GOTO  the  specified
Q-register  and start execution, while the M command can be thought of
as a procedure call (eg.  FORTRAN CALL statement).  Any arguments that
are  present  before  the  command  are  passed  to  the TECO commands
executed in the Q-register.

Command format(s):

     WQ-reg

Examples:

     *WA$$          This will cause the A Q-register to be executed.

     *W(AUTO)$$     This  will  cause  the  Q-register  AUTO   to   be
                    executed.



Related commands:  M



12.101  X

The X command is used for placing text into  Q-registers.   There  are
two  forms  of  the  X command.  The first form of the command is with
either no arguments or one argument.  If no arguments are given it  is
assumed  that  one  argument is given with a value of one.  The single
argument form specifies the number of lines  to  be  placed  into  the
specified Q-register.

The other form of the command specifies the character  address  bounds
to be used to specify the first to the last charcter to be placed into
the Q-register.

Command formats:

     n,mX$$

     nX$$ The first format specifies the character bounds to be placed
into the Q-register, while the second specifies the number of lines to
be placed into the Q-register.
COMMAND SUMMARY                                             Page 12-38
X                                                            23 Jun 82


Examples:

     *3XA$$         This will place the current  and  next  two  lines
                    into the Q-register A.

     *B,.X(TEXT)    This will place the text from  the  start  of  the
                    buffer to the current position into the Q-register
                    named TEXT.



Related commands:  None



12.102  Y

The Y command is legal only from macros.  The Y command is the same as
the  EY  command.  The use of the Y command should be avoided whenever
possible.



Related commands:  EY



12.103  Z

The Z command will return the value of the last character position  in
the  current text buffer.  This allows the user to use this symbol for
the end of the buffer instead of having to determine what it is before
using  the  value.   This could be used in the case of deleting to the
end of the buffer, typing from the current position to the end, moving
to  the  end  of the buffer or insert text into a Q-register where the
end of the buffer is one of the bounds.

Command format:  Z

Example:

     *ZJ$$          This will cause the character address of the  last
                    character  to be given to the J command.  This has
                    the effect of causing the pointer to be positioned
                    after the last character in the buffer.

                    *.,ZK$$ Delete from the current  position  to  the
                    end of the buffer



Related command(s):  B, . and Z











                              CHAPTER 13

                                HINTS



All suggestions kindly accepted.



13.1  Introduction

This chapter contains little known features and general hints to  make
living with TECO easier and more efficient.

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!



13.2  TECO initialization

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$ EP(L)TED:LINE$  ^^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.
HINTS                                                        Page 13-2
Error recovery                                               23 Jun 82


13.3  Error recovery

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.   As  TECO  automatically  puts all bad commands into a
special Q-register named "?", one need only type "G?" to put a copy of
the  command  into  the  text  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
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.  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.

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.



13.4  Editting Techniques

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
HINTS                                                        Page 13-3
Editting Techniques                                          23 Jun 82


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.

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.

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 duplicate the contents of  q-register  i  into  q-register  j,  use
"[i]j".   If the Q-register contains text, for efficiency TECO doesn't
actually duplicate the text unnecessarily, it only copies pointers  to
the  text.   This has the obvious results that the two Q-registers are
"linked".  If you edit the text in one Q-register,  the  text  in  the
other  one will also change.  The two Q-registers become unlinked when
the text in one of them is discarded by  copying  new  text  into  the
Q-register(X command for example), or storing a numeric value into the
Q-register.

The X and U commands are also useful  for  disassociating  Q-registers
and  their  input/output  files.   This  causes  TECO  to  finish  the
EB(etc.), and close the files.  One can now use  the  same  Q-register
for another editting session.

<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 occurrences of text1 to be deleted,
since  the  two  adjacent  altmodes   will   terminate   the   command
prematurely.  The FK is used for this:  <fktext1$;>.  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.   The  ";"  command is used to terminate the infinite
repeat.  If you accidentally  forget  the  ";"  after  you  start  the
command  with  two escapes, TECO will loop forever.  You can terminate
this infinite loop with a ^C^C and then .REENTER sequence.
HINTS                                                        Page 13-4
Editting Techniques                                          23 Jun 82


The ^A (translate to lower case) and  ^B  (translate  to  upper  case)
commands are very powerful.  When used inside an insert or search text
argument, two successive ^A or ^B commands cause translation,  to  the
specified  case,  of  all following alphabetic characters in that text
argument.  A single ^A or ^B command causes translation  of  the  next
single  character  (if  it  is alphabetic) to the specified case.  The
single ^A or ^B in a text argument  takes  precedence  over  the  case
conversion mode defined by double ^A or ^B 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 ^A and ^B 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 ^B 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.

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 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.
HINTS                                                        Page 13-5
Video editting                                               23 Jun 82


13.5  Video editting

The command EVrefresh$ actually causes TECO to immediately  clear  the
screen,  the  associated  update  happens  normally  at the end of the
command.   If  you  want  to  exit  from  video  mode,   the   command
EVrefresh$EVoff$ will clear the screen, and turn video mode off.



13.6  Efficiency

Always try to use the FS command rather than a delete-insert sequence,
since fewer characters need to be shuffled around.

Single character Q-registers are faster than multi-character ones.



13.7  Miscellaneous

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.

A 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.

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>").

In order to insert or search for control characters, or an <ESC>, 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  (GG).
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).
HINTS                                                        Page 13-6
Miscellaneous                                                23 Jun 82


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.

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)
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 1P, 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 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.

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.

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.
INDEX                                                     Page Index-1
Miscellaneous                                                23 Jun 82


                                INDEX



Altmode, 13                          Control V (^V), 56 to 57
Argument                             Control W (^W), 57
  string arguments, 25               Control X (^X), 57
                                     Control Y (^Y), 58
Command                              Control Z (^Z), 51, 58
  !, 59                              Control-N (^N), 49
  ", 59                              Control-P, 58
  #, 62                              Control-P (^P), 58
  %, 62                              Control-T, 31
  &, 62                              D, 16 to 17, 68
  ', 63                              E$, 30, 32, 35, 68
  (, 63                              E., 68
  ), 63                              E<, 68
  *, 32, 62 to 63                    E>, 69
  +, 58, 62, 64                      E?, 69
  ,, 64                              EA, 70
  -, 62, 64                          EB, 70
  ., 64                              EC, 70
  /, 62, 66                          ED, 70
  :, 65                              EE, 71
  ;, 65                              EF, 71
  <, 65                              EG, 71
  =, 25, 66                          EH, 71
  >, 66                              EI, 32, 72
  @, 66                              EJ, 72
  [, 84                              EK, 72
  _, 28                              EL, 72
  A, 49, 67                          EM, 73
  B, 67                              EN, 73
  C, 14, 67, 82 to 83                EO, 73
  Control A (^A), 50                 EP, 32, 73
  Control C (^C), 18, 50             EQ, 32, 74
  Control D (^D), 51                 ER, 74
  Control E (^E), 49, 51, 54         ES, 74
  Control F (^F), 52                 ET, 74
  Control G (^G), 52                 EU, 75
  Control H (^H), 53                 EV, 35 to 36, 75
  Control I (^I), 15 to 16, 53         LINE, 75
  Control J (^J), 53                   MODE, 75
  Control L (^L), 53                   NODE, 75
  Control M (^M), 54                   OFF, 75
  Control N (^N), 51, 54               ON, 75
  Control O (^O), 54                   REFRESH, 54, 75
  Control P (^P), 55                   SCREEN, 75
  Control T (^T), 55                   SCROLL, 76
  Control U (^U), 56                   TRMOP, 76
INDEX                                                     Page Index-2
Miscellaneous                                                23 Jun 82


    UPDATE, 76                     E?
    WINDOW, 76                       CURRENT-TEXT-BUFFER, 69
  EW, 76                             DISPLAY-LINES, 69
  EX, 18, 51, 58, 76                 INPUT-FILE, 69
  EY, 49, 58, 76, 87                 LAST-SEARCH-STRING-LENGTH, 69
  EZ, 77                             LEAVE-BLANK-LINE, 69
  FC, 39, 77                         OUTPUT-FILE, 69
  FD, 28, 78                         Q-DIRECTORY, 69
  FI, 78                             SCREEN-ADDRESS, 70
  FK, 28, 78                         TERMINAL-TYPE, 70
  FN, 28, 78                       Escape, 13
  FS, 18, 28, 79                   Exiting TECO, 18
  FW, 28                               
  G, 79                            FC Command
  H, 79                              ALPHABETIC, 45
  I, 15 to 16, 23, 53, 80            ALPHANUMERIC, 45
  Insert, 23                         ANY, 45
  J, 15, 80                          DECIMAL, 44
  K, 16 to 17, 80                    DELETE, 44
  L, 14, 51, 80                      DIGIT, 44
  M, 81, 86                          NULL, 44
  N, 28, 81                          OCTAL, 44
  O, 59, 81                          Quoted string, 44
  P, 49, 55, 81                      VALUE, 45
  Q, 82                            FC Command Factor
  R, 82                              ALWAYS, 46
  S, 17, 28, 83                      OTHER, 46
  Space, 58                          RANGE, 45
  T, 16, 83, 85 to 86              FC Command Type
  U, 25, 84                          BASE, 46
  V, 85                              IMMEDIATE, 46
  W, 86                              PREVIOUS, 47
  X, 84, 86                          TECO, 46
  Y, 58, 87                        FC key words
  Z, 87                              DELETE, 41, 77
Commands                             INSERT, 40 to 41, 77
  ., 87                              OFF, 42, 78
  B, 87                              ON, 43, 78
  Control V (^V), 48                 OVERLAY, 42, 77
  Control W (^W), 48                 POP, 40 to 41, 77
  Control Y (^Y), 55                 PUSH, 40 to 41, 77
  Control-x (^X), 48                 REMOVE, 42, 77
  ER, 56                             REPLACE, 40 to 41, 77
  ET, 50                             RESET, 42, 78
  P, 55                              RESTORE, 42, 77
  Z, 87                              SAVE, 42, 77
                                   Flags
DECsystem-10, 9                      Case Conversion, 48, 56 to 57
DECSYSTEM-20, 9                      End of file, 49, 54
                                     EOF, 49, 54
INDEX                                                     Page Index-3
Miscellaneous                                                23 Jun 82


  Exact case match, 48               inserting text, 86
  Exact match, 57                    Long name, 30
  Form Feed, 49, 51, 54              TEXT-BUFFER, 31 to 32
                                       
Hints                              Replacing strings, 18
  Case conversion, 90                  
  Duplicating q-registers, 90      Saving the file, 18
  efficiency, 92                   Searching, 17
  EXit errors, 89                      
  MACRO arguments, 91              Tag, 59
  message level, 89                Terminal type
  Mistyped insert, 89                ACT4, 36
  q-reg stack, 92                    ACT5, 36
  Quoting characters, 92             ADD580, 36
  Re-using commands, 90              ADM2, 36
  Repeated replacement, 90           ADM3, 36
  search string length, 92           ADM3A, 36
  TECO macros, 93                    BEE, 36
  TECO.INI, 88                       CDC, 36
  Text buffers, 93                   CRT, 36
  Text movement, 89                  DM1520, 36
  Typing control chars, 92           DPT, 36
  Viewing q-registers, 90            H1200, 37
                                     H1420, 37
Immediate mode editing, 39           H1500, 37
                                     H19, 36
Label, 59                            H19A, 36
                                     H2000, 37
Moving the pointer, 14               HMOD1, 37
                                     HMOD1I, 37
Operating System Commands            HP2621, 37
  CONTINUE, 50                       HP2640, 37
  Control C, 18                      HP2648, 37
  MAKE                               RGNT25, 37
  TECO                               TELRAY, 37
                                     TELVID, 37
Prompt, 13                           TK4025, 37
                                     TTY, 36
Q-register                           VT05, 37
  ?, 32                              VT100, 37
  AUTO-BUFFER, 30                    VT132, 37
  AUTO-COMMAND, 30                   VT50, 37
  AUTO-COUNT, 30                     VT52, 37
  COMMAND-BUFFER, 30 to 31, 83       VT61, 37
  COMMAND-PROMPT, 31               TOPS-10, 12
  CONTROL-C-INTERCEPT-COMMAND,     TOPS-20, 13
    31                                 
  ERROR-TEXT, 31                   UDX, 52
  Execution, 86                    UUO
  EXIT-COMMAND, 31                   GETTAB, 52
INDEX                                                     Page Index-4
Miscellaneous                                                23 Jun 82


  PEEK, 52                         
  SWITCH, 52                       
  TIMER, 53                        
  TRMNO., 52                       
  TTCALL, 55                       
                                   
Video mode, 11, 31, 35, 50, 53     
Video parameter                    
  LINE, 37                         
  MODE, 37                         
  NODE, 37                         
  OFF, 37                          
  ON, 37                           
  REFRESH, 38                      
  SCREEN, 38                       
  SCROLL, 38                       
  TRMOP, 38                        
  UPDATE, 38                       
  WINDOW, 38