Standard TECO Standard TECO TEXT EDITOR AND CORRECTOR FOR THE PDP-11, PDP-10, and PDP-8 USER'S GUIDE AND LANGUAGE REFERENCE MANUAL Preliminary Edition - April 1979 TECO-11 VERSION 34 TECO-10 VERSION 1 TECO-8 VERSION 7 March, 1979 Standard TECO PAGE 2 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation or by DECUS. Neither Digital Equipment Corporation, DECUS, or the authors assume any responsibility for the use or reliability of this document or the described software. Copyright (C) 1979 TECO SIG General permission to copy or modify, but not for profit, is hereby granted, provided that the above copyright notice is included and reference made to the fact that reproduction privileges were granted by the TECO SIG. Standard TECO PAGE 3 TABLE OF CONTENTS Introduction 4 Chapter I: Introductory Commands 5 1.0 Fundamentals 5 1.1 File Selection Commands 7 1.2 Input and Output Commands 10 1.3 Pointer Positioning Commands 11 1.4 Type Out Commands 12 1.5 Text Modification Commands 13 1.6 Search Commands 14 1.7 Summary 15 1.8 Sample Editing Job 16 Chapter II: Invoking TECO Chapter III: General Concepts Chapter IV: Command String Editing Chapter V: Logical Command Summary 19 5.0 Teco Character Set 19 5.1 File Specification Commands 22 5.2 Page Manipulation Commands 26 5.3 Buffer Pointer Manipulation Commands 27 5.4 Text Type-out Commands 28 5.5 Deletion Commands 30 5.6 Insertion Commands 31 5.7 Search Commands 33 5.8 Search Arguments 38 5.9 Q-registers 41 5.10 Command Loops 45 5.11 Branching Commands 45 5.12 Conditional Execution Commands 47 5.13 Numeric Arguments 49 5.14 Mode control flags 5.15 Job characteristics 5.16 Setting Mode Control Flags 55 5.17 Scope Commands 59 5.18 Programming Aids 60 5.19 Error Messages 62 5.20 Manipulating Large Pages 62 5.21 Techniques and Examples 63 Chapter VI: Alphabetical Command Summary with Examples Chapter VII: Error Handling Appendix A: RT-11 Operating Characteristics 68 Standard TECO PAGE 4 Appendix B: RSTS/E Operating Characteristics 73 Appendix C: RSX-11 Operating Characteristics 79 Appendix D: OS/8 Operating Characteristics Appendix E: TOPS-10 Operating Characteristics Appendix F: VAX/VMS Operating Characteristics Appendix G: TOPS-20 Operating Characteristics Appendix H: ASCII Character Set 87 Appendix I: TECO-8 V7 vs. OS/8 TECO V5 Appendix J: TECO-10 V1 vs. TOPS-10 TECO V24 Appendix K: TECO-11 V34 vs. TECO-11 V28 Appendix L: System-specific commands Appendix M: Error Messages 88 Glossary of Obscure TECO terms Index to TECO Commands 94 Standard TECO PAGE 5 Introduction INTRODUCTION TECO is a powerful text editing program that runs under most DIGITAL operating systems. TECO may be used to edit any form of ASCII text such as program sources, manuscripts, correspondence and the like. Since TECO is a character-oriented editor rather than a line editor, text edited with TECO does not have line numbers associated with it, nor is it necessary to replace an entire line of text in order to change one character. Because TECO is very versatile, it is necessarily complex. This manual is, therefore, divided into two parts. Chapter I contains basic information and introduces enough TECO commands to allow the novice TECO user to begin creating and editing text files after only a few hours of instruction. The introductory commands are sufficient for any editing application; however, they are less powerful, in most cases, than the advanced commands presented later. Subsequent chapters introduce the full TECO command set, including a review of the introductory commands presented earlier. These chapters also introduce the concept of TECO as a programming language and explains how basic editing commands may be combined into "programs" which are sophisticated enough to handle the most complicated editing tasks. Specific examples of the use of TECO commands have been de-emphasized throughout the early portions of this manual. This was done because all of the TECO commands have a consistent, logical format which will quickly become apparent to the novice user. However, each chapter of the manual is concluded with one or more elaborate examples which employ most of the commands introduced up to that point. Users who are learning TECO commands should experiment with each command as it is introduced, then duplicate the examples on their computer. Examples of each command can be found in Chapter VI. This manual is intended to be a reference manual and, except for Chapter I, is not a tutorial. After Chapter I, it is assumed that the reader has a general familiarity with TECO and is referencing this manual to get detailed information. Standard TECO PAGE 6 Introduction CHAPTER I INTRODUCTORY COMMANDS 1.0 FUNDAMENTALS TECO considers text to be any string of ASCII codes. Text is broken down into units of pages, lines, and characters. A page of text consists of all the ASCII codes between two form feed characters, including the second form feed. A character is one ASCII code. Thus, every page of text contains one form feed character, which is the last character on the page. Every line of text contains one line terminator (usually a line feed), which is the last character on the line. TECO maintains a text buffer in which text is stored. The buffer usually contains one page of text consisting of up to several thousand characters, but the terminating form feed character never appears in the buffer. TECO also maintains a buffer pointer. The pointer is simply a movable position indicator which is always located between two characters in the buffer, or before the first character in the buffer, or after the last character in the buffer. The pointer is never located on a character. Line feed and form feed characters are inserted automatically by TECO. A line feed is automatically appended to every carriage return typed to TECO, and a form feed is appended to the contents of the buffer by certain output commands. Additional line feed and form feed characters may be entered into the buffer as text. If a form feed character is entered into the buffer, it will cause a page break upon output. That is, all text preceding the form feed will appear on one page, and the text following the form feed will appear on the next page. Finally, TECO also maintains an input file and an output file, both of which are selected by the user through the use of file specification commands. The input file may be on any device from which text may be accepted. For example, if a block of text is stored in a disk file, the disk file would be specified as an input file when the text is edited. The output file may be on any device on which edited text may be written. If the disk file mentioned above were to be edited, it could be written, for example, onto another disk file. TECO functions as a "pipeline" editor. Text is read from the input file into the text buffer, and is written from the buffer onto the output file. Once a portion of text has been written to the output file, it cannot be accessed again without closing the output file and re-opening it as an input file. Standard TECO PAGE 7 Fundamentals TECO may be called from command level by typing: RUN dev:TECO For RT-11 RUN dev:TECO For OS/8 RUN dev:TECO For TOPS-10 RUN dev:TECO For RSTS/E RUN $TEC For RSX-11 RUN dev:TEC For VAX/VMS RUN dev:TECO For TOPS-20 (terminated with a carriage return). In many operating systems, the "dev:" can be omitted and the command can be abbreviated to "R TECO". TECO will respond by printing an asterisk at the left margin to indicate that it is ready to accept user commands. At this point, one or more commands may be typed at the terminal, and TECO will execute the commands upon receipt of two consecutive ESCAPE characters. The ESCAPE is a non-printing character which may be labelled ESC, ALT, or PREFIX on some keyboards. TECO echoes a dollar sign ($) whenever an ESCAPE is typed. The dollar sign character is used in examples throughout this manual to represent ESCAPE. A TECO command consists of one or two characters which cause a specific operation to be performed. Some TECO commands may be preceded or followed by arguments. Arguments may be either numeric or textual. A numeric argument is simply an integer value which might be used to indicate such things as the number of times a command should be executed. A text argument is a string of ASCII characters which might be words of text, for example, or a file specification. If a command requires a numeric argument, the numeric argument always precedes the command. If a command requires a text argument, the text argument always follows the command. All text arguments are terminated by a special character (usually an ESCAPE) which indicates to TECO that the next character typed will be the first character of a new command. If more than one command is typed in response to the asterisk generated by TECO, the command string will be executed from left to right until either all commands have been executed or a command error is recognized. If an error is encountered, a message is printed and the rest of the command string is ignored. In any case, TECO prints another asterisk (usually at the left margin) as soon as it finishes execution of a command string, so that additional commands may be entered. Standard TECO PAGE 8 Fundamentals The extensive text editing capability of TECO implies a large and versatile command set. However, the novice TECO user will find that little more than a dozen basic commands suffice for most editing requirements. The following section introduces the basic TECO commands. The full command set will be described later in this manual. Standard TECO PAGE 9 Fundamentals 1.1a FILE SELECTION COMMANDS Input and output files may be specified to TECO in several ways. The following commands permit flexible file selection with TECO. (On a first reading, new users of TECO may skip ahead to section 1.1b) NOTE All of the following file selection commands are shown with a general argument of "filespec". The actual contents of this filespec argument are operating system dependent. See the Operating Characteristics Appendices. Examples include a mixture of filespecifications from various operating systems. TECO will accept input text from any input device in the operating system. The input device may be specified by means of an ER command terminated by an ESCAPE. The ER command causes TECO to open the specified file and print an error message if the file is not found. This command does not cause any portion of the file to be read into the text buffer, however. The following examples illustrate use of the ER command: COMMAND FUNCTION ERfilespec$ General form of the ER command where "filespec" is the designation of the input file. The command is terminated by an ESCAPE, which echoes as a dollar sign. ERPR:$ Prepare to read an input file from the paper tape reader. ERPROG.MAC$ Prepare to read input file PROG.MAC from the system's default device. ERDX1:PROG.FOR$ Prepare to read input file PROG.FOR from DX1:. Standard TECO PAGE 10 File Selection Commands TECO will write output text onto any device in the operating system. The output file may be specified by means of an EW command terminated by an ESCAPE. If the output device is a file-structured device (e.g., a disk), a file name and extension (if any) must be supplied. If a file name is specified but no device is explicitly defined, the system's default device is assumed. The following examples illustrate use of the EW command, which has the same format as the ER command: COMMAND FUNCTION EWfilespec$ General form of the EW command where "filespec" is the designation of the output file. The command is terminated by an ESCAPE, which echoes as a dollar sign. EWSYS:TEXT.LST$ Prepare to write output file TEXT.LST on SYS:. EWPROG$ Prepare to write output file PROG on the system's default device. EWDX1:TEXT.LST$ Prepare to write output file TEXT.LST on DX1:. It is not always necessary to specify an input file. If the user desires to create a file without using any previously edited text as input, he may type commands to insert the necessary text directly into the text buffer from the keyboard and, at the end of each page, write the contents of the buffer onto an output file. Since all input is supplied from the keyboard, no input file is necessary. An output file is unnecessary if the user desires only to examine an input file, without making permanent changes or corrections. In this case, the contents of the input file may be read into the text buffer page by page and examined at the terminal. Since all output is printed on the user terminal, no output file is needed. Standard TECO PAGE 11 File Selection Commands When the user is finished editing a file, he may use the EX command to close out the file and exit from TECO. The current contents of the text buffer, and any portion of the input file that has not been read yet, are copied to the output file before TECO exits. Note that the EX command takes no arguments. COMMAND: EX FUNCTION: Move the remainder of the current input file to the current output file, close the output file, then return to the monitor. COMMAND STRING: ERDX1:INPUT.MAC$EWOUTPUT.MAC$$ FUNCTION: Open an input file "INPUT.MAC" to be found on DX1 and open an output file named "OUTPUT.MAC". The double ESCAPE ($$) terminates the command string and causes the string to be executed. Note that the ESCAPE which terminates the EW command may be one of the two ESCAPEs which terminates the command string. COMMAND STRING: ERFILE.MAC$EWCOPY.MAC$EX$$ FUNCTION: Open an input file "FILE.MAC" and open an output file named "COPY.MAC", then copy all the text in the input file to the output file, close the output file and exit from TECO. TECO will only keep one input and one output file open and selected at a time. The current input file may be changed by simply using the ER command to specify a new file. The EX command or one of the other file closing commands presented later may be used to close the output file. Standard TECO PAGE 12 Simplified File Selection 1.1b Simplified File Selection For most simple applications, it is unnecessary to use the preceding file selection commands. Instead, it is possible to specify the name of the file you wish to edit when you start up TECO. For this purpose, special operating system commands are available. TO CREATE A NEW FILE MAKE filespec RSTS/E MAKE filespec RSX-11 MAKE filespec OS/8 MAKE filespec TOPS-10 EDIT/CREATE filespec RT-11 <> TOPS-20 MAKE filespec VAX/VMS These commands start up TECO and perform an effective EWfilespec$ command. EDITING AN EXISTING FILE TECO filespec RSTS/E TECO filespec RSX-11 TECO filespec OS/8 TECO filespec TOPS-10 EDIT filespec RT-11 <> TOPS-20 TECO filespec VAX/VMS These commands start up TECO and perform an effective EBfilespec$Y which is a command that opens the specified file for editing while preserving the original file (as a backup file). This command also automatically brings in the first page of the file into the text buffer. Standard TECO PAGE 13 Simplified File Selection If any of the above commands do not seem to work on your operating system, consult the appropriate appendix for information about how to install TECO and its associated operating system commands. Standard TECO PAGE 14 Input and Output 1.2 INPUT AND OUTPUT COMMANDS The following commands permit pages of text to be read into the TECO text buffer from an input device or written from the buffer onto an output device. Once a page of text has been written onto the output file, it cannot be recalled into the text buffer unless the output file is closed and reopened as an input file. COMMAND FUNCTION Y Clear the text buffer, then read the next page of the input file into the buffer. Since the Y command causes the contents of the text buffer to be lost, it is not permitted if an output file is open and there is text in the buffer (see ED flag in 2.14). P Write the contents of the text buffer onto the next page of the output file, then clear the buffer and read the next page of the input file into the buffer. nP Execute the P command n times, where n must be a positive (non-zero) integer. If n is not specified, a value of 1 is assumed. Standard TECO PAGE 15 Pointer Positioning 1.3 POINTER POSITIONING COMMANDS The buffer pointer provides the only means of specifying the location within a block of text at which insertions, deletions or corrections are to be made. The following commands permit the buffer pointer to be moved to a position between any two adjacent characters in the buffer. TECO positions the pointer before the first character in the buffer after every Y or P command. COMMAND FUNCTION J Move the pointer to the beginning of the buffer. L Move the pointer forward to a position between the next line feed and the first character of the next line. That is, advance the pointer to the beginning of the next line. nL Execute the L command n times, where n may be any integer. A positive value of n moves the pointer to the beginning of the nth line following the current pointer position. A negative value moves the pointer backward n lines and positions it at the beginnning of the nth line preceding the current position. If n is zero, the pointer is moved to the beginning of the line on which it is currently positioned. C Advance the pointer forward across one character. nC Execute the C command n times, where n is a signed integer. A positive value of n moves the pointer forward across n characters (carriage return/line feed counts as two characters). A negative value of n moves the pointer backward across n characters. If n is zero, the pointer position is not changed. These commands may be used to move the buffer pointer across any number of lines or characters in either direction; however, they will not move the pointer across a page boundary. If a C command attempts to move the pointer backward beyond the beginning of the buffer or forward past the end of the buffer, an error message is printed and the command is ignored. If an L command attempts to exceed the page boundaries in this manner, the pointer is positioned at the boundary which would have been exceeded. Thus the command "-4000L" would position the pointer before the first character in the buffer (assuming that there are fewer than 4000 lines of text currently in the buffer). The command "4000L" would position the pointer after the last character in the buffer. No error message is printed in either case. Standard TECO PAGE 16 Type Out 1.4 TYPE OUT COMMANDS The following commands permit portions of the text in the buffer to be printed out for examination. These commands do not move the buffer pointer. COMMAND FUNCTION T Type the contents of the text buffer from the current position of the pointer through and including the next line feed character. nT Type n lines, where n is a signed integer. A positive value of n causes the n lines following the pointer to be typed. A negative value of n causes the n lines preceding the pointer to be typed. If n is zero, the contents of the buffer from the beginning of the line on which the pointer is located up to the pointer is typed. This facilitates locating the buffer pointer. HT Type the entire contents of the text buffer. V Type the current line. Equivalent to the sequence "0TT". The 0T command is particularly useful for determining the position of the buffer pointer. This command should be used frequently to determine that the pointer is actually located where the user expects it to be. Standard TECO PAGE 17 Type Out In addition to the above commands, there are two special commands available as a convenience. These commands consist of a single character and must be the very first character typed after TECO prints its prompting asterisk. These commands are abbreviations for two very frequently used commands. They also take effect immediately; there is no need to follow these commands by an ESCAPE character. (For this reason, these commands are known as immediate action commands.) COMMAND FUNCTION Immediately execute the LT command. This command is issued by typing the line feed key as the first keystroke after TECO's prompt. It causes TECO to move ahead one line and then type out the next following line. Immediately execute the -LT command. This command is issued by typing the backspace key as the first keystroke after TECO's prompt. It causes TECO to move back one line and then type the line just moved over on the terminal. On terminals with no backspace key, typing has the same effect. These commands are useful for "walking through" a file, examining and/or modifying the lines viewed one at a time. Note that on TECO-11, both and are no-ops if you are at the top of the buffer (for ) or at the bottom of the buffer (for ). Standard TECO PAGE 18 Text Modification Commands 1.5 TEXT MODIFICATION COMMANDS The following commands permit the user to insert or delete text from the buffer. COMMAND FUNCTION Itext$ Where "text" is a string of ASCII characters terminated by an ESCAPE, which echoes as a dollar sign. The specified text is inserted into the buffer at the current position of the pointer, with the pointer positioned immediately after the last character of the insertion. K Delete the contents of the text buffer from the current position of the pointer up to and including the next line feed character. nK Execute the K command n times, where n is a signed integer. A positive value of n causes the n lines following the pointer to be deleted. A negative value of n causes the n lines preceding the pointer to be deleted. If n is zero, the contents of the buffer from the beginning of the line on which the pointer is located up to the pointer is deleted. HK Delete the entire contents of the text buffer. D Delete the character following the buffer pointer. nD Execute the D command n times, where n is a signed integer. A positive value of n causes the n characters following the pointer to be deleted. A negative value of n causes the n characters preceding the pointer to be deleted. If n is zero, the command is ignored. Like the L and C commands, the K and D commands may not execute across page boundaries. If a K command attempts to delete text up to and across the beginning or end of the buffer, text will be deleted only up to the buffer boundary and the pointer will be positioned at the boundary. No error message is printed. A D command attempting to delete text across a page boundary will produce an error and the command is ignored. Standard TECO PAGE 19 Search Commands 1.6 SEARCH COMMANDS The following commands may be used to search for a specified string of characters which may occur somewhere in the input file. They cause the buffer pointer to be positioned immediately after the last character in the specified string, if found. COMMAND FUNCTION Stext$ Where "text" is a string of ASCII characters terminated with an ESCAPE which echoes as a dollar sign. This command searches the text buffer for the next occurrence of the specified character string following the current pointer position. If the string is found, the pointer is positioned after the last character on the string. If it is not found, the pointer is positioned immediately before the first character in the buffer and an error message is printed. Ntext$ Performs the same function as the S command except that the search is continued across page boundaries, if necessary, until the character string is found or the end of the input file is reached. If the end of the input file is reached, an error message is printed and it is necessary to close the output file and reopen it as an input file before any further editing may be done on that file. Both the S command and the N command begin searching for the specified character string at the current position of the pointer. Therefore, neither command will locate any occurrence of the character string which precedes the current pointer position, nor will it locate any character string which continues across a page boundary. Both commands execute the search by attempting to match the command argument, character for character, with some portion of the buffer contents. If an N command reaches the end of the buffer without finding a match for its argument, it writes the contents of the buffer onto the output file, clears the buffer, reads the next page of the input file into the buffer, and continues the search. Standard TECO PAGE 20 Search Commands 1.7 SUMMARY At this point, the basic TECO commands have been introduced. Recall that TECO indicates it is ready to accept user commands by printing an asterisk (*). Once TECO has printed an asterisk, one or more commands may be typed at the terminal. Errors in commands may be corrected by typing the DELETE key to delete characters. The DELETE key may be labeled DEL or RUBOUT on some keyboards. Each depression of the DELETE key deletes one character, beginning with the last character typed, and then prints the deleted character at the terminal. If your terminal is a CRT, TECO may actually erase the deleted character from the screen. An entire command string may be deleted in this manner, if necessary. An entire line of a command may be deleted by typing the character , typed by holding down the CONTROL key and depressing the "U" key. Once the correct command(s) have been entered, typing a double ESCAPE ($$) causes TECO to execute the command(s) in the order in which they were entered, and to print another asterisk so that additional commands may be typed. Note that this manner of operation is different from most other editors. In particular, carriage return has no special significance to TECO. Only the double ESCAPE forces execution of the command string. If TECO encounters an erroneous command, it prints an error message and ignores the erroneous command as well as all commands which follow it. All error messages are of the form: ?XXX Message where XXX is an error code and the message is a description of the error. Every error message is followed by an asterisk at the left margin, indicating that TECO is ready to accept additional commands. If the first command entered after a TECO-generated error message is a single question mark character (?), TECO will print the erroneous command string up to and including the character which caused the error message. This facilitates locating errors in long command strings and determining how much of a command string was executed before the error was encountered. At the conclusion of an editing job, the user may type EX to exit TECO. If an input and output file are open at the time the EX command is encountered, the remainder of the input file, including the current contents of the text buffer, is copied to the output file, and the output file is closed before TECO exits. Standard TECO PAGE 21 Sample Editing Job 1.8 SAMPLE EDITING JOB The following sample editing job is included to help the new user to achieve a greater understanding of the basic TECO commands. The entire terminal output from the editing run has been reproduced intact, and numbers have been added in the left margin referencing the explanatory paragraphs which follow. 1) At this point, the user called TECO into memory. TECO responded by printing an asterisk at the left margin. The user then entered an EW command, opening an output file called "FILE1.TXT" on DT1. There is no input file. Upon receipt of the double ESCAPE ($$), TECO created the designated output file, then printed another asterisk at the left margin. 2) The user then entered a command string consisting of two commands. The HK command cleared the text buffer (not really necessary, since it was already empty), and the I command inserted 18 lines of text into the buffer, including 8 blank lines. TECO executed these commands upon receipt of the second double ESCAPE. At this point, the buffer pointer was positioned at the end of the buffer, following the last line feed character in the text. Note that the user made an error while typing the word "MASSACHUSETTS". He typed "MASA", then realized his mistake and struck the DELETE key once to delete the second "A". TECO echoed the deleted character. The user then typed the correct character and continued the insertion. 3) The user then typed -20L to move the pointer to the beginning of the buffer and SETTS$ to position the pointer immediately after the character string "ETTS" which terminates the word "MASSACHUSETTS". He then used an I command to insert one space and a five-digit zip code. A second S command positioned the pointer after the word "INFORMATION". The 2C command moved the pointer to the beginning of the next line (carriage return and line feed count two characters), and the user deleted the words "PERTAINING TO" and replaced them with the word "REGARDING". 4) The user continued editing by positioning the pointer after the word "GUIDE". He then deleted this word, and replaced it with the word "MANUAL". Finally, he searched for the word "SINCERELY", typed 0T to determine that the pointer was correctly positioned between the Y and the comma which follows it, and typed 0K to delete everything on the line except the comma. He then inserted "VERY TRULY YOURS" in place of the word "SINCERELY". An HT command caused the edited text to be printed at the terminal. 5) The command string EX$$ caused the contents of the buffer to be written onto the output file and closed the output file. The user then reentered TECO and reopened the file "FILE1.TXT" as Standard TECO PAGE 22 Sample Editing Job an input file and specified the line printer as an output file. 6) This command string reads the first (and only) page of "FILE1.TXT" into the buffer, deleted the first 5 lines, replaced them with a different address and salutation, then printed the contents of the buffer on the terminal for verification and finally printed the new version of the letter onto the line printer. Note that the previous version of the letter still resides in file "FILE1.TXT" on DT1. 1< *EWDT1:FILE1.TXT$$ 2< *HKIMR. JOHN P. JONES ! COMPUTER ELECTRONICS CORPORATION ! BOSTON, MASAASACHUSETTS ! ! DEAR MR. JONES: ! ! I WAS PLEASED TO RECEIVE YOUR REQUEST FOR INFORMATION ! PERTAINING TO THE NEW TECO TEXT EDITING AND CORRECTING ! PROGRAM. ! ! ENCLOSED IS A COPY OF THE TECO USERS'S GUIDE, WHICH ! SHOULD ANSWER ALL OF YOUR QUESTIONS. ! ! SINCERELY, ! ! ! ! ! $$ 3< *-20LSETTS$I 02150$$ ! *STION$2C13DIREGARDING$$ 4< *SGUIDE$-5DIMANUAL$$ ! *SELY$0T$$ ! SINCERELY*0KIVERY TRULY YOURS$$ ! *HT$$ ! MR. JOHN P. JONES ! COMPUTER ELECTRONICS CORPORATION ! BOSTON, MASSACHUSETTS 02150 ! ! DEAR MR. JONES: ! ! I WAS PLEASED TO RECEIVE YOUR REQUEST FOR INFORMATION ! REGARDING THE NEW TECO TEXT EDITING AND CORRECTING ! PROGRAM. ! ! ENCLOSED IS A COPY OF THE TECO USER'S MANUAL, WHICH ! SHOULD ANSWER ALL OF YOUR QUESTIONS. ! ! VERY TRULY YOURS, Standard TECO PAGE 23 Sample Editing Job ! ! ! ! ! 5< *EX$$ ! (TECO is rerun, operating system dependent) ! *ERDT1:FILE1.TXT$EWLP:$$ 6< *Y5KIMR. JAMES B. SMITH ! DATEK ASSOCIATES, INC. ! 122 MAIN STREET WEST ! AUSTIN, TEXAS ! ! DEAR MR. SMITH: ! $$ ! *HT$$ ! MR. JAMES B. SMITH ! DATEK ASSOCIATES, INC. ! 122 MAIN STREET WEST ! AUSTIN, TEXAS ! ! DEAR MR. SMITH: ! ! I WAS PLEASED TO RECEIVE YOUR REQUEST FOR INFORMATION ! REGARDING THE NEW TECO TEXT EDITING AND CORRECTING ! PROGRAM. ! ! ENCLOSED IS A COPY OF THE TECO USER'S MANUAL, WHICH ! SHOULD ANSWER ALL OF YOUR QUESTIONS. ! ! VERY TRULY YOURS, ! ! ! ! ! ! *EX$$ Concluding Remarks The rest of this manual is a description of TECO in all its glory. Each section describes a particular aspect of TECO in complete detail. TECO is a complex editor and has many features, because it has been under development for a long time. In truth, TECO is older than some of the readers of this manual. Do not try to understand everything the first time through. if you find that what you are reading seems hopelessly obscure, or makes no sense whatsoever, skip to the next section and come back to it some time later. It will be a while before you need all of TECO's features. This manual is meant to be a reference manual and not a Standard TECO PAGE 24 Sample Editing Job tutorial. Readers who are first learning TECO may wish to consult the following document (available from Digital Equipment Corporation) for more basic material: DEC-10-UTECA-A-D INTRODUCTION TO TECO. Standard TECO PAGE 25 Invoking TECO CHAPTER II INVOKING TECO 2.1 RUNNING TECO To run TECO with no special options or defaults, you would use the same command on your operating system that you would use to run any other program. Such a command is operating-system dependent but is usually something like RUN TECO Consult the Appendix that describes your operating system's characteristics for more details. 2.2 CREATING A NEW FILE All operating systems (except RT-11) use the same command to invoke TECO for the purpose of creating a new file. This command is MAKE filespec The "MAKE filespec" command takes as its single argument the file specification for the file to be created. This file specification must conform to the conventions used by your operating system. If a file by that name already exists, TECO will give you a warning message telling you that you are superseding an existing file. The MAKE command invokes TECO and performs an effective EWfilespec$$ TECO command. 2.3 EDITING AN EXISTING FILE All operating systems (except RT-11) use the same command to invoke TECO for the purpose of editing an existing file. This command is TECO filespec The "TECO filespec" command takes as its argument the file specification for the file to be edited. The file will be opened for input and output, with back-up protection. That means that the system will save the original version of the source file (in case you 'blow' the edit). If your operating system supports file version numbers, a new version will be created. If your operating system does not support file version numbers, then the Standard TECO PAGE 26 Editing an Existing File original file will be preserved in a file with the same name but with a backup extension (.BAK). The TECO command invokes TECO and performs an effective EBfilespec$Y$$ command. Note that the first page of the file has already been yanked into memory and that the text buffer pointer is left positioned at the start of the file. If, at any time during the edit, you discover that the edit is invalid, you can type enough s to get you back to the operating system, and you will find that your original file is preserved. 2.4 SWITCHES ON TECO and MAKE COMMANDS The TECO and MAKE commands can take switches of the form /SWITCH. These switches are described below. SWITCHES ON COMMAND LINES System Switch Meaning OS/8 /INSPECT Do not create an output file /VT Load VTEDIT RSTS/E /INSPECT Do not create an output file /SIZE:n start with nK word editing area /SIZE:+n start with extra nK words of editing area /VTEDIT Load VTEDIT video terminal editor /FIND Initially position to the last marked point in the input file. /NOINI Do not use TECO.INI to perform initialization /NOMEMORY Do not remember the argument to the invocation command. RSX-11 /INSPECT Do not create an output file /INC=n start with extra nK words of editing area /VTEDIT Load VTEDIT video terminal editor /FIND Initially position to the last marked point in the input file. /NOINI Do not use TECO.INI to perform initialization /NOMEMORY Do not remember the argument to the invocation command. VAX/VMS /INSPECT Do not create an output file /FIND Initially position to the last marked point in the input file. Standard TECO PAGE 27 Switches /NOINI Do not use TECO.INI to perform initialization /NOMEMORY Do not remember the argument to the invocation command. The /VTEDIT command may also take switch values (of the form :value). /VTEDIT:HOLD Start up in hold screen mode /VTEDIT:SEEALL Start up in SEEALL mode These areguments can be combined, viz.: /VTEDIT:HOLD:SEEALL. 2.5 INVOKING A TECO PROGRAM All operating systems (except TOPS-10 and RT-11) use the same command to let you start up execution of a TECO program (macro). This command is the MUNG command. (Consult Appendix F for information about how to run TECO programs using TECO-10.) The MUNG command has te form MUNG filespec where filespec is the name of the TECO program that is to be run. If no file extension is specified, .TEC is assumed. This command executes the TECO code that appears within the specified file. It invokes TECO and performs an effective EIfilespec$$ command (consult the appendices for trivial differences). The contents of the specified file should probably end with a doube ESCAPE so that execution will start immediately. Another form of this command is MUNG filespec,data where "data" consists of any string of ASCII characters to be passed to the TECO program. This version of the MUNG command invokes TECO and issues an effective Idata$EIfilespec$$ command. 2.6 USER INITIALIZATION A user can specify initialization commands to TECO by creating a file called TECO.INI. On startup, if TECO finds a file called TECO.INI in the user's area, TECO executes the commands in that file. This is useful for setting initial values to flags. Standard TECO PAGE 28 User Initialization If a user has unusual commands in his initialization file, it would be prudent to surround such commands with the ? command, to remind all users that this version of TECO runs funny. If a user's personal TECO.INI does unusual stuff, he would be well-advised to print an informative message on the terminal. Example 1: User initialization file sets the ED flag to 1 so that ^ characters in search strings have their traditional meaning (do not convert the next character to a control character). ?1ED? Enclosing the command between question marks causes TECO to type out these commands when they are executed (see paragraph 5.18). Example 2: User initialization file causes future search string failures to preserve the pointer position. File prints a message informing all users of this fact. ED#16ED ^A[Dot preserved on failing searches]^A 13^T 10^T Users must be very careful with code they put in TECO.INI because, if an error occurs in this code, the status of the user's edit is not well-defined. A TECO.INI program is permitted to return a value. In such a case, the result is system specific. Standard TECO PAGE 29 General Concepts CHAPTER III GENERAL CONCEPTS <<>> 3.1 DATA STRUCTURES A good way to begin the study of a programming language is to forget the commands, for the moment, and concentrate instead on the data structures. This section follows that approach, describing both the values on which TECO operates and the buffers and registers in which these values are stored. TECO manipulates two types of data, namely, o The character string: a sequence of zero or more ASCII characters, and o The integer: a numeric value that may be signed or unsigned. The text that TECO edits is, of course, a character string. Less obviously, the command string by which the user controls TECO is also a character string. The counters and indices for character string manipulation, and the repetition counts for loops are integers. Character strings and integers have distinct internal representation and this is reflected in the design of the TECO commands. Commands designed for character strings do not work on integers and vice versa. In this section, several data structures are defined which are frequently applied to character strings. In all cases, the structuring is not "built-in" to the data, but rather is attributed to the data by particular commands and conventions. For example, a command that handles TECO lines sees a character string as divided into lines by occurrences of end-of-line characters; but a command that deals only in characters does not see any division into lines, and views end-of-line characters just as any other characters. The structure exists only in the eye of the beholder. Standard TECO PAGE 30 Data Structures The following are definitions for the line and the page in TECO: o Any character string can be divided into TECO lines by considering the line to be ended by either 1. a line feed (octal 12) 2. a form feed (octal 14) 3. a vertical tab (octal 13) or 4. the end of the given character string o Any character string can be divided into TECO pages by considering the page to be ended by either 1. a form feed (octal 14) or 2. the end of the given character string These data structures are used to achieve two quite separate results: the formatting of type-out and the logical division of data. The main storage of TECO is the text buffer, which will be described shortly among the other storage areas of TECO. The text buffer stores a single character string that TECO edits. A useful adjunct to this editing is a text buffer pointer, which is a fictitious sliver positioned between two characters of the buffer (but not taking any space itself) and which can be moved from one position to another by certain commands. The text buffer pointer never points to characters in the buffer; it is always pointing at pointer positions (between characters). The available pointer positions in the text buffer are sequentially numbered beginning with 0. Pointer position 0 is the position at the start of the buffer, just to the left of the first character. Pointer position 1 is the next position, just to the right of the first character, etc. As an example, suppose the text buffer contains the string FOOBAR. Then seven text buffer pointer positions are determined as shown by the arrows in the following figure: F O O B A R ^ ^ ^ ^ ^ ^ ^ 0 1 2 3 4 5 6 Note that there are 6 characters in the buffer and that the highest numbered pointer position is 6. The pointer position number is equal to the number of characters preceding that position. Standard TECO PAGE 31 Data Structures Useful definitions of "current" objects are made with respect to the text buffer pointer as follows: 1. The current character of the text buffer is the character just to the right of the pointer. If the pointer is at the end of the text buffer, there is no character to the right of the buffer pointer, and the current character does not exist. 2. The current line of the text buffer, is the TECO line that contains the current character. In the special case that the pointer is at the end of the buffer, the current line is everything back to (but not including) the last end-of-line character. 3. The current page of the text buffer is the TECO page that contains the current character. In the special case that the pointer is at the end of the buffer, the current page is everything back to (but not including) the last form feed character (or the beginning of the buffer). When the text buffer pointer is at the end of the text buffer and the last character of the buffer is an end-of-line character, then the current line is an empty string according to the definition just given. In this case, TECO performs the required operation on this empty string. For example, if the pointer is at the end of the buffer and TECO is commanded to kill (delete) the next 3 lines, then the empty string is killed 3 times. Similarly, if the pointer is at the end of the buffer and TECO is commanded to advance the pointer 5 lines, the pointer will remain at the end of the buffer. No error message will be given. In a like fashion, if the pointer is at the end of the first line of the buffer, and TECO is instructed to extract the previous 4 lines (into a Q-register), then only the first line is extracted since it is presumed to be preceded by 3 empty lines. Standard TECO PAGE 32 Storage Areas 3.2 STORAGE AREAS Each storage area of TECO will be described below: TEXT BUFFER Name: H Value: Character string Purpose: To hold the text being edited by TECO. Initial value: null string Set by: Input (A, Y, etc.), Insert (I), Replace (FS, FR, etc.), and other commands. Used by: Output (P, PW, etc.), Search (S, N, etc.), Replace (FS, FN, etc.), and other commands. Typed by: HT --------------------------------------------------------- TEXT BUFFER POINTER REGISTER Name: . Value: Non-negative integer Purpose: To hold a non-negative integer that is the number of the pointer position that the text buffer pointer is currently positioned at. Initial value: 0 Set by: Pointer positioning commands (J, C, R, etc.), Search commands (S, etc.), and other commands. Used by: All position relative commands and, under its name ".", whenever used within an arithmetic expression. Typed by: .= --------------------------------------------------------- Standard TECO PAGE 33 Storage Areas TEXT BUFFER SIZE REGISTER Name: Z Value: Non-negative integer Purpose: To hold a non-negative integer that is the number of characters in the entire text buffer. Initial value: 0 Set by: Any command that inserts (I, etc.) or deletes (D, K, etc.) from the text buffer. Used by: Using its name, "Z", in any arithmetic expression. Typed by: Z= --------------------------------------------------------- NUMERIC Q-REGISTERS Names: A,B,C,...,Z,0,1,2,...,9 Note: Additional Q-registers are allowed in TECO-10; consult appendix E. Value: The numeric portion of each Q-register contains one integer. Purpose: To hold an integer, for example, a pointer position. Initial value: 0 Set by: The U command. Used by: The Q and % commands. Typed by: Qq= --------------------------------------------------------- Standard TECO PAGE 34 Storage Areas ALPHANUMERIC Q-REGISTERS Names: A,B,C,...,Z,0,1,2,...,9 Note: TECO-10 has additional Q-registers. See appendix E. Value: The text storage area of each Q-register can contain one string (including the null string). Purpose: To hold a portion of text or to hold a TECO command string for execution as a subroutine (macro). Set by: X and ^U TECO commands, and * immediate action command. Used by: G and M command. Initial value: null string Typed by: :Gq Executed by: Mq Note: Each Q-register contains both a numeric portion and a text portion. These are independent areas within the Q-register. --------------------------------------------------------- Q-REGISTER PUSHDOWN LIST Values: This is a stack of pairs of values, one numeric value and one character string. Purpose: To save for later restoration the values of a Q-register, or to pass arguments to a TECO subroutine. Initial value: empty Set by: The [ command. Used by: The ] command. Note: The stack is not cleared when TECO returns to prompt level. --------------------------------------------------------- Standard TECO PAGE 35 Storage Areas SEARCH STRING BUFFER Name: _ [TECO-11 only] Value: character string Purpose: To accumulate and hold the string that a TECO command is searching for. Initial value: null string Set by: Any search command (S, N, _, FS, etc.). Used by: Any search command that specifies a null search string. Also used by TECO-11 via the commands G_ and Q_. Typed by: :G_ [TECO-11 only] --------------------------------------------------------- FILESPEC BUFFER Name: * [TECO-11 only] Value: character string Purpose: To accumulate and hold the file specification used by a TECO command. Set by: Any TECO command that specifies a file specification (ER, EW, EB, etc.). Used by: The G* and Q* commands. [TECO-11 only] Typed by: :G* [TECO-11 only] --------------------------------------------------------- Standard TECO PAGE 36 Storage Areas FORM FEED FLAG Name: ^E Value: 0 (false) or -1 (true) Purpose: To indicate to the user whether the last data append stopped because a form feed was encountered in the input file or because the text buffer was nearly full. Initial value: 0 Set by: The Y and A commands. Used by: The P and N commands and any reference to the ^E flag by name in an arithmetic expression. Typed by: ^E= --------------------------------------------------------- END OF FILE FLAG Name: ^N Value: 0 (false) or -1 (true) Purpose: To indicate whether or not end-of-file on the input file has been encountered. Initial value: 0 Set by: Set to -1 by a command that reads input (Y, A, N, P, etc.) if there is no more input to be read. Set to 0 by a command that opens a new input file (ER or EB). Used by: Any command that references the ^N flag by name in an arithmetic expression. Typed by: ^N= --------------------------------------------------------- Standard TECO PAGE 37 Storage Areas SEARCH MODE FLAG Name: ^X Value: 0 (either case mode) or -1 (exact case mode) Purpose: Specifies whether alphabetic characters in search strings must match exactly (-1) or whether either case of the same character is considered a match (0). Initial value: 0 Set by: n^X Used by: Search matching algorithm and any use of the flag by name (with no argument) in an arithmetic expression. Typed by: ^X= --------------------------------------------------------- EDIT LEVEL FLAG Name: ED Purpose: A bit-encoded integer. Each bit controls various TECO editing features. Initial value: Operating system dependent. See appendices. Set by: nED Used by: Any reference to this flag by name (with no argument) in an arithmetic expression. The search string builder, the text reading commands, and search failure handling all use bits in the ED flag (see section 5.14). Typed by: ED= --------------------------------------------------------- Standard TECO PAGE 38 Storage Areas HELP LEVEL FLAG Name: EH Value: A bit-encoded integer Purpose: Each bit (or group of bits) determines properties about how TECO should handle error conditions. Initial value: 0 Set by: nEH Used by: TECO error message processor and any command that references this flag by name (with no arguments) in an arithmetic expression. Typed by: EH= --------------------------------------------------------- VERSION NUMBER FLAG Name: EO Value: An integer Purpose: Specifies what version of TECO is running. This version number is known as the EO level and may or may not be changed on each release. Set by: nEO command reserved for possible future use. Used by: Any reference to flag by name in an arithmetic expression. TECO macros may wish to interrogate this flag if they wish to use features of TECO that are not standardized across all implementations. Typed by: EO= --------------------------------------------------------- Standard TECO PAGE 39 Storage Areas SEARCH VERIFICATION FLAG Name: ES Value: An integer Purpose: Specifies whether or not special action should be taken after a successful top-level search. Initial value: 0 Set by: nES Used by: TECO search processor and any reference to this flag by name (with no argument) in an arithmetic expression. Typed by: ES= --------------------------------------------------------- TERMINAL MODE FLAG Name: ET Value: A bit-encoded integer Purpose: Each bit controls the way TECO handles various terminal-related characteristics. Initial value: Operating system dependent. See appendices. Set by: nET and TECO initially sets various bits to indicate the presence of specific terminal properties. (See appendices.) Used by: TECO terminal service and any reference to this flag by name (with no arguments) in an arithmetic expression. Typed by: ET= --------------------------------------------------------- Standard TECO PAGE 40 Storage Areas UPPER/LOWER CASE FLAG Name: EU Value: An integer Purpose: To indicate the manner in which alphabetic characters should be flagged when typed on a terminal. Initial value: -1 if the editing terminal supports lower case typeout; 0 if not. Set by: nEU Used by: TECO terminal service and any reference to this flag by name (with no arguments) in an arithmetic expression. Typed by: EU= --------------------------------------------------------- EDIT VERIFY FLAG [TECO-11 only] Name: EV Purpose: To control the action of TECO after the execution of a command string. Value: An integer Initial value: 0 Set by: nEV Used by: TECO command executer and any reference to this flag by name (with no arguments) in an arithmetic expression. Typed by: EV= --------------------------------------------------------- Standard TECO PAGE 41 Storage Areas COMMAND STRING BUFFER Value: character string Purpose: To accumulate the command string as TECO accepts it, character by character, from the type-in buffer, and hold it until it is ready to be executed. Initial value: Operating system dependent (see appendices) Set by: Type-in from the user terminal (or indirect file). Used by: The TECO command interpreter. Typed by: The * immediate action command. Executed by: The $$ immediate action command. --------------------------------------------------------- COMMAND STRING PUSHDOWN STACK Values: This is a stack of character strings. Purpose: To save the current command string when it calls a subroutine (via the M command). Set by: TECO, when an M command is begun. Used by: TECO, when an M command is completed. Note: This stack is reset every time TECO returns to its * prompt. --------------------------------------------------------- Standard TECO PAGE 42 Storage Areas COMMAND REGISTER BACKUP REGISTER Value: character string Purpose: To retain the most recent command string. Set by: TECO from the command register. Used by: The *q immediate action command (to retrieve the last command string.) Note: In TECO-8, this register is retrieved into Q-register Z via use of the * immediate action command. --------------------------------------------------------- TYPE-AHEAD BUFFER Value: Character string Purpose: To hold incoming characters from the user terminal until TECO is free to echo them and interpret them. Set by: Type-in from the user terminal. Used by: TECO. Note: This register is mentioned because its presence allows the TECO user to continue typing even when TECO is too busy to accept type-in. This register is maintained by the operating system in many implementations. In TECO-8, this register is available only if VT support is present. --------------------------------------------------------- Standard TECO PAGE 43 Storage Areas INPUT/OUTPUT BUFFERS Value: Character string Purpose: To hold characters transmitted between TECO and operating system files until they can be accepted at their destination. Note: These buffers are mentioned because a too-sudden exit from TECO can cause the loss of the contents of these buffers. In most operating systems, these buffers are maintained by operating system services, rather than by TECO itself. Standard TECO PAGE 44 Text Arguments 3.3 TEXT ARGUMENTS TO COMMANDS Many TECO commands take a text (character string) argument. The syntax of such strings is exactly the same for all such TECO commands. The string occurs immediately after the command and consists of a sequence of ASCII characters terminated by an ESCAPE character (or in the case of the ! and ^A commands, by the command character). The string of ASCII characters may not include an ESCAPE because this would prematurely terminate the string. Any character other than ESCAPE is permitted within the string. (Note however that some characters may not be easily entered from a terminal because they may be filtered out by the operating system or may be TECO immediate action commands.) Examples: Sabc$ Search for the string "abc". ^UAHELLO$ Insert the text "HELLO" into Q-register A. OBEGIN$ Branch to the tag specified by the string "BEGIN". Some TECO commands require two string arguments. In that case, each one is followed by the terminating ESCAPE character. Example: FSabc$def$ Replace string "abc" by "def". Standard TECO PAGE 45 Text Arguments There is a second form that string arguments may take. Instead of terminating the string by an ESCAPE, it can be delimited on both sides by any ASCII character whatever, so long as that delimiter does not appear within the string. This form is permitted on any command that takes a string argument. To signify the fact that you are using this form of the string argument, the command must be preceded by an @ character. When this form is used, an ESCAPE character is permitted within the string, provided that ESCAPE is not the specified delimiter. Examples: @I/ab$c^Cg^Ux/ Insert the string "ab$c^Cg^Ux" into the text buffer. Note that in this manual, $ denotes an ESCAPE and in this example, ^C and ^U denote a and respectively. This command was evidently created in a macro since it could not have been typed in directly on a terminal. The delimiter used in this example is "/". @ER5TEST.FOR5 Open the file "TEST.FOR" for input. The delimiter used in this example is "5". @^A+Hello out there!+ Type the message "Hello out there!" on the terminal. The delimiter used in this example is "+". Standard TECO PAGE 46 Format of Commands 3.4 FORMAT OF COMMANDS Each TECO command consists of one or two characters optionally preceded by a numeric argument and sometimes followed by a text argument. The numeric argument, if used, may consist of any sequence of TECO commands that returns a value. The text argument, if part of a command, is a required part of the syntax of that command. TECO commands may be strung together one after another by merely concatenating them into a single command string. No delimiter is necessary between commands. 3.5 TYPES OF COMMANDS TECO is a very consistent (though at times obscure) programming language. There are a variety of different commands, each with its own format. These are described below: 3.5.1 LINE COMMANDS Line commands are commands that operate on lines, such as the T, K, X, :X, FB, and FC commands. Such commands take zero, one, or two numeric arguments. If one argument (n) is specified, then this represents the number of lines over which the command is to have effect beginning at the current buffer pointer position. If n is positive (non-zero), then the extent of the n lines is from the current pointer position to the nth following line delimiter. If n is negative, then the extent of the n lines is from the beginning of the line containing the abs(n)th previous line delimiter. If n is 0, the extent is from the beginning of the current line to the current pointer position. If n is omitted, then n=1 is assumed. If a line command consists of two arguments (m,n) then this represents a range of characters between pointer positions m and n. Unless this manual specifies otherwise, m must be less than or equal to n or unpredictable results will occur. 3.5.2 CHARACTER COMMANDS Character commands such as J, C, R, and D take a single numeric argument which represents the number of characters that the command is to act on. 3.5.3 FLAGS A number of TECO commands control the setting of variables called flags. Examples of such commands are ED, ET, ^E, ^X, ES, EU, and EV. These commands all work alike. If no numeric argument is specified, then these commands return the value of the associated flag. If a numeric argument is specified, then the value of that argument becomes the new value of the associated flag. Standard TECO PAGE 47 Types of Commands 3.5.4 COMMANDS THAT MAY BE REPEATED Some TECO commands (such as P, PW, and <) have the property that they perform a single action that can be repeated multiple times. In this case, the numeric argument is the repetition count. 3.5.5 COMMANDS THAT ACT ON THEIR ARGUMENT A large number of TECO commands (such as \, =, ==, ^T, U, ", %, S and ^Q) take their argument and do something with it, such as print it, test it, insert it, convert it, etc. 3.6 DEFAULT VALUES When a command that normally takes an argument is specified with no argument, TECO does the most natural thing - it executes the command in the way that would be considered most common or most useful. This is a convenience and also will save the user from typing unnecessary keystrokes. The following table illustrates this feature: Command Default Default Arg Action C 1 Advance 1 character R 1 Back over 1 character L 1 Advance 1 line T 1 Type one line J 0 Jump to start of buffer V 1 View one line D 1 Delete one character K 1 Kill one line S 1 Search for first occurrence % 1 Increment Q-register by 1 X 1 Extract one line The important thing to remember is not the numerical value of the default argument, but the default action to be taken. This will always be the most natural default. 3.7 @-SIGN MODIFIERS TECO handles string arguments for all commands exactly alike. If the command is not preceded by an @-sign, then the string argument immediately follows the command and continues until the delimiter character specified for each command (this is usually an ESCAPE). If, however, the command is preceded by an @-sign, then the character immediately following the command is the delimiter that will be used to delimit the string argument(s). Good programming practice dictates that the @-sign immediately precede the command and not be very remote from the command. Unpredictable results will occur if another TECO Standard TECO PAGE 48 @-sign Modifier command intervenes between an @-sign and the command that is supposed to be modified by the @-sign. 3.8 LOWER CASE As part of a TECO command name, or in the syntax for any TECO command, TECO treats upper and lower case characters exactly alike. Thus the commands Mq, mQ, mq, and MQ are identical. (Naturally, within strings, lower case characters are significant and are treated as being different from their upper case counterparts.) 3.9 TREATMENT OF CONTROL CHARACTERS As a TECO command character, the control character , typed by depressing the CTRL key and the x key simultaneously, is everywhere equivalent to the two-character TECO command ^x (Caret-x). Note that this general rule only applies to TECO commands. It does not apply to the appearance of control characters within strings or to the use of control characters as immediate action commands (used to edit your command string). 3.10 COLON MODIFIERS The colon (:) TECO command is used to modify a subsequent command. Good programming practice dictates that the : immediately precede the command it is to modify. Unpredictable results may occur if you use a : command followed by a TECO command that does not normally accept a colon modifier. If the command is also @-sign modified, the colon should immediately precede the @-sign which should immediately precede the command. The colon command modifies the action of the next command. In some cases, this will cause the next command to return a value (such as :ER, :EB, :EN, :S, :N, :FS, :FN, :_, :F_, :FB, :FC, etc.) and in cases where there is no natural number that could be returned (such as :=, :==, :Q, :Gq, :X, and :^Uq) the colon modifier causes the command to behave in a similar, but slightly different, manner. If both the : and @ modifiers are used on a single command, they may appear in any order. 3.11 TREATMENT OF ^ Any time that a Control character is valid as the initial character of a TECO commmand, TECO will accept either that control character or the two-character sequence ^X, corresponding to the desired control character, . Note that if a control character is used as the delimiter to a string, or as the second character of a two-character command, it must be entered in its control-character form. Any time that a control character could appear within a text Standard TECO PAGE 49 Treatment of ^ argument to a command, TECO will also accept the two-character sequence ^X to represent the desired control character . Note that this feature is disabled if the low-order bit of the ED flag is turned on. Note that certain control characters have special meaning in text arguments. They will still have these meanings if entered in up-arrow mode. To actually enter the special control character (like or ) into a search string, it must be entered as a control character preceded by , ^Q, , or ^R. 3.12 NOTATION USED IN THIS MANUAL The following notation is used in this manual to represent special characters: Notation ASCII code (octal) Name - Control-X 15 Carriage Return 12 Line feed 11 Tab 14 Form Feed 177 Delete (or rubout) 40 Space or $ 33 ESCAPE 10 Backspace 0 Null 13 Vertical Tab 3.13 SCOPE SUPPORT TECO offers three layers of scope support. 1. At the lowest level, TECO provides you with command string scope editing. This means that when you are entering a command string in reply to TECO's asterisk prompt, TECO understands about scope terminals and will do the right thing. Thus, if you are on a scope terminal and you type while entering a command string, the character to be deleted will actually be erased from the screen. If you type and the previous character was a line feed, TECO will move your terminal's cursor back up to the previous line. Deleting a will cause TECO to position the cursor at the end of the previous line on the screen. If that line had scrolled off the top of the screen, so that it is no longer visible, TECO will automatically bring the line back into view and then position the cursor at the end of that line. 2. At the intermediate level, TECO provides you with commands that allow you to display and maintain a visual "window" into the text buffer. Executing the command Standard TECO PAGE 50 Notation -1W causes the window to be updated. The window normally fills the entire screen and shows lines before and after the line currently containing the text buffer pointer. Users may write macros that monitor their progress by frequently updating the window. 3. At the highest level, TECO may invoke a video terminal editor macro which converts TECO into a "true scope editor". This macro is an editing macro that continuously updates the window and allows you to see your editing changes immediately as they occur. In this mode, typing a normal character on the terminal keyboard causes that character to be immediately entered into the text buffer and the result instantly shown in the window. Typing special keys on the terminal can move you around in the buffer (e.g. typing down arrow moves you down one line in the column you are at) or perform special functions (e.g. typing deletes the current line). There are several such video terminal editors available for TECO. One of these is called VTEDIT and is available from the DECUS program library. It is beyond the scope of this manual to describe the use of VTEDIT. There is a separate VTEDIT manual and keypad layout chart available from DECUS. Note that TECO novices and user's performing only simple editing can frequently do all their work through one of these editors, and not need to read this manual at all. Standard TECO PAGE 51 Notation CHAPTER IV COMMAND STRING EDITING While a command string is being typed in at a terminal, TECO considers certain ASCII characters to have special meaning. Most of the special characters are immediate action commands. Typing these characters in a command string causes TECO to perform a specified function immediately, without waiting for the double ESCAPE which terminates the command string. Immediate action commands may be entered at any point in a command string - even in the middle of a command or text argument. For this reason, the special characters should not be used in text arguments, except where specifically indicated throughout this manual. Immediate action commands are not regular TECO commands. (Regular TECO commands are used to edit the text in the file that you are editing, or are used to write programs written in the TECO language.) Immediate action commands are special commands to TECO that are used to edit the TECO command string as it is being typed in. Such commands differ from the regular commands in that they take immediate effect. For example, a DELETE (rubout) deletes the previously typed character immediately; you need not type two ESCAPEs to make DELETE work. Similarly, DELETE is not a regular TECO command. If you enter a DELETE into a command string being executed from a macro, the DELETE will not delete a character. It is important to keep in mind the difference between ordinary TECO commands and these immediate action commands. For example, the character is both a regular TECO command (^Uqtext$ enters the specified text into Q-register q) and an immediate action command ( typed while entering a command string deletes the current line). Because of this fact, it is not possible to type a (or any other immediate action command) directly into TECO as part of a command string, because when you type the , it will perform its immediate effect and erase the current line. Nevertheless, is still a valid TECO command, and should TECO encounter it in a macro or indirect file, it will have its regular TECO effect (^Uqtext$). Table 4-1 lists the immediate action commands used to edit a command string and also lists their functions. Standard TECO PAGE 52 Notation TABLE 4-1: IMMEDIATE ACTION COMMANDS These commands take immediate effect and are used to edit a command string. CHARACTER EXPLANATION The double character sequence is a command that tells TECO to begin execution of the command string just typed in. It echoes as $$ and also inserts two s into the command string. ESCAPE may be labelled ALTMODE or PREFIX on some terminals. A double ESCAPE initiates execution of the command string. The two ESCAPES must be typed successively. If any other character is typed in between the two ESCAPEs (even if subsequently DELETEd), then the two ESCAPEs might be treated as two ESCAPEs to be entered into the command string rather than be interpreted as an immediate action command. Sometimes it is necessary to enter two ESCAPEs into a command line, for example, when you want to use the FSstring$$ command to delete a string. To prevent command string execution from immediately commencing, you can type and then continue entering the remainder of your command string. Note that a single is not an immediate action command unless followed by a second . Typing a DELETE character deletes the last character typed. The DELETE key may be labeled DEL or RUBOUT on some keyboards. Typing several consecutive DELETEs deletes one character for each DELETE typed beginning with the last character typed. TECO echoes the deleted character whenever a DELETE is typed. This indicates to the typist that the character has been rubbed out. If, however, you are doing your editing on a scope terminal, then the action of this key is visibly different. In that case, the character that has been rubbed out will physically disappear from the screen of your editing terminal. The cursor will be moved back one position. If you delete a line feed, form feed, or vertical tab, the cursor will move up the screen and position itself at the end of the text that immediately preceded the line feed, form feed, or Standard TECO PAGE 53 Notation vertical tab. If the line after which the cursor is to be positioned had previously scrolled off the top of the screen, then TECO will automatically 'scroll down' that line, bringing it back into view. , produced by striking the CONTROL key and the C key simultaneously echoes as ^C (Caret-C) and aborts the entering of the command string. The exact action of the key depends on the operating system being used (See Appendices). , produced by striking the CONTROL key and the U key simultaneously, causes the current line of the current command line to be deleted. TECO echoes the character as ^U followed by . If, however, your editing terminal is a scope, then the visible action of typing this key is different. In that case, the current line physically disappears from the screen and the cursor is positioned back at the beginning of the line. Typing two consecutive characters, produced by holding the CONTROL key depressed while striking the G key twice, causes all commands which have been entered but not executed to be erased. (If the terminal has a bell, it will ring.) This command is used to erase an entire command string. A single character is not a special character. , produced by striking the CONTROL key and the G key simultaneously, followed by a space, causes the line currently being entered into the command string to be retyped. * , produced by striking the CONTROL key and the G key simultaneously, followed by an asterisk, causes all the lines typed by the user from the last TECO prompt (the asterisk) to be retyped. Typing a carriage return, enters a carriage return followed by a line feed into the command string. To enter a carriage return all by itself, it is necessary to type . Standard TECO PAGE 54 Notation The triple command is an immediate action command to RSX-11 TECO. See the appropriate appendix for more details. The character is used as an end-of-file terminator in some contexts on some operating systems. While its presence is usually harmless in disk files, it may cause premature end of file if the file is copied to other media (e.g., paper tape). TABLE 4-2: IMMEDIATE ACTION AIDS These immediate action commands are aids to the user. They have special meaning and take immediate effect only if they are typed as the very first keystroke after TECO's asterisk prompt. CHARACTER EXPLANATION ? If the previous command aborted because of an error, this immediate action command causes TECO to print the command string in error from the beginning of the current macro level up to and including the character that caused the error. / If TECO has just printed an error message, then typing this immediate action command causes TECO to type a more detailed explanation of the error on your terminal. [Not in TECO-11] Typing this immediate action command (as the first keystroke after TECO's prompt) causes TECO to immediately execute the LT command. This aid is useful in letting you "walk through" a file on a non-scope terminal. (If the EV flag is non-zero, then the T portion of this command is redundant and consequently is not performed.) Note that on TECO-11, this command has no effect if the text buffer pointer is at the end of the text buffer (.=Z). [Not in TECO-10] Typing this immediate action command, backspace, (as the first keystroke after TECO's prompt) causes TECO to immediately execute the -LT command. (If the EV flag is non-zero, then the T portion of this command is redundant and consequently is not performed.) Note that in TECO-11, this command has no effect if the text buffer Standard TECO PAGE 55 Notation pointer is at the beginning of the text buffer (.=B). [Not in TECO-10] *q Typing an asterisk as the first keystroke after TECO's prompt, is an immediate action command that causes TECO to place the previous command string into Q-register q. q is specified as the very next character typed after the asterisk and may be entered in either upper or lower case. [In TECO-8, only the *z command is permitted, and TECO will automatically type the z.] Note that since *q is itself an immediate action command, it may not be edited with other immediate action commands. In other words, you can't use DELETE to delete an incorrectly typed *. Although TECO accepts all 128 characters of the 7-bit ASCII character set, whether encountered in a macro, or entered directly into a command string from the terminal, in many operating systems, certain characters typed at a terminal are filtered out by the operating system and not passed to TECO. So that you can be aware of the possible inability to enter these characters directly into a TECO command string, we list them below in Table 4-3. Note that these characters are still valid characters to TECO, if you can get them into TECO, such as by entering them into a macro using the nI$ command. TABLE 4-3: OPERATING SYSTEM CHARACTER FILTERS SYSTEM CHARACTER SYSTEM's USE RT-11 ^A VT11 support [only if GT ON] ^B Background control [F/B systems only] ^E VT11 support [only if GT ON] ^F Foreground control [F/B systems only] ^O output control ^Q Terminal Synchronization RSTS/E ^O output control ^Q Terminal Synchronization ^S Terminal Synchronization VAX/VMS ^O output control ^Q Terminal Synchronization ^S Terminal Synchronization ^X Type-ahead control ^Y Process Interruption RSX-11 ^O output control Standard TECO PAGE 56 Notation ^Q Terminal synchronization ^S Terminal synchronization ^X Task control TOPS-10 ^C^C Job interruption ^O output control ^Q Terminal synchronization ^S Terminal synchronization ^T System status TOPS-20 ^C^C Job interruption ^O output control ^Q Terminal synchronization ^S Terminal synchronization ^T System status OS/8 ^B Background control [F/B systems only] ^F Foreground control [F/B systems only] ^Y Reboot indicator [F/B systems only] Standard TECO PAGE 57 Command Summary CHAPTER V LOGICAL COMMAND SUMMARY This chapter of this manual is devoted to a detailed description of the full TECO command set, functionally organized. It is assumed that the reader is familiar with the elementary TECO commands presented earlier. The commands described in this chapter are the commands implemented in TECO-11 Version 34, TECO-8 Version 7, and TECO-10 version 1. Some of the more obscure commands may not be present under some operating systems, in which case this is indicated by a note in the form [Not in TECO-x]. This manual also describes some (but not necessarily all) of the obscure commands that belong to one implementation of TECO but not to the other two implementations. Such commands are flagged by a note of the form [TECO-x only]. These commands are not to be considered part of the so-called "Standard TECO" and implementors should contact the TECO SIG before implementing these commands on other operating systems. Consult also the appendices for commands that are very operating system dependent. 5.0 TECO CHARACTER SET TECO accepts the full 7-bit ASCII character set, which is presented in Appendix ?. All characters have their 8th bit (the parity bit) trimmed off. Most terminals will not transmit and receive all of the ASCII codes; however, characters that are not available on the user's terminal may be inserted into the TECO text buffer by means of special commands which will be presented later in this chapter. TECO command strings may be entered using upper case characters, as indicated throughout this manual, or by using the corresponding lower case characters. A file which contains upper and lower case text may be edited in the same manner as a file which contains only upper case text, although dealing with lower case text from an upper case only terminal is inconvenient. TECO may be set to convert lower case alphabetics to upper case as they are typed in. Commands to enable or disable lower case type-in are presented later in this chapter. Control characters which are not special characters (i.e., immediate action commands) may be included in the text argument of any TECO command. When used in this manner, the control character must be produced by striking the CONTROL key and a character key simultaneously. TECO will echo a caret (or uparrow) followed by the character which was typed whenever most control characters are entered; the others, such as Standard TECO PAGE 58 Character Set (form feed) or (bell) echo as the function they perform. Many control characters are also TECO commands. When a control character is entered as a command, it may be produced by striking the CONTROL key and the character key simultaneously or else by typing a caret (uparrow) followed by the desired character. This is advantageous because all control characters echo normally when typed in the caret/character format and it is essential that some TECO commands such as caret/C (^C) never be typed inadvertantly in their control format. Several of the commands in TECO require a text string argument. The insert and search commands are examples of these. The TECO command language contains a general alternate form for all the commands which take a text argument as follows: @command/text/ A delimiting character (shown as a slash here) must precede and follow the text argument. Command is the actual TECO command to be executed (e.g., I, S, ER, ^A, !). This alternate form is frequently used to embed ESCAPE's in the text argument or to avoid the use of control characters as in the ^A command. Of course, the text argument itself may not contain the delimiting character. Standard TECO PAGE 59 File Selection Commands 5.1 FILE SPECIFICATION COMMANDS An input file must be specified whenever TECO is requested to accept text from any source other than the terminal. An output file must be specified whenever a permanent change is made to the input file. Input and output files are selected by means of file specification commands. File specifications are operating system dependent. The Operating Characteristics Appendices at the end of this manual fully describe file specifications for each operating system. Almost every editing job begins with at least one file specification command. Additional file specification commands may be executed during an editing job whenever required; however, TECO will only keep one input file and one output file selected at a time. TECO-11 allows for two input and two output "streams". These are called the primary and secondary streams. Most of the file selection commands operate on the currently selected stream. The primary input and output streams are initially selected when TECO is invoked. All of the other TECO commands (page manipulation, etc.) operate on the currently selected input and/or output stream. Table 5-1 lists the full file specification command set. Unless otherwise noted, all file specification commands leave the text buffer unchanged. Standard TECO PAGE 60 File Selection Commands TABLE 5-1A: FILE SPECIFICATION COMMANDS COMMAND FUNCTION ERfilespec$ Opens a file for input on the currently selected input stream. The "filespec" is the file specification and "$" signifies an ESCAPE. The "filespec" is in the standard format for the operating system upon which TECO is running. Consult the appropriate appendix for the format of "filespec" and details about any defaulting that takes place on unspecified fields. EWfilespec$ Opens a file for output on the currently selected output stream. The "filespec" is the file specification and "$" signifies an ESCAPE. EBfilespec$ The EB command may be used for files on file-structured devices only. It opens file "filespec" for input on the currently selected input stream and for output on the currently selected output stream. The EB command also keeps the unmodified file (the latest copy of the input file) available to the user in a system dependent fashion (See Appendices). :ERfilespec$ Performs a similiar function as the ER command, but returns a numeric value. A -1 indicates success and the file is open for input. A 0 indicates the specified file could not be found, and no error message is generated. Other errors (e.g., hardware errors, protection violations, etc.) generate messages and terminate command execution as usual. :EBfilespec$ Perform a similiar function as the EB command, but returns a numeric value. See the :ER command. Many editing jobs are most conveniently accomplished by using the EB (Edit Backup) command to open the designated input and output file, then terminating the job with either an EC command, which returns control to TECO, or an EX command, which exits from TECO. The EB command is recommended for normal editing. Standard TECO PAGE 61 File Selection Commands SWITCHES ON FILE SPECIFICATIONS Various system-dependent switches of the form /SWITCH are permitted on the file specification in ER, EW, and EB commands. These are described below. TABLE 5-1B: SWITCHES ON FILE SPECIFICATIONS System Switch Meaning OS/8 /S Ignore end-of-file (s) on input. (SUPER TECO mode) RSTS/E /MODE:n Use non-standard open mode /CLUSTERSIZE:n Specifies output file cluster size /B Read and write with unfiltered 8-bit /B+ Handle a BASIC-PLUS file /B2 Handle a BASIC-PLUS-2 file /n Handle BASIC-PLUS continuation character (&) in column n RSX-11 /RW Rewind magtape before opening file /CR Implied carriage control /-CR No (internal) carriage control /FT FORTRAN carriage control /B2 Handle a BASIC-PLUS-2 file TOPS-10 /GENLSN Generate line sequence numbers /SUPLSN Suppress line sequence numbers /PROTECT:n Specify protection code /ASCII File is ASCII /LSN <<>> /NOIN Don't put user type-in into log file (EL only) /NOOUT Don't put TECO's type-out into log file (EL only) /APPEND Append to existing output file (EW only) /SIXBIT Read file in pure SIXBIT /OCTAL Read file in octal /NONSTD Open DECtape in non-standard mode Standard TECO PAGE 62 File Selection Commands The following commands are used to close files and exit from TECO: TABLE 5-1C: FILE EXIT AND CLOSE EF Closes the current output file on the currently selected output stream. The EF command does not write the current contents of the buffer to the file before closing it. EC Moves the contents of the text buffer and the remainder of the current input file on the currently selected input stream to the current output file on the currently selected output stream, then closes those input and output files. Control remains in TECO. EC leaves the text buffer empty. EX Performs the same function as the EC command, but then exits from TECO. For safety reasons, this command is aborted if there is text in the text buffer but no output file is open. EG$ Performs the same function as the EX command, but then exits from TECO and re-executes the last COMPIL class command (.COMPILE, .LINK, .EXECUTE, etc.) [Not in TECO-11] EGtext$ Performs the same function as the EC command, but then exits from TECO and passes "text" to the operating system as a command string to be executed (see Appendices). :EGtext$ Performs the same function as the EC command, but then performs an operating system specific function. Consult the appendixes for details. The (caret/C) command terminates execution of the current command string and returns control to TECO's prompt. (Under TECO-8, the command currently acts as .) The ^C command causes an immediate abort and exit from TECO. Currently open files are not necessarily closed. See the Appendices for more details. Note that the second may not be entered in up-arrow mode. Standard TECO PAGE 63 File Selection Commands EK Kill the current output file on the currently selected output stream. This command purges the output file without closing it. This command is useful to abort an undesired edit from becomming permanent. Executing the EK command after an EW which is superseding an existing file leaves the old file intact. The EK command also "undoes" an EB command. (See Appendices for details.) ELfilespec$ Open the specified file for output as a log file. Any currently open log file will be closed. If the /APPEND switch is given, future logs will append to the file (if it already exists). The default is to supersede. All type-in to TECO and all type-out from TECO goes into the log file. The log file is automatically closed by the EX and TECO commands. [TECO-10 only] EZfilespec$ Same as EWfilespec$ however, if the output device is not a disk, this command first zeros (initializes) that device. This command is most useful when outputting to magtapes and DECtapes. In the case of a magtape, this command rewinds the magtape to load point. If the output device is a disk, this command works exactly like the EW command. [TECO-10 only] Standard TECO PAGE 64 File Selection Commands SECONDARY STREAM COMMANDS [Not in TECO-8, TECO-10, or RT-11] EP Switches the input to the secondary input stream. This command does not open or close any file and does not change the text buffer. ER$ Switches the input to the primary input stream. This command does not open or close any file and does not change the text buffer. EA Switches the output to the secondary output stream. This command does not open or close any file and does not change the text buffer. EW$ Switches the output to the primary output stream. This command does not open or close any file and does not change the text buffer. EIfilespec$ Opens a file as an indirect command file. Any further TECO requests for terminal input will come from this file. At end-of-file, the file will be closed and terminal input will again come from the terminal. Any error message will also close the indirect command file and switch input back to the terminal. Note that this command only presets where input will come from; it does not "splice" the file's data into the current command string. End-of-file in the indirect command file does not automatically start execution of commands. The indirect file must have two adjacent ESCAPEs to start its execution. All commands encountered in the indirect file will have their normal TECO meaning (as opposed to any immediate action meaning). For example, a encountered in an indirect file will not erase the command line in which it occurs. Rather, it will be treated as the TECO ^Uqtext$ command. The only exception to this rule is the command which means that execution of the command string is to commence and upon conclusion, further TECO command input will continue from the indirect file at the point following the . The exact operation of this command under TECO-10 is slightly different than described here. Consult Appendix E for details. EI$ If an indirect command file is active, this command will close it and resume terminal input from the terminal. Any portion of the Standard TECO PAGE 65 File Selection Commands file after a double ESCAPE which has not yet been read is discarded. If no indirect file is already open, this command has no effect. This command works differently in TECO-10. Standard TECO PAGE 66 File Selection Commands WILDCARD COMMANDS [Not in TECO-8, TECO-10, or RT-11] ENfilespec$ This command presets the "wild card" lookup filespec. This is the only filespec that can contain any wild card notations. See the Appendices for the allowed wild fields in each operating system. This command is only a preset; it does not open, close or try to find any file. EN$ Each occurence of this command will load the filespec buffer with the next occurence of the preset wild card lookup filespec. The G* command (see 2.9) can be used to retrieve the fully expanded filespec. If no more occurences of the wild card filespec exist, the ?FNF error is returned. :EN$ Performs a similiar function as the EN$ command, but returns a numeric value. A -1 indicates another match of the wild card filespec exists and has been loaded into the filespec buffer. A 0 indicates no more occurences exist. No error message is generated. DIRECT I/O TO Q-REGISTERS EQqfilespec$ Read specified file into Q-register q. No s or s are removed from the file, except that trailing s are discarded. The only switch permitted on the filespec in this command is the /DELETE switch which means delete the file after reading it providing the file is less than 500 characters long. This command supports the pseudo-device TMP:, for TMPCOR. Consult the appropriate appendix for details. [TECO-10 only] E%qfilespec$ Create the specified file. The contents of the file will be the contents of Q-register q with no s deleted. No switches are permitted on the filespec of this command. This command supports the pseudo-device TMP:, for TMPCOR. Consult the appropriate appendix for details. [TECO-10 only] The filespec argument to the file selection commands in TECO-11 can use the string building characters described in Table 5-8A (see section 5.8). The Q* construct is especially Standard TECO PAGE 67 File Selection Commands useful in TECO-11. Standard TECO PAGE 68 Page Manipulation Commands 5.2 PAGE MANIPULATION COMMANDS In the sections following, the letters "m" and "n" are used in command formats to indicate numerical arguments. These may be either simple integers or expressions of arbitrary complexity. The following commands permit whole pages of text to be read into the text buffer from an input file or written from the buffer onto an output file. TABLE 5-2: PAGE MANIPULATION COMMANDS COMMAND FUNCTION A Appends the next page of the input file to the contents of the text buffer, thus combining the two pages of text on a single page with no intervening form feed character. This command takes no argument. To perform n Appends, use the n construct. Note that nA is a completely different command. :A Equivalent to the A command except that a value is returned. -1 is returned if the append succeeded, and 0 is returned if the append failed because the end-of-the-input-file had previously been reached (^N flag is -1 at start of this command). [Not in TECO-8] n:A Appends n lines of text from the input file to the contents of the text buffer. A value is returned indicating whether or not there were in fact n lines remaining in the input file. -1 is returned if the command succeeded. 0 is returned if end-of-file on the input file was encountered before all n lines were read in. Note that the command can succeed and yet read in fewer than n lines in the case that the text buffer fills up. [Not in TECO-8] Y Clears the text buffer and then reads the next page of the input file into the buffer. As the Y command can result in the loss of data, it is not permitted under certain circumstances (see ED flag in 5.14). :Y Same as the Y command but a value is returned. -1 is returned if the Yank succeeded. 0 is returned if the Yank failed because the end-of-file had been reached on the input file prior to the initiation of this command. [Not in TECO-8] EY Same as the Y command, but it will always succeed since its action is not dependent on the value of the Yank Standard TECO PAGE 69 Page Manipulation Commands Protection bit in the ED flag. :EY Same as the :Y command, but it will always succeed since its action is not dependent on the value of the Yank protection bit in the ED flag. [Not in TECO-8] PW Write the contents of the buffer onto the output file and append a form feed character. The buffer is not cleared and the pointer position remains unchanged. nPW Executes the PW command n times, where n must be a non-zero positive integer. m,nPW Writes the contents of the buffer from the m+1th character through and including the nth character onto the output file. m and n must be positive integers and m should be less than n. A form feed is not appended to this output, nor is the buffer cleared. The pointer position remains unchanged. HPW Equivalent to the PW command except that a form feed character is not appended to the output. (See 5.13 for the definition of H.) P Writes the contents of the buffer onto the output file, then clears the buffer and reads the next page of the input file into the buffer. A form feed is appended to the output file if the last page read in (with a P, Y, or A command) was terminated with a form feed. :P Same as the P command except that a value is returned. -1 is returned if the command succeeded. 0 is returned if the command failed because the end-of-file on the input file had been reached prior to the initiation of this command. [Not in TECO-8] nP Executes the P command n times, where n must be a non-zero positive integer. m,nP Equivalent to m,nPW. HP Equivalent to HPW. All of the input commands listed in Table 5-2 assume that the input file is organized into pages small enough to fit into available memory. If any page of the input file contains more characters than will fit into available memory, the input command will continue reading characters into the buffer until a line feed is encountered when the buffer is two thirds full. See the appendices for more details. Special techniques for handling pages in excess of the buffer capacity will be developed later in Standard TECO PAGE 70 Page Manipulation Commands this chapter. Standard TECO PAGE 71 Buffer Pointer Manipulation Commands 5.3 BUFFER POINTER MANIPULATION COMMANDS Table 5-3 summarizes the complete buffer pointer manipulation command set. These commands may be used to move the pointer to a position between any two characters in the buffer, but they will not move the pointer across either buffer boundary. If any R or C command attempts to move the pointer backward beyond the beginning of the buffer or forward past the end of the buffer, the command is ignored and an error message is printed. If any L command attempts to exceed the buffer boundaries in this manner, the pointer is positioned at the boundary which would have been exceeded and no error message is printed. TABLE 5-3: BUFFER POINTER MANIPULATION COMMANDS COMMAND FUNCTION J Moves the pointer to a position immediately preceding the first character in the buffer. Equivalent to 0J. nJ Moves the pointer to a position immediately following the nth character in the buffer. ZJ Moves the pointer to a position immediately following the last character in the buffer. n:J Same as the nJ command except that if pointer position n is outside of the buffer, the pointer does not move and a value of 0 is returned. If the command succeeded, a value of -1 is returned. [TECO-10 only] C Advances the pointer forward across one character. nC Executes the C command n times. If n is positive, the pointer is moved forward across n characters. If n is negative, the pointer is moved backward across n characters. If n is zero, the pointer position is not changed. n:C Same as nC except that a value is returned. If the command succeeded, -1 is returned. If the command failed, the pointer does not move and a value of 0 is returned. [TECO-10 only] :C Equivalent to 1:C. -C Equivalent to -1C. Standard TECO PAGE 72 Buffer Pointer Manipulation Commands R Moves the pointer backward across one character. nR Executes the R command n times. If n is positive, the pointer is moved backward across n characters. If n is negative, the pointer is moved forward across n characters. If n is zero, the position of the pointer is not changed. -R Equivalent to -1R. n:R Same as the nR command except that a value is returned. If the command succeeded, then a value of -1 is returned. If the command failed, then the buffer pointer is not moved and a value of 0 is returned. [TECO-10 only] :R Equivalent to 1:R. L Advances the pointer forward across the next line terminator (line feed, vertical tab, or form feed) and positions it at the beginning of the next line. nL Executes the L command n times. A positive value of n advances the pointer to the beginning of the nth line following its current position. A negative value of n moves the pointer backwards to the beginning of the nth complete line preceding its current position. If n is zero, the pointer is moved to the beginning of the line on which it is currently positioned. -L Equivalent to -1L. Standard TECO PAGE 73 Text Type-out Commands 5.4 TEXT TYPE-OUT COMMANDS Table 5-4 summarizes the commands which may be used to type out part or all of the contents of the buffer for examination. These commands do not move the buffer pointer. TABLE 5-4: TEXT TYPE-OUT COMMANDS COMMAND FUNCTION T Types out the contents of the buffer from the current position of the buffer pointer through and including the next line terminator character. nT Types n lines. If n is positive, the n lines following the current position of the pointer are typed. If n is negative, the n lines preceding the pointer are typed. If n is zero, the contents of the buffer from the beginning of the line on which the pointer is located up to the pointer is typed. -T Equivalent to -1T. m,nT Types out the contents of the buffer from the m+1th character through and including the nth character in the buffer. M should be less than n. .,.+nT Types out the n characters immediately following the buffer pointer. N should be greater than zero. (See 5.13 for the definition of .) .-n,.T Types the n characters immediately preceding the buffer pointer. N should be greater than zero (i.e., -n should be less than zero). HT Types out the entire contents of the buffer. V Types out the current line. Equivalent to 0TT. nV Types out n-1 lines on each side of the current line. Equivalent to 1-nTnT. [Not in TECO-8] n^T Types out the character whose ASCII code is n. This can be used to output any ASCII character to the terminal. ^Atext Types "text" on the terminal. While the command may be entered as or Caret/A, the closing character must be a . A numeric argumet must not be specified with this command. Standard TECO PAGE 74 Text Type-out Commands @^A/text/ Equivalent to the ^A command except that the text to be printed may be bracketed with any character. This avoids the need for the closing . Standard TECO PAGE 75 Text Type-out Commands Users may stop or delay the output of any typeout command by typing certain special charactes at the keyboard. These characters must be entered while TECO is actually in the process of typing out at the terminal (via a T, V, ^A, or :G command) in order to have the desired effect. These characters are described in the table below: TABLE 5-4B: TYPE-OUT TIME COMMANDS CHARACTER FUNCTION Typing stops the terminal output of the current command string. TECO continues running and continues to send characters to the terminal, however, these characters are suppressed from actually printing on the terminal. Printing of characters can be resumed by typing another while typeout is currently being suppressed. TECO cancels this suppression the next time that it prompts for command string input. A TECO macro can cancel the effect of any by setting the 16's bit in the ET flag (see paragraph 5.14). Typing freezes the terminal output of the current command string. TECO stops running the next time it tries to output a character to the user's terminal. TECO will wait until a is typed to indicate that resumption of typing is to occur. Causes TECO to resume any type-out that was frozen via use of the command described above. This character has this effect only while typout is frozen. Striking any key other than or while typeout is frozen will have unpredictable results; consult the appropriate operating system manual. Note that , , and are legal TECO commands. When a TECO command is not typing on the terminal (such as when you are entering a command string), these characters do not have the effect described above. In such cases, they may be entered into your command string just like any other control character (except under operating systems that filter out these characters). Standard TECO PAGE 76 Deletion Commands 5.5 DELETION COMMANDS Table 5-5 summarizes the text deletion commands, which permit deletion of single characters, groups of adjacent characters, single lines, or groups of adjacent lines. TABLE 5-5: TEXT DELETION COMMANDS COMMAND FUNCTION D Delete the first character following the current position of the buffer pointer. nD Execute the D command n times. If n is positive, the n characters following the current pointer position are deleted. If n is negative, the n characters preceding the current pointer position are deleted. If n is zero, the command is ignored. -D Equivalent to -1D. m,nD Equivalent to m,nK. [TECO-11 only] n:D Same as nD but returns a value (-1 if command succeeds, 0 if command failed because the range of characters to be deleted fell outside the text buffer). [TECO-10 only] FDtext$ Same as FStext$$ [TECO-10 only] @FD// Equivalent to FDtext$ except that the character is not necessary. FKtext$ Executes a Stext$ command then deletes all the text from the initial pointer position to the new pointer position. [TECO-10 only] @FK/text/ Equivalent to FKtext$ except that "text" may contain any character, including , other than the delimiter (shown here as /). FR$ Equivalent to -nD where n is the length of the last insert, get or search command. See the description of the FRtext$ command in section 5.6 for more details. @FR// Form of the FR$ command that does not require use of the character. K Deletes the contents of the buffer from the current Standard TECO PAGE 77 Deletion Commands position of the buffer pointer through and including the next line terminator character. nK Executes the K command n times. If n is positive, the n lines following the current pointer position are deleted. If n is negative, the n lines preceding the current pointer position are deleted. If n is zero, the contents of the buffer from the beginning of the line on which the pointer is located up to the pointer is deleted. It is not an error if more lines are specified than occur when a boundary of the text buffer is encountered. -K Equivalent to -1K. m,nK Deletes the contents of the buffer from the m+1th character through and including the nth character. M should be less than n. The pointer moves to position m. The ?POP error message (or its equivalent) is issued if either m or n is out of range. .,.+nK Equivalent to nD. Deletes the n characters immediately following the buffer pointer. N should be greater than zero. .-n,.K Equivalent to -nD. Deletes the n characters immediately preceeding the buffer pointer. N should be greater than zero. HK Deletes the entire contents of the buffer. Standard TECO PAGE 78 Insertion Commands 5.6 INSERTION COMMANDS Table 5-6 lists the full text insertion command set. All text insertion commands cause the string of characters specified in the command to be inserted into the text buffer at the current position of the buffer pointer. Following execution of an insertion command, the pointer will be positioned immediately after the last character of the insertion. The length of an insertion command is limited primarily by the amount of memory available for command string storage. During normal editing jobs, it is most convenient to limit insertions to about 10 or 15 lines each. When command string space is about to run out, TECO will ring the terminal's bell after each character that is typed. Attempting to enter too many characters into the current command string causes unpredictible results to occur and should be avoided. Use of the DELETE key should be attempted to shorten the command to permit its termination. From the time you hear the first warning bell, you have 10 characters to type in order to clean up your command line. When typing in a command string from the terminal, there are some characters that cannot be conviently typed. This is because certain characters are filtered out by the operating system and/or may perform special functions, and some characters are immediate action commands and have special effect. If it is desired to insert such characters into the text buffer, the nI$ command may be used. The nI$ command will insert any ASCII character into the buffer, including the special characters that could not ordinarily be typed at a terminal. TABLE 5-6: TEXT INSERTION COMMANDS COMMAND FUNCTION Itext$ Where "text" is a string of ASCII characters terminated by an ESCAPE, which echoes as a dollar sign. The specified text string is entered into the buffer at the current position of the pointer, with the pointer positioned immediately after the last character of the insertion. nI$ This form of the I command inserts the single character whose 7-bit ASCII code is n into the buffer at the current position of the buffer pointer. (n is taken modulo 128.) It may be used to insert characters that are not available on the user's terminal or special characters such as DELETE which may not be inserted with the standard I command while it is being typed into a command string from a terminal. Standard TECO PAGE 79 Insertion Commands text$ Where is a tabulation, produced by striking the TAB key or by pressing the CONTROL key and the I key simultaneously. The TAB character echoes as one to eight spaces on most terminals. This command is equivalent to the I command except that the tabulation is part of the text which is inserted into the buffer. @I/text/ Equivalent to the I command except that the text to be inserted may contain ESCAPE characters. A delimiting character (shown as a slash here) must precede and follow the text to be inserted. This delimiter may be any non-special character which does not appear in the insertion. This @ and alternate delimiter construct may be used in all commands which take a string argument. n@I// Equivalent to the nI$ command, but does not require the ESCAPE character. Any delimiting character (shown as slash here) can be used. FRtext$ Equivalent to "-nDItext$", where "n" is obtained from the most recent occurrence of the following: (a) the length of the most recent string found by a successful search command, (b) the length of the most recent text string inserted (including insertions from the FS, FN, or FR commands), or (c) the length of the string retrieved by the most recent "G" command. In effect, the last string inserted or found is replaced with "text", provided that the pointer has not been moved. [Not in TECO-8] @FR/text/ Equivalent to "FRtext$", except that "text" may contain ESCAPE characters. The delimiter (shown as a slash here) must not be present in "text". [Not in TECO-8] Standard TECO PAGE 80 Search Commands 5.7 SEARCH COMMANDS In many cases, the easiest way to position the buffer pointer is by means of a character string search. The search commands cause TECO to scan through text until a specified string of characters is found, and then position the buffer pointer at the end of the string. A character string search always begins at the current position of the pointer and proceeds either in a forward direction or in a reverse direction within the current buffer or in a forward direction through the file. The last explicitly specified search string is always remembered by TECO. If a search command is specified with a null search string argument, the last explicitly defined search string will be used. This saves having to retype a complex or lengthy search string on successive search commands. Normally a search will start at the current pointer position and the search will proceed in a forward direction. However, if the numeric argument to the search command is negative, then the search will proceed in the reverse direction. This is known as a backwards search. Normally searches are "unbounded". That is, they search from the current position to the end of the text buffer (or in the case of backwards searches, until the beginning of the buffer. A bounded search will only search from the current position to the specified bound limit. If the search string is found within the bound limits, the pointer is positioned immediately after the last character in the string. If the string cannot be found, the pointer is left unchanged. A special case of the bounded search occurs when the upper and lower bound limits are the same. In such a case, the search command is called an anchored search, and is used to compare the search argument against the character string immediately following the text buffer pointer. TECO-8 does not permit backward searches, bounded searches, or anchored searches. This is a general property and will not be specifically mentioned again in the following tables. TABLE 5-7A: SEARCH COMMANDS Stext$ Where "text" is a string of characters terminated by an ESCAPE. This command searches the text buffer for the next occurrence of the specified character string following the current position of the buffer pointer. If the string is found, the pointer is positioned after the last character in the string. If it is not found, the pointer is Standard TECO PAGE 81 Search Commands positioned immediately before the first character in the buffer (i.e., a 0J is executed) and an error message is printed. nStext$ This command searches for the nth occurrence of the specified character string, where n is greater than zero. It is identical to the S command in other respects. -nStext$ Identical to "nStext$" except that the search proceeds in the reverse direction. If the string is not found, the pointer is positioned immediately before the first character in the buffer and an error message is printed. If the pointer is positioned at the beginning of or within an occurrence of the desired string, that occurrence is considered to be the first one found and the pointer is positioned after the last character in the string. -Stext$ Equivalent to -1Stext$. Ntext$ Performs the same function as the S command except that the search is continued across page boundaries, if necessary, until the character string is found or the end of the input file is reached. This is accomplished by executing an effective P command after each page is searched. If the end of the input file is reached, an error message is printed and it is necessary to close the output file and re-open it as an input file before any further editing may be done on that file. The N command will not locate a character string which spans a page boundary. nNtext$ This command searches for the nth occurrance of the specified character string, where n must be greater than zero. It is identical to the N command in other respects. _text$ The underscore command is identical to the N command except that the search is continued across page boundaries by executing effective Y commands instead of P commands, so that no output is generated. Since an underscore search can result in the loss of data, it is aborted under the same circumstances as the Y command (see ED flag in 5.14). Note that underscore is backarrow on some terminals. n_text$ This command searches for the nth occurrence Standard TECO PAGE 82 Search Commands of the specified character string, where n must be greater than zero. It is identical to the _ command in other respects. E_text$ Same as _text$ command except that effective EY (rather than Y) commands are used. Thus, this command is never aborted and is not controlled by the Yank protection bit in the ED flag. nE_text$ Same as n_text$ command except that effective EY (rather than Y) commands are used. TABLE 5-7B: BOUNDED SEARCH COMMANDS m,nStext$ System specific command. Consult appendices. nFBtext$ Identical to nStext$ except that only n lines are searched. If n is positive, then the search proceeds forwards over n lines. If n is negative, then the search proceeds backwards over n lines. If n is 0, then the search proceeds backwards to the start of the current line. The argument, n, has the same meaning as the argument to the nL, nX, or nK commands. FBtext$ Equivalent to 1FBtext$. -FBtext$ Equivalent to -1FBtext$. m,nFBtext$ Performs the same function as the nStext$ command, but m and n serve as bounds for the search. The search will only proceed between pointer positions m and n inclusive. That is, in order for a search to be successful, the first character to match must occur between buffer pointer positions m and n. If mn, then the search proceeds in the reverse direction. The string that is matched is permitted to extend beyond the search limits specified, provided that it begins within bounds. TABLE 5-7C: SEARCH AND REPLACE COMMANDS FStext1$text2$ Executes an Stext1$ command, then deletes "text1" and replaces it with "text2". Standard TECO PAGE 83 Search Commands nFStext1$text2$ Executes an nStext1$ command, then deletes "text1" and replaces it with "text2". FNtext1$text2$ Executes an Ntext1$ command, then deletes "text1" and replaces it with "text2". nFNtext1$text2$ Executes an nNtext1$ command, then deletes "text1" and replaces it with "text2". F_text1$text2$ Executes a _text1$ command then deletes "text1" and replaces it with "text2". Because of the danger of losing data, this command will be aborted if it tries to yank in a new page over a non-empty text buffer. (See ED flag for more details.) [not in TECO-10] nF_text1$text2$ Executes an ntext1$ command then deletes "text1" and replaces it with "text2". [Not in TECO-10] FCtext1$text2$ Executes an FBtext1$ command then deletes "text1" and replaces it with "text2". nFCtext1$text2$ Executes an nFBtext1$ command, then deletes "text1" and replaces it with "text2". m,nFCtext1$text2$ Executes an m,nFBtext1$ command, then deletes "text1" and replaces it with "text2". FDtext$ Identical to the "FStext$$" command. [TECO-10 only] nFDtext$ Identical to the "nFStext$$" command. [TECO-10 only] nFKtext$ Searches for the nth following occurrence of "text" and then deletes all characters in the text buffer between the pointer positions before and after the search. [TECO-10 only] FKtext$ Equivalent to 1FKtext$ [TECO-10 only] The FS, F_, and FN commands above can also be reverse searches (n<0) or bounded searches (m,n argument). A reverse F_ or FN acts like a reverse S; that is the search terminates when the beginning of the text buffer is encountered. If a search command is entered without a text argument, TECO will execute the search command as though it had been entered with the same character string argument as the last search Standard TECO PAGE 84 Search Commands command entered. For example, suppose the command "STHE END$" results in an error message, indicating that character string "THE END" was not found on the current page. Entering the command "N$" causes TECO to execute an N search for the same character string. Although the text argument may be omitted, the command terminator (ESCAPE) must always be entered. Any of the search commands listed above may be preceded by a colon (:). The colon is a search command modifier which supresses error message generation and causes the search command to "return a value" instead. That is, the next sequential command is executed with an argument of zero if the search fails. If the search succeeds, the next sequential command is executed with an argument of -1. If the next sequential command belongs to the class of commands which require a positive argument, the -1 is interpreted as the largest positive number permitted in the implementation. If the next sequential command does not require an argument, it is executed as it stands. If an unmodified search command in a command loop (section 5.10) is immediately followed by a semi-colon (section 5.12), it is treated as if it were a colon-modified search. The following examples illustrate use of the colon modifier. COMMANDS: n:Stext$ m,n:Stext$ n:Ntext$ n:_text$ n:FStext1$text2$ m,n:FStext1$text2$ n:FNtext1$text2$ etc. FUNCTION: In each case, execute the search command. If the search is successful, execute the next sequential command with an argument of -1. If the search fails, execute the next command with an argument of zero. If the next command does not require a numeric argument, execute it as it stands. ::Stext$ Compare command. The ::S command is not a true search. If the characters in the buffer immediately following the current pointer position match the search string, the pointer is moved to the end of the string and the command returns a value of -1; i.e., the next command is executed with an argument of -1. If the characters in the buffer do not match the string, the pointer is not moved and the command returns a value of 0. Identical to ".,.:FBtext$". The @ character is another search command modifier. Inserting an @ character between the numeric argument of any Standard TECO PAGE 85 Search Commands search command and the command itself causes TECO to accept the first character following the command as a delimiting character which will also be the command terminator. This character may be any character which does not appear in the search command argument, except for special characters. When the @ command is used, search command arguments may contain ESCAPE characters. The following examples illustrate use of the @ command modifier. COMMANDS: n@S/text/ m,n@FB/text/ n@N/text/ n@_/text/ n@FS/text1/text2/ m,n@FC/text1/text2/ n@FN/text1/text2/ etc. FUNCTION: In each case, execute the search command with text string "text" as an argument. This argument must be preceded and followed by a delimiting character which does not appear in the argument (a slash is shown here). The search command argument (and the replacement string in FS and FN) may contain ESCAPE characters. Note however, that typing two consecutive ESCAPEs when entering a command string from a terminal is considered to be an immediate action command, so a command such as FSFOO$$ if typed in directly would automatically cause the command string to begin execution. If you want to continue typing commands into the command string after two ESCAPEs, you can use the artifice of inserting them without actually typing two ESCAPEs in a row. For example, typing will suffice. Needless to say, these constructs may be combined. COMMANDS: n:@FB/text/ m,n:@S/text/ n:@N/text/ n:@_/text/ n:@FS/text1/text2/ m,n:@FC/text1/text2/ n:@FN/text1/text2/ etc. Standard TECO PAGE 86 Search Arguments 5.8 SEARCH ARGUMENTS TECO builds the search string by loading its search string buffer from the supplied search command argument. To facilitate the entry of special characters or frequently used character sequences, the argument may contain special string building characters. Table 5-8A lists the string building characters and their functions. (The notation x means the character followed by the character x.) TECO-8 does not support the extended String Build functions or Match Control Constructs that begin with . This is a general property and will not be repeated in the following tables. TABLE 5-8A: STRING BUILDING CHARACTERS CHARACTER FUNCTION ^ A caret (uparrow) character in a search command argument indicates that the character following the caret is to be used as its control character equivalent (i.e., octal 100 to 137 is used as octal 0 to 37). Combination with other string building or match control characters is legal. For example, the combination Caret/Q/Caret is the same as /Caret which means literally Caret. This string building character can be disabled by using the ED flag (see 5.14 and Appendices). A character in a search command argument indicates that the character following the is to be used literally rather than as a match control character. Same as . A character in a search command argument indicates that the character following the is to be used as the equivalent character in the lower case ASCII range (i.e., octal 100 to 137 is treated as octal 140 to 177). Two successive characters in a string argument indicate to TECO that all following alphabetic characters in this string are to be converted to lower case unless an explicit ^W is given to override this state. This state continues until the end of the string or until a ^W^W construct is encountered. [TECO-10 only] Standard TECO PAGE 87 Search Arguments A character in a search command argument indicates that the character following the is to be used as the equivalent character in the upper case ASCII range (i.e., octal 140 to 177 is treated as octal 100 to 137). Two successive characters indicates to TECO that all following alphabetic characters in this string are to be converted to upper case unless an explicit ^V is encountered to override this state. This state continues until the end of the string or until a ^V^V construct is encountered. [TECO-10 only] Qq Qq indicates that the string stored in Q-register q is to be used in the position occupied by the ^EQq in the search string. Q registers are discussed in section 5.9 below. [Not in TECO-10] Uq Uq indicates that the character whose ASCII code is specified by the numeric storage area of Q-register q is to be used in the position occupied by the ^EUq in the search string. [TECO-11 only] String build characters are also permitted inside the string arguments of the O, EB, ER, EW, and EG commands. TECO executes a search command by attempting to match the search command argument character-by-character with some portion of the input file. There are several special control characters that may be used in search command arguments. These characters alter the usual matching process that occurs when a search is executed. Table 5-8B lists the match control characters and their functions. TABLE 5-8B: MATCH CONTROL CHARACTERS CHARACTER FUNCTION A character indicates that this position in the character string may be any character. TECO accepts any character as a match for . A character indicates that any separator character is acceptable in this position. TECO accepts any character that is not a letter (upper Standard TECO PAGE 88 Search Arguments or lower case A to Z) or a digit (0 to 9) as a match for . TECO accepts any character as a match for the character combination EXCEPT the character which follows the . Other combined /special character are legal also. For example, the combination D means match anything except a digit in this position. A A indicates that any alphabetic character is acceptable in this position. TECO accepts any letter (upper or lower case A to Z) as a match for A. B Same as . C C indicates that any character that is legal as part of a symbol constituent is acceptable in this position. TECO accepts any letter (upper or lower case A to Z), any digit (0 to 9), a dot (.), or a dollar sign ($) as a match for C. Additional characters may be matched depending upon the operating system; consult the appropriate appendix. D D indicates that any digit is acceptable in this position. TECO accepts any digit (0 to 9) as a match for D. Gq Gq indicates that any character contained in Q-register q is acceptable in this position. For example, if Q-register A contains "A*:" then TECO accepts either A, *, or : as a match for GA. [Not in TECO-10] L L indicates that any line terminator is acceptable in the position occupied by L in the search string. Line terminators are line feed, vertical tab, and form feed. M M indicates that any number of occurrences of the immediately following character or match control construct is acceptable at this position. [TECO-10 only] R R indicates that any alphanumeric character is acceptable in this position. TECO accepts any letter (upper or lower case A to Z) or digit (0 to 9) as a match for R. S S indicates that any non-null string of Standard TECO PAGE 89 Search Arguments spaces and/or tabs is acceptable in the position occupied by S. V V indicates that any lower case alphabetic character is acceptable in this position. TECO accepts any lower case letter (a to z) as a match for V. W W indicates that any upper case alphabetic character is acceptable in this position. TECO accepts any upper case letter (A to Z) as a match for W. X Equivalent to . indicates that the character whose ASCII octal code is nnn is acceptable in this position. [TECO-10 only] [a,b,c,...] [a,b,c,...] indicates that any one of the specified characters is acceptable in this position. One or more characters or other match control constructs are permitted. Any character matched by the exclusive OR of all the conditions specified will be accepted in the position occupied by the [a,b,c...]. [TECO-10 only] Standard TECO PAGE 90 Q-Registers 5.9 Q-REGISTERS TECO provides 36 data storage registers, called Q-registers, which may be used to store single integers and/or ASCII character strings. Each Q-register is divided into two storage areas. In the number storage area, each Q-register can store one signed integer. In the text storage area, each Q-register can store an ASCII character string which may be either text or a TECO command string. Each Q-register has a single character name which is one of the letters A to Z or one of the digits 0 to 9. Upper and lower case letters may be used interchangeably. In this manual, a Q-register name is indicated by a lower case "q", which stands for any one of the 36 Q-registers. TECO-10 allows additional Q-registers besides the 36 described above. Consult appendix E for further details. Table 5-9A lists the commands which permit characters to be loaded into the Q-registers. TABLE 5-9A: Q-REGISTER LOADING COMMANDS COMMAND FUNCTION ^Uqstring$ This command inserts character string "string" into the text storage area of Q-register "q". When entering a command string from the terminal ^U must be specified in the caret/U format, since the character is the line erase immediate action command. @^Uq/string/ Equivalent to the ^Uqstring$ command except that the character string to be inserted into Q-register q may contain ESCAPE characters. The insertion must be delimited before and after by any character (a slash is shown here) which does not appear in the insertion. :^Uqstring$ This command appends character string "string" to the text storage area of Q-register "q". :@^Uq/string/ Equivalent to the :^Uqstring$ command except that the character string to be appended to Q-register q may contain ESCAPE characters. The appended string must be delimited before and after by any character (a slash is shown here) which does not appear in the appended string. n^Uq$ This form of the ^Uq$ command inserts the single character whose 7-bit ASCII code is n into the text storage area of Q-register "q". Standard TECO PAGE 91 Q-Registers n@^Uq// Equivalent to the n^U command, but does not require the ESCAPE character. Any delimiting character (shown as slash here) can be used. n:^Uq$ This form of the :^Uq$ command appends the single character whose 7-bit ASCII code is n to the text storage area of Q-register "q". n:@^Uq// Equivalent to the n:^U command, but does not require the ESCAPE character. nUq Put n in the number storage area of Q-register q. m,nUq Equivalent to the nUqm command. That is, this command puts the number n into the numeric storage area of Q-register q and then returns the number m as a value. The command UAUB is useful at the beginning of a macro to save the two arguments specified on the macro call. (See the m,nMq command below.) n%q Add n to the contents of the number storage area of Q-register q. The resulting value contained in Q-register q is used as a numeric argument for the next command. If the next command does not require a numeric argument, this value is discarded. n%q$ Same as n%q but discards the value returned. %q Equivalent to 1%q. nXq Move n lines into Q-register q, where n is a signed integer. If n is positive, the n lines following the current pointer position are copied into the text storage area of Q-register q. If n is negative, the n lines preceding the pointer are copied. If n is zero, the contents of the buffer from the beginning of the line on which the pointer is located up to the pointer is copied. The pointer is not moved. The text is not deleted. Xq Equivalent to 1Xq. -Xq Equivalent to -1Xq. m,nXq Copy the contents of the buffer from the m+1th character through and including the nth character into the text storage area of Q-register q. M and n must be positive, and m should be less than n. .,.+nXq Copy the n characters immediately following the Standard TECO PAGE 92 Q-Registers buffer pointer into the text storage area of Q-register q. N should be greater than zero. .-n,.Xq Copy the n characters immediately preceeding the buffer pointer into the text storage area of Q-register q. N should be greater than zero. n:Xq Append n lines to Q-register q, where n is a signed integer. If n is positive, the n lines following the current pointer position are appended to the text storage area of Q-register q. If n is negative, the n lines preceding the pointer are appended. If n is zero, the contents of the buffer from the beginning of the line on which the pointer is located up to the pointer is appended. The pointer is not moved. The colon construct for appending to a Q-register can be used with all forms of the X command. ]q Pop from the Q-register push-down list into Q-register q. Any previous contents of Q-register q are destroyed. Both the numeric and text parts of the Q-register are loaded by this command. The Q-register push-down list is a last-in first-out (LIFO) storage area. This command does not use numeric values. Numeric values are passed through this command as if it did not occur. This allows macros to restore Q-registers and still return numeric values. [Not in TECO-8] :]q Just like the ]q command except that a numeric value is returned. A -1 indicates that there was another item on the Q-register push-down list to be popped. A 0 indicates that the Q-register push-down list was empty (and Q-register q was not modified). [Not in TECO-8] Table 5-9B lists the commands which permit data to be retrieved from the Q-registers. TABLE 5-9B: Q-REGISTER RETRIEVAL COMMANDS COMMAND FUNCTION Gq Copy the contents of the text storage area of Q-register q into the buffer at the current position of the buffer pointer, leaving the pointer positioned after the last character copied. Standard TECO PAGE 93 Q-Registers :Gq Print the contents of the text storage area of Q-register q on the terminal. The text buffer and buffer pointer are not changed by this command. Qq Use the integer stored in the number storage area of Q-register q as the argument of the next command. nQq Return the ASCII value of the (n+1)th character in Q-Register q. The argument n must be between 0 and the Q-register's size minus 1. If n is out of range, a value of -1 is returned. For people who think in "0-origin mode", nQq returns ASCII code for the nth character in the Q-register. For example, if Q-register A contains "xyz", then 0QA will return the ASCII code for "x" and 1QA will return the ASCII code for "y". Characters within a Q-register are numbered the same way that characters in the text buffer are numbered. The initial character is at character position 0, the next character is at character position 1, etc. Mq Execute the contents of the text storage area of Q-register q as a command string. Mq commands may be nested recursively as far as TECO's push down storage will permit. nMq Execute the contents of the text storage area of Q-register q as a command string and use n as a numeric argument for the first command in this string. m,nMq Execute the contents of the text storage area of Q-register q as a command string and use m,n as a numeric argument for the first command in this string. [q Copy the contents of the numeric and text storage areas of Q-register q into the Q-register push-down list. This command does not alter either the numeric or text storage areas of Q-register q. This command does not use numeric values. Numeric values are passed through this command as if it did not occur. This allows macros to save temporary Q-registers and still accept numeric values. The command sequence [A ]B copies the text and numeric value from Q-register A to Q-register B. [Not in TECO-8] Standard TECO PAGE 94 Command Loops 5.10 COMMAND LOOPS The user may cause a command string to be executed any number of times by placing the command string within angle brackets and preceding the brackets with a numeric argument which designates the number of iterations. Iterated command strings are called command loops. Loops may be nested in such a way that one command loop contains another command loop, which, in turn, contains other command loops, and so on. The maximum depth to which command loops may be nested is determined by the size of TECO's push-down list (system dependent), but is always greater than 10. The general form of the command loop is: n where "command string" is the sequence of commands to be iterated and n is the number of iterations. If n is not supplied then no limit is placed on the number of iterations. If n is 0 or less than 0 then the iteration is not executed at all; command control skips to the closing angle bracket. If n is greater than 0, then the iteration is performed n times. Search commands inside command loops are treated specially. If a search command which is not preceded by a colon modifier is executed within a command loop and the search fails, a warning message is printed [on TECO-11], the command loop is exited immediately and the command following the right angle bracket of the loop is the next command to be executed. If an unmodified search command in a command loop is immediately followed by a semicolon (section 5.12), it is treated as if it were a colon-modified search. Standard TECO PAGE 95 Branching Commands 5.11 BRANCHING COMMANDS TECO commands may be combined in sophisticated command strings which are capable of solving even the most complex editing problems. In this respect, TECO should be considered a programming language which accepts an input file as data and processes this input to produce an output file. As with most programming languages, TECO provides an unconditional branch command and a set of conditional execution commands. To provide for branching within a command string, there must be some means of naming locations inside the string. TECO permits location tags which have the form: !tag! to be placed between any two commands in a command string. The name "tag" will be associated with this location when the command string is executed. Tags may contain any number of ASCII characters and any character except for an exclamation mark. (When using the @ form of this command, any character except the delimiter would be legal.) Since tags are ignored by TECO except when a branch command references the tagged location, they may also be used as comments within complicated command strings. Note that when entering a command string from a terminal, certain characters are immediate action commands, and thus could not be directly entered into a tag or comment. Good TECO code is well structured and adequately commented. Unfortunately, massive comments in a TECO macro tend to slow the macro down, especially if they appear within text scanned by GOTOs or unsatisfied conditionals. Unless speed is not a desired goal, it is common practice in larger TECO programs to strip out comments before loading up TECO macros. In that manner, the TECO program can be adaquately commented, yet still run efficiently. The large TECO program would usually start by placing a comment stripper in a Q-register, say Q-register C. Then it would successively put its subroutines (macro text) into the text buffer, do an MC, and load the appropriate Q-register with the resulting text buffer, until all the subroutines had been loaded. Then Q-register C would be zeroed and the program started. In order that you can strip the comments without losing the essential tags, it is necessary for you to make a convention for the format of your comments so that your comment stripper can distinguish them from your tags. Two conventions are in common practice. In one, the first character in every comment after the initial ! is some distinctive character, such as *. In another, all tags start in the left margin and all comments are embedded within the text. A large comment that wants to be on a line by itself would start with a and then the !. Both methods allow for readable code and easy comment stripping. The unconditional branch command is the O command which has Standard TECO PAGE 96 Branching Commands the form: Otag$ where "tag" is a named location elsewhere within the command string and "$" signifies an ESCAPE. When an O command is executed, the next command to be executed will be the command following the tag referenced by the O command, and command execution continues normally from this point. The use of the O command is subject to two important restrictions. If an O command is stored in a Q-register as part of a command string which is to be executed by an M command, the tag referenced by the O command must reside in the same Q-register. Secondly, an O command which is inside a command loop may not branch to a tagged location preceding the command loop. However, it is always possible to branch out of a command loop to a location which follows the command loop and then branch to the desired tag. The string argument in the O command has the same format as the string arguments in the search and E commands. String build characters such as ^EQq can be embedded within the string in TECO-11. Also, in TECO-11 and TECO-10,the O command may be @-sign modified. In that case, the syntax of the command would be @O/tag/ where / represents any delimiting character that does not appear within the tag. Branching into a conditional poses no problems, but branching into a command loop will causes unpredictable results. Although tags may contain any sequence of ASCII characters, good programming practice dictates that tags should not contain unusual characters (such as space, comma, ESCAPE, etc.) and that they should be mnemonic for the piece of code to which they refer. There are many other branching commands. Most of these are considerably faster than the O command and should be used wherever convenient. They are all described in the table below. TABLE 5-10: Branching Commands ^C The (Caret-C) command when executed as a TECO command, causes command execution to stop and control return to TECO's prompt. No clean-up of push-down lists, flag settings, etc. is done. This command lets a macro abort TECO's command execution. [On TECO-8 and TECO-10, this command causes control to return to the operating system.] [On TECO-11, this command returns to the operating Standard TECO PAGE 97 Branching Commands system if executed from the top level.] Consult the appendices for specific details concerning your operating system. ^C This command causes TECO to unconditionally abort and control exits from TECO. Control eturns to the operating system. The second must be a true and may not be a Caret-C. F> This command causes TECO to branch (flow) to the end of the current iteration. TECO effectively resumes execution at the matching >. The iteration count is tested as usual. If it has not expired, control returns back to the start of the iteration with the count having been incremented by 1. If the count was up, the iteration is exited and control continues with the first command after the >. If this command is encountered outside of an iteration, it has the same effect as the command. [TECO-11 only] F< This command causes TECO to branch (flow) to the start of the current iteration. TECO effectively resumes execution at the first command following the < at the beginning of the current iteration. The iteration count is not affected. If this command is issued outside of an iteration, it causes TECO to branch back to the start of the current command string (in the current macro level). [TECO-11 only] F' This command causes TECO to branch (flow) to the end of the current conditional. TECO effectively resumes execution at the first command following the ' at the end of the current conditional. Numeric arguments are eaten up by this command. If this command is issued while not in a conditional, the ?MAP error (or its equivalent) is issued. [TECO-11 only] F| This command causes TECO to branch (flow) to the else clause of the current conditional. TECO effectively resumes execution at the first command following the | at the end of the current THEN clause. If the current conditional has no ELSE clause, or if an unmatched ' is encountered before an unmatched |, then control resumes at the command following the ' . Numeric arguments are eaten up by this command. If this command is issued while not in a conditional, the ?MAP error (or its equivalent) is issued. Well-structured programs should not need to use this command. [TECO-11 only] Standard TECO PAGE 98 Branching Commands $$ The command causes TECO to exit from the current macro level. If this command is issued from top level (not from within a macro), then the command string execution is aborted and TECO returns to prompt level. Note that the second must be a true ESCAPE and may not be a ^[. Also, note that both ESCAPEs must be true TECO commands and not part of the syntax of some previous command. That is the first does not count if it is the delimiting ESCAPE of a string. n$$ This command causes TECO to exit from the current amcro level, returning the number n as a value. This value will be used as the numeric argument to the first command following the macro call. m,n$$ This command causes TECO to exit from the current macro level, returning the pair of values m and n as arguments to the first command following the macro call. Good programming practice dictates that all ways of exiting a macro return the same number of arguments. | This "command" is actually part of the syntax of TECO conditionals. If executed, it causes control to branch to the end of the conditional. Command execution resumes with the character following the ' that ends the current conditional with the ELSE clause being skipped. ' This "command" is actually part of the syntax of TECO conditionals. It has no affect if "executed" other than to signify termination of the current conditional level. If an argument is specified to this command, the result is not defined. (Arguments pass through this command on TECO-11.) > This "command" is actually part of the syntax of TECO iterations. If executed, it causes TECO to bump the current iteration count by 1 and test to see if the resulting count is equal to the maximum count permitted for the iteration (specified as an argument before the matching <). If the iteration count has not expired, then control returns to the command following the < at the beginning of the current iteration. If the iteration has expired, then command execution continues with the character following this >. If this command is encountered outside of an iteration (within the current macro level), then the ?BNI error message (or its equivalent) is issued. ; This command causes TECO to branch out of the current iteration, if the immediately preceding search (or search and replace) command failed. In that case, Standard TECO PAGE 99 Branching Commands control resumes at the character following the matching > at the end of the current iteration. On the other hand, if the preceding search succeeded, command execution continues with the character following the ;. If this command is encountered from outside of an iteration (in the current macro level), then the ?SNI error message is issued. n; This command causes TECO to branch out of the current iteration if the value of n is greater than or equal to 0. In that case, command execution resumes at the character following the matching > at the end of the current iteration. On the other hand, if n is less than 0, command execution continues with the character following the ;. If this command is encountered from outside of an iteration (in the current macro level), thent he ?SNI error message is issued. :; This command causes TECO to branch out of the current iteration if the immediately preceding search (or search and replace) command succeeded. In that case, control resumes at the character following the matching > at the end of the current iteration. On the other hand, if the preceding search failed, command execution continues with the character following the ;. If this command is encountered from outside of an iteration (in the current macro level), then the ?SNI error message is issued. [TECO-11 only] n:; This command causes TECO to branch out of the current iteration if the value of n is strictly less than 0. In that case, command execution resumes at the character following the matching > at the end of the current iteration. On the other hand, if n is greater than or equal to 0, command execution continues with the character following the ;. If this command is encountered from outside of an iteration (in the current macro level), thent he ?SNI error message is issued. [TECO-11 only] Otag$ This command causes TECO to branch to the first occurrence of the specified label (tag) in the current macro level. In TECO-8 and TECO-11, branching to the left of the start of the current iteration is not permitted, and this command will only look for an occurrence of the specified tag following the < of the current iteration, if you are in an iteration. In any case, branching out of an iteration is poor programming practice. Command execution resumes at the first character after the delimiter terminating the specified tag. Using this syntax, any character except is Standard TECO PAGE 100 Branching Commands permitted in the tag specification. The usual string build characters are permitted when specifying the tag. @O/tag/ Equivalent to Otag$ except that a delimiter (shown here as /) is used before and after the specified tag. Any character other than that delimiter is permitted inside the tag. The usual string build characters are permitted when specifying the tag. [Not in TECO-8] nOtag0,tag1,tag2,...$ This command causes TECO to branch to the tag specified by the nth tag in the accompanying list. The string argument to this command consists of a sequence of tags separated by commas. The tags may contain any characters other than comma or , however good programming practice dictates that the tags should consist only of letters and digits. There must be no intervening spaces since these would be considered part of the tag. If n is out of range, then command execution continues with the first command following the that delimits this command. [TECO-11 only] n@O/tag0,tag1,tag2,.../ Same as the preceding command except that the list of tags is bracketed by a delimiter shown here as "/". The delimiter can be any character that does not appear within the list of tags. In particular, using comma for the delimiter would not be very useful. [TECO-11 only] Standard TECO PAGE 101 Conditional Execution Commands 5.12 CONDITIONAL EXECUTION COMMANDS All conditonal execution commands are of the form: n"X command-string ' or n"X then-command-string | else-command-string ' where "n" is a numeric argument on which the decision is based, "X" may be any of the conditional execution commands listed in table 5-12, and "command string" is the command string which will be executed if the condition is satisfied. If the condition on n is not satisfied, the command string will not be executed. Note that the numeric argument is separated from the conditional execution command by a double quote (") and the command string is terminated with an apostrophe ('). In the second form of the command, two command strings are specified. The first one is executed if the condition is satisfied and the second is executed if the condition is not satisfied. Exactly one of the command strings will be executed. After the appropriate command string has been executed, control will continue with the first command following the apostrophe that terminates the conditional (unless, of course, the command string caused a branch out of the conditional to occur. In particular, execution of the vertical bar command (|) causes TECO to scan to the next matching apostrophe. Conditional commands are similar to the IF-THEN-ELSE constructs that you find in other structured programming languages, although none can match the brevity and elegance of TECO's implementation. Nonetheless, programmers must use these facilities wisely. Good programming practice dictates that a branch into the range of a conditional (from outside that range) should not occur. Conditional execution commands may be nested in the same manner as iteration commands. That is, the command string which is to be executed if the condition on n is met may contain conditional execution commands, which may, in turn, contain further conditional execution commands. Table 5-12 lists the conditional execution commands. Each conditional execution command must be followed by a command string (not shown in Table 5-12) which will be executed only if the condition is satisfied. This command string must be terminated by an apostrophe (or a vertical bar). If the condition is not satisfied, the first command following the apostrophe (or vertical bar) will be the next command executed. TABLE 5-12: CONDITIONAL EXECUTION COMMANDS Standard TECO PAGE 102 Conditional Execution Commands COMMAND FUNCTION n"A Execute the following command string if n equals the ASCII code for an alphabetic character (upper or lower case A to Z). n"C Execute the following command string if n is the ASCII code of any character that is a symbol consitutent. This is usually one of the upper or lower case letters A to Z, one of the digits 0 to 9, or period, or dollar sign, but may include additional characters on some operating systems. Consult the appropriate appendix. n"D Execute the following command string if n equals the ASCII code for a digit (0 to 9). n"E Execute the following command string if n is equal to zero. n"F Execute the following command string if n is FALSE. Equivalent to n"E. n"G Execute the following command string if n is greater than zero. n"L Execute the following command string if n is less than zero. n"N Execute the following command string if n is not equal to zero. n"R Execute the following command string if n equals the ASCII code for an alphanumeric (upper or lower case A to Z or 0 to 9). n"S Execute the following command string if n is SUCCESSFUL. Equivalent to n"L. n"T Execute the following command string if n is TRUE. Equivalent to n"L. n"U Execute the following command string if n is UNSUCCESSFUL. Equivalent to n"E. n"V Execute the following command string if n equals the ASCII code for a lower case alphabetic character (lower case A to Z). [Not in TECO-8] n"W Execute the following command string if n equals the ASCII code for an upper case alphabetic character (upper case A to Z). [Not in TECO-8] Standard TECO PAGE 103 Conditional Execution Commands n"< Identical to n"L n"> Identical to n"G n"= Identical to n"E If an unmodified search command in a command loop is immediately followed by a semicolon, it is treated as if it were a colon-modified search. Standard TECO PAGE 104 Numeric Arguments 5.13 NUMERIC ARGUMENTS Almost all TECO commands may be preceded by a numeric argument which generally indicates a buffer pointer, an ASCII character value, the number of iterations, or how many times the command should be executed. Some numeric arguments must be positive, while others may be negative or zero. This leads to an important restriction on the maximum size of any numeric argument. The permissible values are summarized in the table below. signed aruments unsigned arguments system min max max TECO-8 1-2**11 +2**11-1 2**15-1 TECO-10 -2**34 +2**34-1 2**35-1 TECO-11 -2**15 +2**15-1 2**16-1 Exceeding these range of values can cause unpredictable results. Use of a negative argument to a command that takes only an unsigned argument can cause unpredictable results. TECO maintains several internal variables which record conditions within TECO. Each of the variables has a name which is equivalent to the current contents of the variable. These characters may be entered as numeric arguments to TECO commands. When the command is executed, the current value of the designated variable is substituted for the character and used in the numeric argument of the command. Some of the characters which stand for specific values associated with the text buffer have been introduced earlier in this manual. For example, the dot character (.), which represents the current pointer position, may be used in the argument of a T command. The command ".,.+5T" causes the 5 characters following the buffer pointer to be typed out. When this command is executed, the number of characters preceding the buffer pointer is substituted (twice) for the "dot". The addition is then carried out, and the command is executed as though it were of the form "m,nT". Table 5-13A lists all of the characters which have special numeric values. Any of these characters may be used as numeric arguments in place of the values they represent. Standard TECO PAGE 105 Numeric Arguments TABLE 5-13A: CHARACTERS ASSOCIATED WITH NUMERIC QUANTITIES CHARACTER FUNCTION B Always equivalent to zero. Thus, B represents the position at the beginning of the buffer, preceding the first character in the buffer. Z Equivalent to the number of characters currently contained in the buffer. Thus, Z represents the position at the end of the buffer, following the last character in the buffer. . Equivalent to the number of characters between the beginning of the buffer and the current position of the pointer. Thus "." represents the current position of the pointer. H Equivalent to the numeric pair "B,Z", or "from the beginning of the buffer up to the end of the buffer." Thus, H represents the whole buffer. 0A Equivalent to the ASCII code for the character to the immediate right of the buffer pointer (the current character). nA Equivalent to the ASCII code for the .+n+1th character in the buffer (that is, the character to the right of buffer pointer position .+n). For example, the expression -1A is equivalent to the ASCII code of the character immediately preceding the pointer and 0A is equivalent to the ASCII code of the character immediately following the pointer (the current character). For people who like to think in "0-origin mode", nA returns the ASCII code for the nth character after the current buffer pointer position. Another way of looking at it is: nA returns the ASCII code for the character at character position .+n in the buffer. nA returns the ASCII code for the character that would be the current character if an nC command had been executed. If the character position referenced lies outside the bounds of the text buffer, this command returns a -1. Mq The Mq command (execute the contents of the text storage area of Q-register "q" as a command string) may return a numeric value if the last command in the string returns a numeric value and is not followed by an ESCAPE. :Qq Equivalent to the number of characters in the text storage area of Q-register q. [Not in TECO-8] Standard TECO PAGE 106 Numeric Arguments \ A backslash character which is not preceded by a numeric argument is equivalent to the value of the digit string (if any) that begins with the character immediately following the buffer pointer and is terminated by the next character that is not a valid digit for the current radix. The first character may be a digit or + or -. As the backslash command is evaluated, TECO moves the buffer pointer to a position immediately following the digit string. If there is no digit string following the pointer, the backslash is equivalent to zero and the pointer position remains unchanged. Except on TECO-8, the digits 8 and 9 will stop the evaluation if TECO's current radix is octal. ^B (caret/B) is equivalent to the current date via the following equations: OS/8: ^B = (((month*32)+day)*16)+((year-1970)&7)+k where k = 2048 if year>1977 and k=0 otherwise RT-11: ^B = (((month*32)+day)*32)+year-1972 RSTS/E: ^B = ((year-1970)*1000)+day within year RSX-11: ^B = ((year-1900)*16+month)*32+day VAX/VMS: ^B = ((year-1900)*16+month)*32+day TOPS-10: ^B = (((year-1964)*12+month-1)*31+day-1) ^E (caret/E) is equivalent to -1 if the buffer currently contains a full page of text (which was terminated by a form feed in the input file) or 0 if the buffer contains only part of a page of text (which either filled the buffer to capacity before the terminating form feed was read or which was not terminated by a form feed.) The ^E flag is tested by the P command and related operations to determine whether a form feed should be appended to the contents of the buffer on output. ^F (caret/F) is equivalent to the current value of the console switch register. n^F n is the terminal number plus 200000 (octal) for job n's terminal. -1^F is the terminal number plus 200000 (octal) for your job's terminal. The result is 0 if the specified job is detached or if there is no such job. [TECO-10 only] ^H (caret/H) is equivalent to the current time of day via the following equations: OS/8: ^H = 0 RT-11: ^H = 0 RSTS/E: ^H = minutes until midnight Standard TECO PAGE 107 Numeric Arguments RSX-11: ^H = (seconds since midnight)/2 VAX/VMS: ^H = (seconds since midnight)/2 TOPS-10: ^H = 60ths of a second since midnight (or 50ths of a second where 50 Hz power is used) ^N (caret/N) is the end of file flag. It is equivalent to -1 if the file open on the currently selected input stream is at end of file, and zero otherwise. ^S (caret/S) is equivalent to the negative of the length of the last insert, string found, or string inserted with a "G" command, whichever occurred last. To back up the pointer to the start of the last insert, string found, etc., one simply types "^SC". [Not in TECO-8] ^T (caret/T) is equivalent to the ASCII code for the next character typed at the terminal. Every ^T command executed causes TECO to pause and accept one character typed at the terminal. See the ET flag description (section 5.14) for variations. ^Y (caret/Y) is equivalent to ".+^S,.". This is the n,m numeric argument spanning the text just searched for or inserted. For example, this value may be used to recover from inserting a string in the wrong place. One types "^YXAFR$" to store the string in Q-register A and remove it from the buffer. One may then position the pointer to the right place and type "GA" to insert the string. [TECO-11 only] ^^x The combination of the Control-caret (double caret or double up-arrow) followed by any character is equivalent to the value of the ASCII code for that character. The "x" in this example may be any character that can be typed in to TECO. Standard TECO PAGE 108 Numeric Arguments MODE CONTROL FLAGS ED ED is equivalent to the current value of the edit level flag. The use of the ED flag is described in section 5.14. EH EH is equivalent to the current value of the help level flag. The use of the EH flag is described in section 5.14. EO EO is equivalent to the version number of the version of TECO which is currently being run. This manual describes TECO-11 Version 34, TECO-8 version 7, and TECO-10 version 1. ES ES is equivalent to the current value of the search verification flag. The use of the ES flag is described in section 5.14. [Not in TECO-8] ET ET is equivalent to the current value of the type-out control flag. The use of ET flag is described in section 5.14. EU EU is equivalent to the current value of the upper lower case flag. The use of the EU flag is described in section 5.14. EV EV is equivalent to the current value of the edit verify flag. The use of the EV flag is described in section 5.14. [TECO-11 only] ^X (caret/X) is equivalent to the current value of the search mode flag. The use of the ^X flag is described in section 5.14. [Not in TECO-8] The numeric argument of a TECO command may consist of a single integer, any of the characters listed in Table 5-13A, the numeric contents of any Q-register, or an arithmetic combination of integers, Q-registers, and the characters listed in Table 5-13A. If an arithmetic expression is supplied as a numeric argument, TECO will evaluate the expression. All arithmetic expressions are evaluated from left to right without any operator precedence. Parentheses may be used to override the normal order of evaluation of an expression. If parentheses are used, all operations within the parentheses are performed, left to right, before performing operations outside the parentheses. Parentheses may be nested, in which case the innermost expression Standard TECO PAGE 109 Numeric Arguments contained by parentheses will be evaluated first. Table 5-13B lists all of the arithmetic operators that may be used in arithmetic expressions. Standard TECO PAGE 110 Numeric Arguments TABLE 5-13B: ARITHMETIC OPERATORS OPERATOR EXAMPLE FUNCTION + +2=2 Ignored if used before the first term in an expression. + 5+6=11 Addition, if used between terms. - -2=-2 Negation, if used before the first term in an expression. - 8-2=6 Subtraction, if used between terms * 8*2=16 Multiplication. Used between terms. / 8/3=2 Integer division with loss of the remainder. Used between terms. & 12&10=8 Bitwise logical AND of the binary representation of the two terms. Used between the terms. # 12#10=14 Bitwise logical OR of the binary of the two terms. Used between the terms. ^_ 5^_=-6 Unary one's complement. Used after an expression. This is a TECO command that complements its argument. Strictly speaking, it is not a unary operator. Standard TECO PAGE 111 Numeric Arguments The following commands affect the radix in which TECO processes numeric strings, which may be either octal, decimal, or hexadecimal. All numeric strings typed in, typed out, or handled by the \ and n\ commands are interpreted in the current radix. [In TECO-10, the current radix is always decimal.] TABLE 5-13C: CONVERSION AND RADIX CONTROL COMMANDS COMMAND FUNCTION n= This command causes the value of n to be output at the terminal in decimal followed by a carriage return and line feed. Decimal numeric conversion is signed. For example, the unsigned number 65535 will output as -1 on TECO-11. TECO's radix is unaltered. n== This command causes the value of n to be output at the terminal in octal (base 8) followed by a carriage return and line feed. Octal numeric conversion is unsigned. For example, the unsigned number 8191 (decimal) will output as 17777 on TECO-8. TECO's radix is unaltered. n=== This command causes the value of n to be output at the terminal in hexadecimal (base 16) followed by a carriage return and line feed. Hexadecimal output is unsigned. TECO's radix is unaltered. [TECO-11 only] n:= This command causes the value of n to be output at the terminal in decimal and leaves the carriage positioned at the end of the output. n:== This command causes the value of n to be output at the terminal in octal (base 8) and leaves the carriage positioned at the end of the output. n:=== This command causes the value of n to be output at the terminal in hexadecimal (base 16) and leaves the carriage positioned at the end of the output. [TECO-11 only] ^O (caret/O) causes all subsequent numeric input to be accepted as octal numbers. The digits 8 and 9 become illegal as numeric characters when the radix is octal. Numeric conversions using the \ or n\ commands will also be octal. The octal radix will continue to be used until the next ^D command is executed or until TECO's radix is changed by an n^R command. NOTE: On TECO-10, this command only affects the immediately following digit string. Standard TECO PAGE 112 Numeric Arguments ^D (caret/D) causes all subsequent numeric input to be accepted as decimal numbers. This is the initial setting. [Not in TECO-10] ^R Equivalent to 10 . This command returns the value of TECO's current radix. [TECO-11 only] n^R This command sets TECO's radix to the value of n. This command is currently implemented only in TECO-11 and, in that implementation, n may only be one of the values 8, 10, or 16 (representing octal mode, decimal mode, or hexadecimal mode). If n is not one of these values, TECO's radix remains unchanged and the ?IRA error message is produced. n\ The backslash command preceded by an argument inserts the value of n into the text buffer at the current position of the pointer, leaving the pointer positioned after the last digit of the insertion. The insertion is either signed decimal (decimal radix) or unsigned octal (octal radix). Note that \ is a "bidirectional" command. n\ inserts a string into text while \ (no argument) returns a numeric result. Some TECO commands generate numeric values which they pass on to subsequent commands. An example is any colon-modified search command, which causes the next sequential command to be executed with an argument of -1 or 0, depending upon the outcome of the search. Commands of this sort are very useful, but occasionally it may be undesirable to have arguments passed in this manner. Note that many TECO commands perform significantly different functions, depending on whether no, one, or two arguments are present. A single ESCAPE character may be inserted between any two commands in a command string to absorb unwanted values. This ESCAPE has no effect on the individual commands, however a numeric argument will never be passed across an extraneous ESCAPE or a Caret-[ (which is equivalent to an ESCAPE). Standard TECO PAGE 113 Retrieving Environment Characteristics 5.15 RETRIEVING ENVIRONMENT CHARACTERISTICS TECO has commands that return values of interest to users who want to know information about their current job, the operating system, their terminal, etc. These commands are described in the following table. TABLE 5-15A: RETREIVING ENVIRONMENT CHARACTERISTICS COMMAND FUNCTION 0:W Return a number representing the type of scope in use as the editing terminal. Current values are: 0 VT52 1 VT61 [TECO-10 only] 2 VT100 in VT52 mode 4 VT100 in ANSI mode 6 VT05 :W Equivalent to 0:W 1:W Return the horizontal size of the user's editing scope. This number represents the number of character positions available horizontally along the face of the scope. 2:W Return the vertical size of the user's editing scope. This number represents the number of lines of text that can appear on the screen of the terminal. 3:W Returns SEEALL mode. 0 represents off and -1 represents on. In SEEALL mode, a visible indication is shown in the window for every character, including characters that normally don't print. 4:W Returns mark status of window support. 0 means that no mark has been set. A value of n means that a mark has been set at window position n-1. This status is used by software that uses the window support and by the support itself in the case of scopes that support reverse video. 5:W Returns the hold mode indicator. 0 means off, -1 means hold whole screen, and a positive value, n, means hold all but top and bottom n lines. If hold mode is on, then scrolling is inhibited until the cursor is about to run off either end of the screen. This makes the window display more palatable on terminals on a slow line. If hold mode is on, the window support will scroll the window as necessary in an attempt to keep the cursor centered. Standard TECO PAGE 114 Retrieving Environment Characteristics 6:W Returns buffer pointer position of character that was in the upper left hand corner of the window as of the last -1W command. n:W n:W where n is greater than 6 is implementation-dependent. Consult the appendices for details. -1EJ Return a number representing the computer and operating system upon which TECO is currently running. This value has the form 256m+n where m is a number representing the computer in use and n is a number representing the operating system that is running in accordance with the following table. Computer Operating System 0 PDP-11 0 RSX-11D 1 RSX-11M 2 RSX-11S 3 IAS 4 RSTS/E 5 VAX/VMS (compatibility mode) 6 RT-11 1 PDP-8 0 OS/8 2 PDP-10 0 TOPS-10 3 PDP-20 0 TOPS-20 4 VAX-11 0 VAX/VMS (native mode) 0EJ Returns a value equal to your job number. On single-user systems, this is always a 0. 1EJ Returns a value equal to your console keyboard number (the keyboard you detached from if you are running detached). On single-terminal systems, this is always a 0. 2EJ Returns a value equal to your operating system's user identification number. This may be called your UIC, PPN, Group, etc. under various operating systems. Consult the appendices for more information. TABLE 5-15B: SETTING ENVIRONMENT INFORMATION m,n:W Sets the entity represented by n:W to m. Specific operating systems may put restrictions on the valid values for m. Consult the appendices for details. n,1EJ Set the terminal number to do output on. This will not affect terminal input. Your job will remain attached Standard TECO PAGE 115 Retrieving Environment Characteristics to your terminal ordetached if it was before. Output will only happen if the specified terminal is ASSIGNed with a monitor ASSIGN command (you may ^C, issue that command and continue) and if your job has POKE privileges. This command also sets the terminal to re-attach to if the detach flag (64&ET) is cleared after having been set. The reattaching operation requires [1,2] or JACCT privileges. [TECO-10 only] n,2EJ Sets your [p,pn] to n where n has the same format as the number returned by the 2EJ command. Issuance of this command requires the appropriate privileges. [TECO-10 only] Standard TECO PAGE 116 Mode Control Flags 5.16 MODE CONTROL FLAGS TECO has flags which control various aspects of its operation. These flags are referenced with the commands "^X", "ED", "EH", "EO", "ES", "ET", "EU", and "EV", and are called the ^X, ED, EH, EO, ES, ET, EU, and EV flags, respectively. A flag's current setting may be interrogated by executing its command name without an argument; the current setting of the flag is returned as a value. A flag may be set to a specific value by executing its command name with a preceding numerical argument; the flag is set to the value of the argument. If denotes any one of the flags named above, then the commands that set and clear these flags are summarized in the table below: TABLE 5-16A: FLAG MANIPULATION COMMANDS Return value of flag. n Set value of flag to n. m,n In the flag, turn off those bits specified by m and turn on those bits specified by n. [Not in TECO-8] 0,n Turn on the bits in the flag specified by n. [Not in TECO-8] m,0 Turn off the bits in the flag specified by m. [Not in TECO-8] The flags have the following functions: TABLE 5-16B: MODE CONTROL FLAGS COMMAND FUNCTION n^X Sets the search mode flag to n. [Not in TECO-8] If n is 0, the text argument in a search command will match text in the text buffer independent of case in either the search argument or the text buffer. Thus the lower case alphabetics match the upper case alphabetics and "`", "{", "|", "}", "~" match "@", "[", "\", "]", "^" respectively. If n is -1, the search will succeed only if the text argument is identical to text in the text buffer. The initial value of the ^X flag is 0. Standard TECO PAGE 117 Mode Control Flags nED Sets the value of the edit level flag to n. The ED flag is a bit-encoded word that controls TECO's behavior in various aspects. Any combination of the individual bits may be set as the user sees fit. The bits have the following functions: ED&1 Allow caret (^) in search strings. If this bit is reset (off), a caret (^) in a search string modifies the immediately following character to become a control character. When this bit is set, a caret in a search string is simply the literal character caret. If you are editing a file that contains many caret characters (e.g., a RUNOFF file), you will want to set this bit. ED&2 Allow all Y and _ commands. If this bit is set, the Y (Yank) command and _ (underscore or backarrow) command work unconditionally as described earlier in the manual. If reset (off), the behavior of the Y and _ commands are modified as follows: If an output file is open and text exists in the text buffer, the Y or _ command will produce an error message and the command will be aborted leaving the text buffer unchanged. Note that if no output file is open the Y and _ commands act normally. Furthermore, if the text buffer is empty the Y command can be used to bring in a page of text whether or not an output file is open (HKY will always work). The _ command will succeed in bringing one page of text into an empty text buffer but will fail from bringing in successive pages if an output file is open. ED&4 If this bit is set (1), then arbitrary memory expansion will not occur. In that case, TECO will expand memory if necessary only on the A command and not on the Y, P, or N commands. When this bit is not set (0), TECO will try to expand memory as much as it can in order to try to fit entire pages into memory when requested to do so. This bit is always set in TECO-10 and has no significance in TECO-8 or in TECO-11 on RT-11. ED&8 Reserved for future use. ED&16 Allow failing searches to preserve dot. If this bit is set (1), then whenever a search fails, the original location of the text Standard TECO PAGE 118 Mode Control Flags buffer pointer will be preserved. If this bit is off (0), then failing searches (other than bounded searches) leave the text buffer pointer at pointer position 0 after they fail. The initial value of ED&1 is system dependent (see Appendices). The initial value of the other bits in the ED flag is 0. nEH Sets the value of the help level flag to n. EH&3 The low two bits of EH (value range 0 through 3) control the printing of TECO error messages as follows (assuming the low two bits have value m): If m is equal to 1, error messages are output in abbreviated form ("?XXX"). If m is equal to 2, error messages are output in normal form ("?XXX Message"). If m is equal to 3, error messages are output in long form (a paragraph of informative material is typed following the normal form of the error message). This mode is not implemented in TECO-11, in which case m=3 is equivalent to m=2. EH&4 If the 4's bit of EH is set, the failing command is also output up to and including the failing character in the command followed by a question mark. (Just like TECO's response to the typing of a question mark immediately after an error.) This bit is not supported by TECO-10. The initial value is 0 which is equivalent to a value of 2. nEO Sets the value of the EO flag to n. This allows features that were peculiar to that version of TECO to work. [TECO-10 only] nES Sets the value of the search verification flag to n. If n is equal to 0, nothing is typed out after searches. If n is -1, the current line is typed out when a successful search at top level is completed (i.e., a V command is done automatically). If n is between 1 and 31, the current line is typed out with a line feed immediately following the position of the pointer to identify its position. If n is between 32 and 126, the current line is typed out with the ASCII character corresponding to the value of n immediately following the position of the pointer to identify its position. If more than one line of type-out is Standard TECO PAGE 119 Mode Control Flags desired, the form m*256+n can be used. The n is the same as above. The m is the number of lines of view. For example, 3*256+^^! would be two lines on either side of the found line, and the found line with the character "!" at the pointer's position. The ES flag does not apply to searches executed inside iterations or macros; lines found inside iterations or macros are never typed out. [Not in TECO-8] The initial value of ES is 0. nET Sets the type out control flag to n. The ET flag is a bit-encoded word that controls TECO's treatment of the console terminal. Any combination of the individual bits may be set as the user sees fit. The bits have the following functions: ET&1 Type out in image mode. Setting this bit inhibits all of TECO's type out conversions. All characters are output to the terminal exactly as they appear in the buffer or ^A command. For example, the changing of control characters into the "caret/character" form is suppressed. Also, the conversion of to $ (dollar sign) is suppressed. This mode is useful for driving displays. It should be used with caution, especially if the user is talking to TECO over a dial-up line. ET&2 Process DELETEs and s in "scope" mode. Scope mode processing uses the cursor control features of CRT type terminals to handle character deletion by actually erasing characters from the screen. ET&4 Read lower case. TECO normally converts all lower case alphabetics to upper case on input. Setting this bit causes lower case alphabetics to be input as lower case. TECO commands and file specifiers may be typed in either upper or lower case. For the purpose of searches, however, upper and lower case may be treated as different characters. (See ^X flag). ET&8 Read without echo for ^T commands. This allows data to be read by the ^T command without having the characters echo at the terminal. Normal command input to TECO will echo. Standard TECO PAGE 120 Mode Control Flags ET&16 Cancel on typeout. Setting this bit will cancel any outstanding when the next typeout occurs. After TECO has canceled the , it will automatically reset the bit. ET&32 Read with no wait. This enables the ^T command to test to see if a character is available at the user terminal. If a character has been typed ^T returns the value of the character as always. If no character has been typed ^T immediately returns a value of -1 and execution continues without waiting for a character. ET&64 Detach flag (see Appendices). ET&128 When this bit is set: 1) all informational messages are supressed, 2) any causes the immediate termination of TECO, and 3) any error causes the termination of TECO after the error message is printed. ET&256 If this bit is set, all lines output to the terminal are truncated to the terminal's width if needed. (RSTS/E and RSX-11 only.) ET&512 If this bit is set, the VT52 "WATCH" feature of TECO is present and your terminal is a VT52 type terminal. This bit is a read-only bit; its state cannot be altered. (See Section 5.15.) ET&1024 If this bit is set, the refresh scope "WATCH" feature of TECO is present and a refresh scope is available. This bit is a read-only bit; its state cannot be altered. (See Section 5.15.) ET&32768 If this bit is set and a is typed, the bit is turned off, but execution of the current command string is allowed to continue. This allows a TECO macro to detect typed s. In TECO-8, this bit is the 2048's bit rather than the 32768's bit. The initial setting of ET is operating system dependent (see Appendices). In addition, some of the ET bits are automatically turned off by certain error conditions. nEU Sets the value of the upper/lower case flag to n. Standard TECO PAGE 121 Mode Control Flags If n is -1, no case flagging of any type is performed on typeout, lower case characters are output as lower case characters. If n is 0, lower case characters are flagged by outputting a ' (quote) before the lower case character and the lower case character is output in upper case; upper case characters are unchanged. If n is +1, upper case characters are flagged by outputting a ' (quote) before each one and then the upper case character is output; lower case characters are output as their upper case equivalents. The initial value of the EU flag is -1 if TECO can tell from the operating system that the user's terminal supports display of lower case characters; otherwise te initial value is 0. Consult the appendices for more details. nEV Sets the value of the edit verify flag to n. The edit verify flag's value is decoded just like the ES flag. Just before TECO prints its prompting *, the EV flag is checked. If it is non-zero the lines to be viewed are printed on the terminal. The initial value of the EV flag is 0. [TECO-11 only] Standard TECO PAGE 122 Scope Commands 5.15 SCOPE COMMANDS The W command (scope "WATCH") is present in most implementations of TECO. There are two different variations of the W command. Neither, one, or both may be present. ET flag Bits 9 and 10 indicate which variation(s) are configured and can be used. Video Terminal scope "WATCH" If the VT support is present and your terminal is a VT52 type terminal (such as a VT05 or VT52), ET flag Bit 9 (value 512) will be on. Command Function -1W Refresh the terminal's screen to show the contents of the text buffer. -nW Tell the video terminal screen refresher that the top n-1 lines of the screen have been altered. The screen refresher will completely redraw the top n-1 lines of the screen upon the next -1W command. nW Place the default cursor line at line n of the VT52's screen. The initial default cursor line is line 16. This command makes the window support forget the screen image and any special associated modes (SEEALL, MARK, HOLD). 0W Equivalent to "16W". W Forget screen image and special scope modes. 32768W Forget that output was done. Normally, if the user outputs to the terminal with a command such as T, n^T, or ^A, TECO will believe that the window needs updating, and upon the next -1W command, TECO will refresh the entire window display. Issuing the 32768W command informs TECO that the output command did not destroy the window. [TECO-11 only] Users writing programs to utilize the scope "window" should also consult information about the :W command which tells you about your scope characteristics. Refresh scope "WATCH" If refresh scope support is present and a refresh scope is available (such as a VS60 or a VR12), bit value 1024 of the ET Standard TECO PAGE 123 Scope Commands flag will be on. Command Function W Update the refresh scope screen to reflect the contents of the text buffer surrounding the text pointer ("dot"). 0W Turn off the refresh scope display. nW Set the number of lines to be displayed around the text pointer to n. Standard TECO PAGE 124 Programming Aids 5.18 PROGRAMMING AIDS Text Formatting The characters carriage return, line feed, vertical tab, and space are ignored in command strings, except when they appear as part of a text argument. These characters may be inserted between any two TECO commands to lend clarity to a long command string. The carriage return/line feed combination is particularly useful for typing command strings which are too long to fit on a single line. If the character form feed is encountered in a command string and it is not part of a text argument, a form feed is output to the terminal. This can be used to format terminal output. On TECO-10, execution of the form feed command will clear the screen if TECO is in scope command string editing mode (2&ET on). Comments One of the most powerful features of TECO is the ability to store very long command strings so that a given sequence of commands may be executed whenever needed. Long command strings may be thought of as editing programs and, like any other type of program, they should be documented by means of comments. Comments may be inserted between any two commands by using a tag construction of the form: !THIS IS A COMMENT! Comments may contain any number of characters and any characters except the special characters. Thus a long TECO macro might look like: TECO commands !This comment describes line 1! TECO commands !This comment describes line 2! more commands more commands !end of comment string! An important pitfall to avoid is the use of characters to format long command strings. Only , , and must be used to format command strings since is an insertion command. Messages The command may be used to print out a statement at any point during the execution of a command string. The command has the general form: ^Atext Standard TECO PAGE 125 Programming Aids or @^A/text/ where the first ^A is the actual command, which may be entered by striking the control key and the A key simultaneously or by typing a caret (uparrow) followed by an A character. The second character of the first form shown is the command terminator, which must be entered by typing the control key and the A key simultaneously. In the second form, the second occurence of the delimiting character (shown as slash in the example) terminates the message. Upon execution, this command causes TECO to print the specified message at the terminal. The ^Amessage command is particularly useful when it precedes a command whose numeric argument contains ^T or ^F characters. The message may contain instructions notifying the user as to what sort of input is required. Tracing A question mark entered betweeen any two commands in a command string causes TECO to print all subsequent commands at the terminal as they are executed. Commands will be printed as they are executed until another question mark character is encountered or the command string terminates (TECO prompts with *). Command Editing If an error is typed while entering a command string, the error may be corrected at any time before the double ESCAPE which terminates the command string is typed. Characters may be deleted individually by striking the DELETE key. Each depression of the DELETE key deletes one character, beginning with the last character typed, and causes the deleted character to be printed at the terminal. An entire line of a command string may be deleted by typing . If an entire command string is deleted in one of these manners, TECO responds by printing a new asterisk at the left margin. Typing causes TECO to retype the line currently being input. Typing * causes TECO to retype all the lines from the last command execution point. The caret form of the may not be used for these commands. Typing two successive characters causes the current command string to be erased completely. The double command must be produced by holding the control key depressed while striking the G key twice (if the terminal has a bell, it will ring). The caret form of the may not be used for this command. Standard TECO PAGE 126 Programming Aids After successful command completion, after an error, or after to cancel a command, the last command buffer contents may be recovered by immediately typing "*q", where "q" is any Q-register name. This places the command buffer contents into the named Q-register. No ESCAPE is required after the *q. (In TECO-8, the * issued by itself acts as the *Z command.) (In TECO-10, *q must be followed by .) Standard TECO PAGE 127 Programming Aids CONVENIENCE CHARACTERS Several characters have no special meaning to TECO but may be used to help format your TECO programs and command strings. Judicious use of these commands will make your program easier to read and maintain. These characters are described in the table below: CHARACTER MEANING A space between commands is ignored by TECO. Numeric values are not affected. A space encountered between digits within a digit string is not good programming practice and may cause unpredictable results. A carriage return TECO command is ignored. Numeric values are not affected. A line feed encountered within a TECO command is ignored. Numeric values are not affected. A null (ASCII 0) encountered as a TECO command will be ignored. Numeric values are not affected. A null read in from an input file will be discarded (except under RSX-11, VAX/VMS, and IAS). A null typed in from a terminal will be ignored. An ESCAPE that is executed as a TECO command (as distinct from an ESCAPE that is part of the syntax of some other TECO command) is ignored by TECO; however any pending numeric values are discarded. This command is useful for discarding the value returned from a command (such as n%q) when that value is not needed. Good programming practice dictates that if a returned value is not wanted, it should be explicitly discarded by following the command with an ESCAPE. ^[ Same as . Just as any other TECO command that is a control character, it may be entered in up-arrow mode. In that flavor, ^[, is useful on systems whose line-printer spoolers do not visibly print the ESCAPE character. On some older terminals, there is no ESCAPE key. Instead, there may be a key labelled ALTMODE or PREFIX. These keys may send the characters whose ASCII value is 175 or 176 to TECO. In such a case, TECO will treat these Standard TECO PAGE 128 Programming Aids characters as if they were typed in as an ESCAPE (Octal 33). $ (dollar sign) Same as . [TECO-10 only] Note that and
are valid TECO commands and must not be used as aids to formatting TECO programs. Memory expansion The nEC command can be used to make TECO reclaim lost space after it had expanded memory usage. nEC tells TECO to expand or contract until it uses nK words of memory. If this is not possible, then TECO's memory usage does not change. The 0EC command tells TECO to shrink back to its original size (use the least amount of memory as possible). [TECO-10 only] Case Control The and TECO commands are used to specify automatic case control for alphabetic characters typed into strings. Character Meaning ^V puts TECO into lower case conversion mode. In this mode, all alphabetic characters in string arguments are automatically changed to lower case. This mode can be overridden by explicit case control within the search string. This command makes all strings behave as if they began with a ^V^V. [TECO-10 only] ^W puts TECO into upper case conversion mode. In this mode, all alphabetic characters in string arguments are automatically changed to upper case. This mode can be overriden by explicit case control within the search string. This command makes all strings behave as if they began with ^W^W. [TECO-10 only] 0^V Returns TECO to its original mode. No special case conversion occurs within strings except those case conversions that are explicitly specified by ^V and ^W string build constructs located within the string. [TECO-10 only] 0^W Same as ^V. [TECO-10 only] Standard TECO PAGE 129 5.18 MANIPULATING LARGE PAGES TECO is designed to operate most efficiently when editing files that contain no more than several thousand characters per page.[1] If any page of an input file is too large to fit in the text area, the various TECO input commands will terminate reading that page into memory when the first line feed is encountered after a point that the buffer is 3/4 full. (See appendices for details.) One may make room by positioning the pointer past a portion of text at the beginning of the buffer and moving it out with the commands 0,.PW0,.K -------------------- [1]. TECO storage includes q-register storage and buffer space. The size of the text storage area is dynamic and depends on the amount of available memory. Standard TECO PAGE 130 Techniques 5.19 TECHNIQUES AND EXAMPLES TECO may be used in three ways. The most elementary application, described in Chapter I of this manual, involves using TECO to create and edit ASCII files on-line. The user enters short command strings, often consisting of a single command, and proceeds from task to task until the file is completely edited. Since every editing job is simply a long sequence of TECO commands, an entire job may be accomplished with one long command string consisting of all of the short command strings placed end to end with the intervening double ESCAPE characters removed. This leads to the concept of a TECO editing program, which is simply a long command string that performs a certain editing task. Editing programs may be written (using TECO) and stored in the same manner as any other ASCII file. Whenever the program is needed, it may be read into the buffer as text, stored in a Q-register, and executed by an Mq command (where "q" is the Q-register name). This is fine for clear-cut editing assignments, such as converting from one format to another or editing certain characters out of a file, but many editing jobs are so complex that a given editing program will only solve a small class of problems. The solution, in this case, is to write specialized "editing subroutines." TECO subroutines might perform such elementary functions as replacing every occurrence of two or more consecutive spaces with a tabulation character, for example, or ensuring that words are not hyphenated across a page boundary. When an editing problem arises, the right combination of subroutines may be loaded into various Q-registers, augmented with additional commands if necessary, and called by a "mainline" command string. Editing subroutines are essentially macros; that is, sequences of commands which perform commonly required editing functions. Thus the third and most powerful application of TECO is the creation and use of a macro library. As each editing job is undertaken, the user may look for sequences of operations which might be required in future editing assignments. All of the TECO commands required to perform such an operation may be loaded into a Q-register and executed by means of an Mq or nMq command. When the job is finished, the contents of any Q-register which contains a useful macro may be written onto an output file (via the buffer) and saved in the macro library. The nMq and m,nMq commands, which were designed to facilitate use of macros, permits run-time numeric arguments to be passed to a macro. Standard TECO PAGE 131 Techniques TECO macros can preserve the user's radix, flag values, etc. By using the Q-register push-down list, the macro can save and then restore values and/or text. For example: [0 [1 [2 ! Save contents of Q-registers 0, 1 and 2 ! +0U0 ! Put any calling argument into Q-register 0 ! 10U1 ! Put a 10 (if radix is decimal) or 8 (if radix is octal) into Q-reg 1 ! ^D ! Ensure that the current radix is now decimal ! EUU2 ! Save the case flagging flag ! -1EU ! Ensure no case flagging ! Q0"E 3U0 ' ! Default calling argument to 3 ! ... Q2EU ! Restore the case flagging flag ! 10-Q1"N ^O ' ! Restore radix as octal if needed ! ]2 ]1 ]0 ! Restore contents of Q-registers 2, 1, and 0 ! The EI command is particularly useful for executing macros from a library, since with it they may be read without disturbing the current input file. This makes it unnecessary to plan in advance which macros might be needed and saves Q-register storage space. A TECO command file retrieved with an EI command may be in one of two basic forms: The file may contain a TECO command that loads the macro into a Q-register for later use. Or, the file may simply be the macro itself (in which case it must be retrieved with EI each time it is used). The following examples are intended to illustrate some of the techniques discussed earlier. It would not be practical to include examples of the use of every TECO command, since most of the commands admit to many diverse applications. Instead, users are encouraged to experiment with the individual commands on scratch files. EXAMPLE 1: SPLITTING, MERGING, AND REARRANGING FILES Assume that the user has a file named PROGRAM.DAT on the system disk and that this file contains data in the following form: AB CD EF GH IJ KL MN OP where each of the letters A, B, C etc., represents 20 lines of text and represents a form feed character. The user intends to rearrange the file so that it appears in the following format: AOB D MN EF ICJ KL P GH The following sequence of commands will achieve this rearrangement. (Search command arguments are not listed explicitly.) Standard TECO PAGE 132 Techniques Call TECO. *2ED$$ Allow all Y commands. *EBPROG.DAT$Y$$ Specify input file and get first page. *NC$$ Search for a character string in C, writing A and B on the output file. *J20X1$$ Save all of C in Q-register 1. *20K$$ Delete C from the buffer. *NG$$ Search for a character string in G, writing D, E, and F on the output file. *HX2$$ Save G and H in Q-register 2. *Y$$ Delete GH from the buffer and read IJ. *20L$$ Move the pointer to the beginning of J. *G1$$ Insert C, which was stored in Q-register 1. *NM$$ Search for a character string in M, writing ICJ and KL on the output file. *HX1$$ Save MN in Q-register 1 (the previous contents is overwritten). *Y$$ Delete MN and read OP *J20X3$$ Save all of O in Q-register 3. *20K$$ Delete O from the buffer. *P$$ Write P onto the output file, leaving the buffer cleared (the input file is exhausted). *G2$$ Bring GH into the buffer from Q-register 2. *HPEF$$ Write GH on the output file and close it. *EBPROG.DAT$Y$$ Open the partially revised file. *20L$$ Move the pointer to the beginning of B. *G3$$ Insert all of O from Q-register 3. *ND$$ Search for a character string in D writing AOB on the output file. *PWHK$$ Write D on the output file and clear buffer. *G1$$ Bring all of MN from Q-register 1 into the buffer. *EX$$ Write MN onto the output file, then close the file and exit. At this point the file has been rearranged in the desired format. Of course, this rearrangement could have been accomplished in fewer steps if the commands listed above had been combined into longer command strings. Note that the asterisks shown at the left margin in this example are generated by TECO, and not typed by the user. Assume, now, that the same input file mentioned earlier, containing data in the form: AB CD EF ... OP is to be split into two separate files, with the first file containing AB CD and the second file containing KL M, while the rest of the data is to be discarded. The following commands could be used to achieve this rearrangement: Standard TECO PAGE 133 Techniques Call TECO. *2ED$$ Allow all Y commands. *ERFILE$EWFILE1$$ Open the input file and the first output file. *Y$$ Read AB into the buffer. *P$$ Write AB onto the output file and read CD into the buffer. *HPEF$$ Write CD onto the output file (without appending a form feed), and close the first output file. *_K$$ Search for a character string in K. After this command has been executed, the buffer will contain KL. No output is generated. *EWFILE2$P$$ Open the second output file and write KL onto it. Read MN into the buffer. *20L0,.P$$ Move the pointer to the end of M, then write M onto the output file. *EX$$ Close the output file and exit. As a final example of file manipulation techniques, assume that the user has two files. One file is MATH.ONE, which contains information in the form: AB CD EF GH IJ KL and the other is MATH.TWO, which contains: MN OP QR If both of these files are stored on DK1, the following sequence of commands may be used to merge the two files into a single file, MATH.NEW, which contains all of MATH.TWO followed by the latter half of file MATH.ONE in the following format: MN OP QR GH IJ KL Call TECO. *2ED$$ Allow all Y commands. *ERDK1:MATH.TWO$$ Open the first input file. *EWMATH.NEW$$ Open the output file on the default device. *Y$$ Read MN into the text buffer. *NR$$ Search for a character string in R, writing MN and OP onto the output file. *PW$$ Write QR onto the output file, appending a form feed. *ERDK1:MATH.ONE$$ Open the second input file. *HKY$$ Read AB into the buffer. QR is over-written. *_G$$ Search for a character string in G, deleting AB, CD, and EF, leaving GH in the buffer. *NK$$ Search for a character string in K, writing GH and IJ on the output file, leaving KL in the buffer. Standard TECO PAGE 134 Techniques *HPEX$$ Write KL onto the output file (without appending a form feed) and close the file, then exit. EXAMPLE 2: ALPHABETIZING BY BINARY SEARCH Assume that TECO is running and that the buffer contains many short lines of text beginning with an alphabetic character at the left margin (i.e., immediately following a line feed). The lines might consist of names in a roster, for example, or entries in an index. The following command string will rearrange the lines into rough alphabetical order. This command string groups all lines which begin with the character "A" at the beginning of the page, followed by all lines with "B", and so on. Note that the algorithm could be extended to place the entries in strict alphabetical order by having it loop back to perform the same binary sorting operation on successive characters in each line. !START! J 0AUA !Load first character of first line into Q-register A ! !CONT! L 0AUB !Load first character of next line into Q-register B ! QA-QB"G XA K -L GA 1UZ ' !If A>B, switch the lines and set a flag (Q-register Z) ! QBUA !Load B into A ! L Z-."G -L @O/CONT/ ' !Loop back if there is another line in the buffer ! QZ"G 0UZ @O/START/ ' !Repeat if a switch was made on the last pass ! The same algorithm can be coded in a more structured way as follows: 0UZ !clear repeat flag! B, switch the lines and set a flag ! QBUA !Load B into A ! L .-Z;> !Loop back if there is another line in the buffer ! QZ;> !Repeat if a switch was made on the last pass ! This example is a bit shorter and does not use any GOTOs. It will also run somewhat faster. Standard TECO PAGE 135 Techniques CHAPTER VI <<>> ALPHABETICAL STANDARD COMMAND SUMMARY This chapter describes only those commands that are compatible amongst all TECO's described by this manual. It also gives examples for each command. It is hoped that with subsequent releases of TECO, this chapter will grow. Only TECO commands are given. Immediate action commands and other special commands are not given. Special characters in strings are also not included in this chapter. Standard TECO PAGE 136 A (append) 1.0 A APPEND COMMAND ====================================================================== Append next page to end of buffer. FORMAT: A ====================================================================== The A (append) command reads in the next page of the input file without clearing the current contents of the editing buffer. TECO concatenates this information to that which is already in the buffer, i.e., TECO places it in the buffer following buffer position Z. An A command does not change the position of the buffer pointer. If the editing buffer does not have sufficient space to accomodate the appended data, TECO issues the ?MEM error message. TECO terminates input begun by an A command when: 1. The end of the input file is reached; 2. A form feed character is read; 3. The buffer is 2/3 full and a line feed character is read; 4. The buffer is filled to within 128 characters of its capacity; or 5. The buffer is full. If TECO reads a form feed (i.e., if input stops because of condition 2), the form feed flag ^E is set to -1. TECO does not place the form feed character into the buffer with the rest of the text. The next input command you enter begins input of the character following the form feed. If a form feed is not read, the form feed flag is set to 0. You may test the form feed flag, but this is usually unnecessary. The A command does not accept a numeric argument. Note that nA, where n is a numeric argument, is a different command. If you wish to append more than one page to the editing buffer, you can type n where n is the number of pages you wish to append. If the end of the input file was previously read, that is, the EOF flag has been set (see ^N), the A command has no effect. Examples: *HKYA$$ This deletes the page of text currently in the editing buffer, and reads into the text buffer two pages of the current input file, appending the second page to the first. Standard TECO PAGE 137 A (cont.) *A$$ This command enters the next page of the file into the editing buffer and appends it to the data already in the buffer. The previous contents of the buffer are not altered and the pointer is not moved. *EX$$ If the contents of a file fit into memory as a single unit, this command string will bring the entire file into memory and remove all form feeds. The ^N^; command will cause TECO to exit from the loop when the end-of-file flag is set. * If the contents of the file fit into memory as a single unit, this command string will bring the entire file into memory, preserving the page structure. Standard TECO PAGE 138 nA 2.0 nA COMMAND ====================================================================== Return the ASCII code of a character. FORMAT: nA where n points to the (n+1)th character following the buffer pointer. ====================================================================== The purpose of the nA command is to return a number equal to the ASCII value for the (.+n+1)th character in the editing buffer. For example, the expression -1A is equivalent to the ASCII code for the character immediately preceding the pointer and 0A is equivalent to the ASCII code of the character immediately following the pointer. NOTE You cannot omit n. If you omit the position indicator, TECO will treat your command as an append command. Because TECO can not determine if you meant to type an nA or A command, no error message can be issued. If you attempt to reference a position outside of the buffer, TECO prints the ?POP error message. Example: 0A-^^/"E This command string segment will verify that 1A-^^B"EMQ' ' the string /B immediately follows the buffer pointer. If it does, TECO executes the macro in Q-register q. If not, TECO executes the commands following the second apostrophe. (The purpose of the ^^ command is to return the ASCII value of the character following it.) 0A-^^/ is an argument which is the value of the character following the pointer minus the ASCII value of a / character. NOTE Some TECO implementations ignore the value of n and treat the nA command like the 0A command. Thus, if you want to interchange macros with such implementations, you should only use the 0A command. Standard TECO PAGE 139 ^Atext 3.0 ^Atext TYPE-OUT COMMAND ====================================================================== Type delimited text. FORMAT: text where the first ^A may be a Caret-A or but the second must be a . ====================================================================== The ^Atext command types the "text" between the ^As on your terminal. The text is usually a message that you wish typed out during the execution of a command string or TECO program. The first ^A is the actual command. Enter it as a Caret-A or a . The second is a delimiter which indicates the last character in the text argument. The second delimiter must be a because a ^ is a legal character within a text string. The string "text" is the character string that TECO types out when it encounters the ^A command. The text string can contain any character except . Example: *0U1 %1=>EC$$ OUTPUTTING PAGE 1 OUTPUTTING PAGE 2 OUTPUTTING PAGE 3 OUTPUTTING PAGE 4 1. 0U1 stores 0 in Q-register 1. 2. The angle brackets indicate TECO will perform a repeated sequence of operations. 3. The 50S command searches for the 50th occurrence of a line feed. If the buffer does not contain 50 lines, the search fails and TECO executes the commands after the failure conditional ("F). 4. TECO appends the next page and branches back to search for the fiftieth line (AOST$). 5. If there are now 50 lines, TECO inserts a form feed into the buffer, and the text in the buffer up to and including the form feed is written to the output file. 6. 0,.K removes this text from the buffer. Standard TECO PAGE 140 ^A (cont.) 7. TECO then prints the message. 8. The %1 command increments the value in Q-register 1, then the = command prints it. 9. This continues until the end-of-file flag is set, that is, ^N=-1. 10. TECO closes the file. Standard TECO PAGE 141 B (beginning) 4.0 B POSITION INDICATOR ====================================================================== Position of beginning of buffer, always 0. FORMAT: B ====================================================================== The B buffer position indicator always equals 0. It represents the position at the beginning of the buffer, that is, the position preceding the first character in the buffer. You may also use the B command in arithmetic expressions. Example: *B,.K$$ Remove all characters from the beginning of the buffer to the character immediately preceding the buffer pointer position. Standard TECO PAGE 142 C (continue) 5.0 C BUFFER POINTER COMMAND ====================================================================== Move pointer forward. FORMAT: nC where n may be positive or negative. ====================================================================== You use the C command to move the buffer pointer. You would normally use this command when the pointer only has to be moved across several characters. The various forms of the C command are listed in Table 3-1. Table 3-1 C Commands Command Argument Function nC n>0 Move the pointer forward over n characters in the buffer from the current position of the pointer, i.e., nC is equivalent to (.+n)J. nC is also equivalent to -nR. C 1 is assumed Move the pointer forward one position. This is equivalent to -R. 0C 0 No movement of the pointer. -C -1 is assumed Move the pointer backward one position. This is equivalent to R. -nC -n<0 Move the pointer backward over n characters in the buffer from the current position of the pointer, i.e., nC is equivalent to (.-n)J. -nC is also equivalent to nR. If a C command attempts to move the buffer pointer across either editing buffer boundary, TECO ignores the command and prints the ?POP error message. Examples: C Advance the buffer pointer one space. L4C Advance the pointer to the position following the fourth character in the next line. Q1C Advance the pointer the number of characters in Q-register 1. Standard TECO PAGE 143 C (cont.) 6.0 ^C COMMAND ====================================================================== Abort or exit. FORMAT: ^C ====================================================================== ^C issued as a TECO command is a TECO command which aborts the present action and returns control to the operating system. Note that the first ^C may be entered in the up-arrow form, but that the second must be a real . A single ^C command not followed by a is not exactly the same on all implementations. Consult chapter V and the appendices for more details. Standard TECO PAGE 144 D (delete) 7.0 D DELETE COMMAND ====================================================================== Character deletion. FORMAT: nD where n may be positive or negative. ====================================================================== The D commands permits you to individually delete characters and short strings. The various forms of the D command are listed in Table 3-2. Table 3-2 D Commands Command Argument Function nD n>0 Delete the n characters following the buffer pointer. D 1 is assumed Delete the character following the buffer pointer. 0D 0 This is a null command. -D -1 is assumed Delete the character preceding the buffer pointer. -nD -n<0 Delete the n characters preceding the buffer pointer. After TECO executes the D command, it positions the buffer pointer between the characters that preceded and followed the deletion. The pointer will always be adjacent to one of the characters to which it was adjacent before the deletion. If you attempt to delete text up to and across the beginning or end of the buffer, no text will be deleted and TECO prints the ?DTB error message. When deleting across carriage return/line feeds, the carriage return/line feed counts as two characters. Standard TECO PAGE 145 D (cont.) Examples: The following examples assume that the buffer contains ABCDE the text shown at the right; the buffer pointer points to FGHIJ the position between the M and the N. KLMNO PQRST UVWXY Z *6D$$ Deletes NO, the carriage return/line feed, and PQ, changing the third and fourth lines to KLMRST. *-D$$ Deletes M. *-5D$$ Deletes the carriage return/line feed, and KLM, changing the second and third lines to FGHIJNO. *-2D2D$$ Deletes LMNO, changing the third line to K. *KD$$ Deletes NO and the carriage return/line feed, and P, changing the third and fourth lines to KLMQRST. Standard TECO PAGE 146 ^D (decimal) 8.0 ^D DECIMAL RADIX COMMAND [Not in TECO-10] ====================================================================== Enter decimal mode FORMAT: ^D ====================================================================== The entering of a ^D or a changes the current radix to decimal if TECO was not already in decimal. You would use this command after you have changed the radix to octal with a ^O command. If the radix is in decimal, this command is a no-op. The initial radix of TECO is decimal. Standard TECO PAGE 147 ^E (form feed flag) 9.0 ^E END-OF-PAGE FORM FEED FLAG SIGNAL ====================================================================== Flag which indicates if a form feed was read when the current buffer's contents were placed into the buffer. FORMAT: ^E ====================================================================== If, when TECO is loading data into the editing buffer, input stops because a form feed was read, it sets the ^E flag to -1. If input was stopped because: 1. The end of the input file was reached; 2. The buffer is 2/3 full and a line feed character is read; 3. The buffer is filled to within 128 characters of its capacity; or 4. The buffer is full the ^E flag is set to 0. The P and other similar output commands test this flag to determine whether they should append a form feed to the contents of the buffer when they write the buffer's contents to the output file. Example: This macro divides a file into pages of 50 lines each. It also preserves original form feeds. EC$$ 1. TECO searches for the 50th line terminator. 2. If this search fails, TECO stores the value of the form feed flag in Q-register 1. 3. If this value is less than 0, TECO writes the buffer to the output file and reads in a new page. 4. If it equals zero, TECO appends a new page to the buffer's contents. 5. TECO then branches back to ST to again search for the fiftieth line. 6. If fifty lines were found, TECO appends a form feed. This Standard TECO PAGE 148 ^E (cont.) text is written to the output file and then deleted. TECO again searches for the 50th line. 7. This continues until the end of the file is reached, i.e., ^N is set to -1. Standard TECO PAGE 149 EB (edit backup) 10.0 EB EDIT BACKUP COMMAND ====================================================================== Open an input and output file, creating a file with the same name as the input file. Upon completion of editing (e.g. EC command), the original input file will be preserved as a backup; the precise operation is operating system dependent. FORMAT: EBfilespec$ @EB/filespec/ where / is an arbitrary delimiter which is not one of the characters in filespec. ====================================================================== You use the EB command to open a file for editing in a manner similar to the TECO filespec command. NOTE You can only use this command for files stored on a directory-structured device. The EBfilespec command is equivalent to: *ERfilespec$EWfilespec$ except that the input file is preserved as a backup. The exact operation of the EB command is as follows: 1. The EB command executes an automatic ERfilespec$ command, opening the specified file for input and releasing any previously opened input file. 2. Then, it opens a temporary file to receive the output of the edited version of the input file. 3. The output device is the same as the input device. 4. Finally, the EB command sets an interal flag indicating that special action must be taken when the EB file is closed (by an EC, EF, EX, or EG command). It also prohibits any further EW or EB commands until the file is closed. The TECO filespec initialization command causes an automatic EBfilespec to be executed (followed by an automatic Y command). Examples: Standard TECO PAGE 150 EB (cont.) *EBAB.FT$$ This command selects the disk file AB.FT for editing. When the editing is completed, the file AB.FT is the new version. TECO changes the old version to the backup file AB.BK, and deletes any previous backup file AB.BK. [OS/8 example] *@EB/DB1:TEXT.TXT/ This command selects the file TEXT.TXT;7 (assuming that version 7 is the latest version of TEXT.TXT on DB1) from device DB1:. This command creates the file DB1:TEXT.TXT;8. [RSX-11/M example] Standard TECO PAGE 151 EC (exit close) 11.0 EC EXIT CLOSE COMMAND ====================================================================== Transfer the remainder of the input file to the output file, then close the input and output files. FORMAT: EC ====================================================================== An EC commands TECO to write the contents of the editing buffer and any information in the input file and not as yet brought into the editing buffer onto the output file. The input and output files are closed. After the execution of an EC command, TECO remains in command mode. The EC command may be contrasted with the EX command which produces the identical output and also closes the input and output files. However, the EX command returns control to the operating system. The advantages of using an EC command instead of an EX command is that TECO does not have to be reloaded and you do not lose data in Q-registers. Example: *EC$$ This command closes the current file, and writes its contents to the appropriate file. Standard TECO PAGE 152 EF (end file) 12.0 EF END FILE COMMAND ====================================================================== End the output file with the current page. FORMAT: EF ====================================================================== The EF command is an output file closing command; that is, TECO closes the file you open with an EW command. You would normally use an EF command to close the output file after all output to it is complete. The EF command is most often used after a P command which outputs the last page of a file. NOTE If you type an EF command in the middle of the file, all succeeding pages that would have been read to it with an EX or EC command are omitted. If you are editing a file, it is far safer to exit with an EC command rather than an EF command because you could lose data if you mistakenly think you are at the end of the file. Examples: *PEF$$ Output the current page to the output file, then close the output file. Use this command string to close a file after writing the last page. *PWEF$$ Equivalent to the preceding example, except that the buffer is not altered. *EFEWTEXT.TE$$ Close the current output file and open an output file TEXT.TE on the system's default device. *ERPTR:$EFEWRXA0:FILE.MA$$ Read the input file from the paper tape reader, close the current output file, and open FILE.MA on RXA0: as an output file. *ERFILE.TX$EWFILE1.TX$ 4PEFEWFILE2.TX$ 4PEFEWFILE3.TX$EC$$ This command divides file FILE.TX into three files. The first two files each consists of four pages. The file FILE3.TX contains the remainder of FILE.TX. If you thought FILE.TX consisted of 12 pages of data, you could have concluded with a 4PEF command string, rather Standard TECO PAGE 153 EF (cont.) than an EC. However, if you were mistaken, you would not have written the remainder to an output file, and thus could lose all text following the 12th page with an EF command. Standard TECO PAGE 154 EG (exit and go) 13.0 EG EXIT AND GO COMMAND ====================================================================== Exit from TECO after output, then either 1. Reexecute the last compile-class CCL command, or 2. Perform the action specified in the optional text argument. FORMAT: EG$ @EG// EGtext$ @EG/text/ where text is an OS/8 monitor command and / is an arbitrary delimiter which is not one of the characters in "text". ====================================================================== The EG command is a dual purpose command. 1. It transfers the contents of the editing buffer and any remaining text in the input file to the output file. It then exits from TECO. This is identical to an EX command. 2. A monitor command or function will then be executed. If you specify a text argument to an EG command, that text must be a monitor command. After the exit from TECO, that command will be executed. Thus, *EGtext$ is equivalent to *EX .text This command form is often used when the text you have created is a batch command file. If it were, you would type EGSUBMIT filespec$$. If you do not specify a text argument, TECO will cause the last compile-class command (e.g., COMPILE, EXECUTE, or LOAD, etc.) attempted before TECO was called to be re-executed (with the same arguments). Generally, you would use the EG command to exit from an editing job that was called by an EBfilespec or TECO filespec command. As an example, suppose you give the command .COMPILE PLOT.FT to request compilation of a FORTRAN source program, but the compiler encounters errors in the code. You would then call TECO to correct Standard TECO PAGE 155 EG (cont.) these errors with the command: .TECO PLOT.FT After you have corrected the errors, you would exit from TECO with the command *EG$$ This command causes: 1) the rest of the file PLOT.FT to be output and closed; and 2) the command COMPILE PLOT.FT to be re-executed automatically. Example: The following is an example that can be called with a MUNG command. It will compile all FORTRAN programs that are on your disk. You call it with the OS/8 command .MUNG COMPIL,*.FT Z"E EBTEMP.TM$ Y3KZJ-3KJ I$JOB $ZJI$END $ EGSUBMIT TEMP.TM/T/H$ 'Z"N EWDIR.TM$ JI$JOB .DIR TEMP.TM<$ ZJI/F .MUNG COMPIL $END $ EGSUBMIT DIR.TM/H/T$' [[ NOT TESTED ]] In this example, the $ symbols indicates dollar signs rather than ESCAPEs. Standard TECO PAGE 156 EH (edit help) 14.0 EH HELP LEVEL COMMAND ====================================================================== Error message printing form command. FORMAT: nEH where n is an integer. ====================================================================== TECO error messages consist of two parts. The first, or three-letter code, is always typed. By using the EH command, you may change TECO so that it prints either only the 3 letter code preceded by a ? or a more detailed description of the error. TECO always prints an error message. Table 3-3 lists the EH commands. Table 3-3 EH Commands Command Function 1EH Sets TECO so that it only prints the 3 letter code part of the error message. 2EH Sets TECO so that it prints both the three-letter error message code and the 1-line description automatically. 3EH Sets TECO so that it prints the three-letter error code, a brief one-line description, and a longer helpful paragraph of information. [In TECO-11, 3EH is equivalent to 2EH.] 0EH Resets TECO to the system standard mode of error message type out (normally equivalent to 2EH). You may return the current value of the EH setting by typing EH. To be useful, this must be typed as a numeric argument to another command. Standard TECO PAGE 157 EK (exit kill) 15.0 EK EXIT KILL COMMAND ====================================================================== Detach output file from TECO without performing input or output. FORMAT: EK ====================================================================== The EK command detaches the output file (if there is one). It does not delete any files. For example, if you type an EWfilespec1$ command and you decide that this is an error and you wish to write to filespec2 instead, then the command EKEWfilespec2$ will detach filespec1 without causing output. You can also use the EK command to detach a file if it were going to overwrite another file. Standard TECO PAGE 158 EO (version) 16.0 EO VERSION COMMAND ====================================================================== Return version number of TECO. FORMAT: EO ====================================================================== An EO command returns a value which specifies the current version number of TECO. If EO does not return the expected number, (7 for TECO-8, 1 for TECO-10, and 34 for TECO-11), this manual may contain inapplicable or erroneous information for your version. NOTE This command is included for compatibility with versions of TECO implemented on other DIGITAL computers. It is never used except to see if you have the version of TECO that this manual is describing. Standard TECO PAGE 159 ER (edit read) 17.0 ER EDIT READ COMMAND ====================================================================== Initializes a file so that TECO may sequentially extract information from it. FORMAT: ERfilespec$ @ER/filespec/ where / is an arbitrary delimiter which is not one of the characters in filespec. ====================================================================== The ER command initializes a file so that TECO may read information from it. An ER command also terminates input from any file that may have been previously opened for input, in addition to opening a file for input. You may open one file for input, read only part of that file, and then, with another ER command, release the first file and open a new file for input. It is not necessary to read the end of one file before opening a second. However, opening the second file does end input from the first. NOTE TECO-8 and TECO-10 do not permit more than one input file to be open at one time. If you are creating a file, then you do not need to enter an ER command. Instead, you will enter the text directly into the text buffer from the terminal keyboard. Examples: *ERPULSE.FT$$ Select the file PULSE.FT from the system default device. *ERCDR:$EWPTP:$$ Select the card reader for input and the paper tape punch for output. *ERDTA1:INPUT.TX$EWRKA0:OUTPUT.TX$$ Open an input file INPUT.TX which is located on DECtape unit 1 and an output file OUTPUT.TX on disk unit 0. *ERRXA1:PROG$$ Prepare to read input file PROG or PROG.MA from RXA1:. Standard TECO PAGE 160 18.0 COMMAND ====================================================================== Throw away any numeric arguments. FORMAT: $ ^[ ====================================================================== An if executed as a TECO command has no special effect other than discarding of numeric arguments. The is frequently used after an n%q command. You would use it to insure that the incremented value in the Q-register is not used as an argument for the following command. TECO echoes an as a dollar sign ($) on a terminal. On some terminals, ESCAPE is labeled ALTmode or PREfix. (The term "ALTMODE" is the traditional TECO name for ESCAPE). Standard TECO PAGE 161 ET (edit terminal) 19.0 ET EDIT TERMINAL COMMAND ====================================================================== Flag and command to set typeout modes. FORMAT: nET where n is a combination of the numbers 1, 2, or 8. ====================================================================== Use this command to control how TECO will type information to your terminal. The three values this command can take are listed in Table 4-4. Each number represents a bit. As these numbers represent bits, they are additive, that is, one ET value does not preclude another. Table 4-4 ET Commands Command Function 1ET Setting this bit inhibits all of TECO's typeout conversions. All characters are output to the terminal exactly as they appear in the buffer or command. For example, the changing of control characters in the "HAR" form is suppressed. This mode is useful for driving displays. 2ET Process and in "scope" mode. Scope mode processing uses the cursor control features of the CRT terminals to handler character deletion by actually erasing characters from the screen. 8ET Read without echoing for ^T command. This allows data to be read by the ^T command without having the characters echo at the terminal. Normal command input will echo. Example: The following example is a TECO command string to erase the entire screen of a VT52. 27^T^^H^TW7^T^^K^T$$ [[ NOT TESTED ]] Standard TECO PAGE 162 EU (edit upper/lower) 20.0 EU EDIT UPPER/LOWER COMMAND ====================================================================== Upper and lower case flagging of output. FORMAT: nEU where n is a positive, negative, or zero integer. ====================================================================== The upper/lower case flag determines the manner in which TECO is to transmit characters to your terminal. If the terminal you are running on supports lower case input, TECO, when called into memory, sets this value to -1. Otherwise it will be set to 0. Use the nEU command to flag upper case output characters with an apostrophe ('). For example, if you are displaying a text, a form of the EU command will tell TECO to precede every character entered in lower case with an apostrophe. Although TECO prints the text in upper case, you would clearly be able to distinguish upper and lower case characters. The forms of the EU command are listed in Table 3-5. Table 3-5 EU Commands Command Argument Function nEU n>0 Flag upper cases characters with an apostrophe. 0EU 0 Flag lower case characters with an apostrophe. nEU n<0 Do not flag characters. Standard TECO PAGE 163 EW (edit write) 21.0 EW EDIT WRITE COMMAND ====================================================================== Initialize the output file. FORMAT: EWfilespec$ @EW/filespec/ where / is an arbitrary delimiter which is not one of the characters in filespec. ====================================================================== Use an EW command to open a file for output. If an output file is currently open, a second EW command closes that file before opening the new file. TECO only permits one output file to be active at any one time. If you type an EWfilespec command while a file is open, TECO deletes the previously opened file. TECO does not permit you to type an EW command if you had opened the file with an EBfilespec command. You may not output any information without first entering an EW or equivalent command. TECO does not permit you to use multiple EW commands without changing the input file. The MAKE filespec initialization command causes TECO to execute an automatic EWfilespec$ command. Examples: *ERRXA2:CREF.2$EWRXA0:CREF.3$$ This command string selects the file CREF.2 on diskette drive 2 for input and opens a file called CREF.3 on diskette drive 0 for output. If there is a file named CREF.3 already on the diskette, it will be overwritten. *EWPROG.PA$$ Prepare to write the output file PROG.PA on the system default device. *EWRXA1:OCON.TE$$ Prepare to write the output file OCON.TE on RXA1:. Standard TECO PAGE 164 EX (exit) 22.0 EX EXIT COMMAND ====================================================================== Exit from TECO to the operating system. FORMAT: EX ====================================================================== The EX command is the easiest method for you to finish an editing job, with the latter part of the input file being properly output and the input and output files being closed. For example, you may be editing a 30-page file and the last change you make is on page 10. At this point you can give the command: *EX$$ . In this case, the action TECO performs is equivalent to the command string 21PEF, with an automatic exit to the monitor at the end. Thus, the action of TECO is: 1. To rapidly move all the rest of the input file, including the page currently in the buffer, to the output file; 2. To close the output file; and 3. To return control to the monitor. The EX command is equivalent to *EC$$ The EX command only outputs a form feed character if, after the output of the editing buffer's contents, it examines the ^E end-of-page form feed flag and finds that a form feed terminated input. In this way, the EX command maintains existing page sizes. Standard TECO PAGE 165 ^F 23.0 ^F COMMAND ====================================================================== Return value of console switch register. FORMAT: ^F ====================================================================== After you enter an ^F or command, TECO returns the number input on the console switch register. (On the PDP-12, this is the right switch register.) Standard TECO PAGE 166 FN (fast non-stop search/replace) 24.0 FN FAST NON-STOP SEARCH/REPLACE COMMAND ====================================================================== Search remainder of the file until text is found, then replace it. FORMAT: nFNtext1$text2$ n@FN/text1/text2/ where n is a positive number. If text2 is omitted, no replacement occurs. / is an arbitrary delimiter which is not one of the characters in "text1" or "text2". ====================================================================== Use an FN command to search for a character string in a page of the input file which may not yet have been read into the buffer (function of the N command) and to replace it with another string. The FN command operates like the N command when searching for the string. If the search fails, no replacement occurs. If you omit text2 in an FN search, TECO deletes text1 and does not insert a string into the buffer to replace it. However, even when text2 is omitted, its terminating delimiter must be present as shown in the form *FNtext1$$ The maximum length of a text argument is 31 ASCII characters. The FN command, like all search commands, accepts a colon modifier. The text1 argument may contain the four match control characters ^Na Match anything except "a" ^Q Use the next command as match character ^S Match on separator ^X Exempt position from match If a search fails, TECO writes the entire input file to the output buffer. You may preface the FN command a number n to indicate which occurrence of a string is the object of the search. If a number specifying which occurrence of a string is to be replaced is less than 1, then TECO prints the error message ?NAS NEGATIVE OR ZERO ARGUMENT TO S. Standard TECO PAGE 167 FN (fast non-stop search/replace) Examples: *12FNSTRING$TEXT$$ This command replaces the twelfth occurrence of STRING with TEXT. *12$$ The first twelve occurrences of STRING are replaced with TEXT. Note the position of the ESCAPEs. The ESCAPE following the TEXT terminates the string TEXT. Because the search is within an iteration, a double ESCAPE cannot be used because it would terminate the command before the iteration were to be entered into the command string. *12<@FN/STRING//>$$ This is similar to the above example with the difference being that STRING is not replaced. If the @ modifier were not used, you would have to type $$. This would prematurely terminate the command and you would receive an error message. Standard TECO PAGE 168 FS (fast search/replace) 25.0 FS FAST SEARCH/REPLACE COMMAND ====================================================================== Search remainder of the editing buffer until text is found, then replace it. FORMAT: nFStext1$text2$ nFStext1$$ n@FS/text1/text2/ n@FS/text1// where n is a positive number, text1 and text2 are less than 32 characters long, and / is an arbitrary delimiter which is not one of the characters in text1 or text2. ====================================================================== The FS command searches for a character string within the current editing buffer (function of the S command) and replaces it with another string. If the string to be replaced is not found after the current pointer position and before the end of the buffer, the search fails and no replacement is made. If a search fails, TECO moves the buffer pointer to the beginning of the editing buffer. If you omit text2 from a FS command, text1 is deleted without replacement. However, when you omit text2, its terminating ESCAPE must be present as shown in the form: *FStext1$$ Text1 and text2, like all search commands, may not be longer than 31 ASCII characters. The FS command may use the a colon modifier. Text1 may use the match control characters: ^Na Match anything except "a" ^Q Use the next command as match character ^S Match on a separator ^X Exempt position from match You may preface the FS command with a number n to indicate which occurrence of a string is the object of the search. If the number specifying which occurrence of a string is to be replaced is less than 1, then TECO prints the error message ?NAS NEGATIVE OR ZERO ARGUMENT TO S. Examples: *12FSOF$FOR$$ This command causes TECO to search the current buffer for the 12th occurrence of the string "OF" and replace it with the string "FOR". *12$$ This command causes TECO to search for, then Standard TECO PAGE 169 FS (cont.) replace, the first 12 occurrences of OF with FOR. Note that the concluding double $$ follows the >. *12FSINTEREST$$ This command causes TECO to search the current page for the 12th occurrence of the string "INTEREST" and delete it. The two ESCAPEs, $$, must be typed following the string to be deleted; the first delimits the string for which you are searching and the second tells TECO that there is no replacement string. *@12FS/INTEREST//$$ This command is identical to the one described immediately above. This is very useful if a double ESCAPE would prematurely terminate your command string. Standard TECO PAGE 170 Gq (get) 26.0 G GET COMMAND ====================================================================== Place Q-register q's contents in the editing buffer. FORMAT: Gq where q is a Q-register. ====================================================================== The command Gq (where q is one of the 36 Q-registers) fetches a copy of the character string stored in the Q-register and inserts it into the editing buffer at the current buffer pointer position. This command does not alter the contents of the Q-register. TECO positions the buffer pointer at the right end of the character string inserted. Examples: *ZJ-5XAJ8LGA$$ This command string puts a copy of the last five lines of the page into Q-register A and then puts a copy of these five lines immedi- ately after the eight lines in the page. It does not delete the five lines from their pos- ition at the end of the page. *STEXT1$0L.U1 This command string stores all text from TEXT1 STEXT2$0L.U2 to TEXT2 in Q-register A, deletes that text Q1,Q2XA from the page, and then places this text on Q1,Q2K the line following TEXT3. NTEXT3$L GA$$ If you type a : before a Gq command, TECO types the contents of that register on your terminal without inserting it into the buffer. Example: If the second command in the above examples was changed to: STEXT1$0L.U1 STEXT2$0L.U2 Q1,Q2XA :GA$$ then the :GA command would verify that you have placed the proper text into the Q-register. Standard TECO PAGE 171 H (wHole) 27.0 H WHOLE POSITION INDICATOR ====================================================================== Incorporate entire buffer (B,Z) limits into a command argument FORMAT: H ====================================================================== The H command is equivalent to the numeric pair B,Z. Thus, in those commands that take two numeric buffer position arguments, H represents the combination B,Z (which is the entire buffer). This letter is particularly useful with type-out and output commands. Examples: *HK$$ Delete entire editing buffer. *HT$$ Type entire buffer. *HXA$$ Insert entire buffer into Q-register A. Standard TECO PAGE 172 I (insert) 28.0 I INSERT COMMAND ====================================================================== Insert text into the buffer FORMAT: Itext$ @I/text/ where text is only limited by available command string storage space and / is an arbitrary delimiter which is not one of the characters in "text". ====================================================================== The I command followed by a text argument is the basic TECO insertion command. Delimit the text argument by an ESCAPE. This command inserts the ASCII text string, "text", into the editing buffer just ahead of the buffer pointer. After the insertion, TECO positions the buffer pointer immediately after the last inserted character. TECO does not insert the ESCAPE terminating the text argument. "text" may contain any character except the special characters listed in Table 1-1. The number of characters in the text is limited by the amount of core available for command string storage. During normal editing jobs, DIGITAL recommends that you limit insertions to about 10 to 15 lines each. If a very long insertion command begins to exceed the TECO command storage capacity, TECO rings the terminal bell once when ten characters of storage remain and once after each additional character entered. The bell also echoes as a ^G. When this occurs, terminate the command string immediately. Entering more than 10 additional characters into the current command string causes a fatal error. The @I/text/ command is slightly more powerful than the I command. It enables you to insert single (but not double) ESCAPE characters in addition to the characters that can be inserted with the I command. The @I form is useful for inserting TECO command strings into the editing buffer. Delimit the text argument to the @I command, both before and after, by any single character which is not itself a part of the text to be inserted. TECO does not require an ESCAPE to terminate the text string; it is the second occurrence of the delimiting character that terminates the text string. The text is inserted immediately preceding the buffer pointer, as it is with the I command. TECO does not insert the delimiting character. Standard TECO PAGE 173 I (cont.) Examples: *JIline one This example shows insertion of several lines line two of text at the beginning of the buffer. line three $$ * *KI Use this command string to delete the tail of $$ a line without removing the carriage return/ * line feed at the end. If the buffer contains ABCD EFGH and the buffer pointer is between the B and the C, this command produces AB EFGH *I Use this command to insert a carriage return without a line feed following it. The single $$ deletes the line feed but not the * carriage return. *@I%TEXT$x$%$$ This is a convenient method for inserting multiple ESCAPEs when using the @I command. Type the sequence x, where x is any character except an ESCAPE, between the successive ESCAPEs. If the x were not typed, TECO would assume that you were terminating the command string. The following examples assume that the buffer contains ABCDEF with the buffer positioned between the D and E. *IXYZ$$ Produces ABCDXYZEF with the buffer pointer be- tween the Z and the E. *I Produces ABCD $$ EF with the buffer pointer positioned before the E. *3RI $4CI $$ Produces A BCDE F Standard TECO PAGE 174 nI$ 29.0 nI$ INSERT COMMAND ====================================================================== Insert a character into the buffer. FORMAT: nI$ n@// where n is the ASCII value of the character to be inserted. ====================================================================== The nI$ command inserts one character into the editing buffer. The n numeric argument includes all characters that the I and @I commands cannot insert. However, the nI$ command inserts only one character at a time. The command nI$ inserts the character with the ASCII value n into the buffer immediately preceding the pointer. NOTE The I$ command inserts a null string into the editing buffer. This is very different from an nI$ command which always inserts a character into the buffer. The nI$ command is most often used to insert the special characters that are filtered out byt he operating system (see table 3-3). Example: If you are creating a macro that you wish to abort immediately if a certain condition occurs, then you could type some command string minus the and then add it with the insert command, i.e., *IABCDEFGHIJKILMN$$ If the were to be inserted after the K, then the command string *3R3I$HXA$$ would insert the ^C, then place the command string in Q-register A. This command string could also be typed *IABCDEFGHIJK$ 3I$ ILMN$$ Standard TECO PAGE 175 , see Standard TECO PAGE 176 J (jump) 30.0 J JUMP COMMAND ====================================================================== Move buffer pointer relative to the beginning of the buffer. FORMAT: nJ where n>0 ====================================================================== The nJ command moves the buffer pointer to the position immediately after the nth character in the buffer. The various forms of the J command are listed in Table 3-6. Table 3-6 J Commands Command Function nJ Move pointer to position following the nth character in the text buffer. 0J Move the pointer to the beginning of the buffer. J Equivalent to 0J. ZJ Move the pointer to the end of the buffer. Standard TECO PAGE 177 K (kill) 31.0 K KILL COMMAND ====================================================================== Line deletion. FORMAT: nK m,nK where n may be positive, negative, or zero if there is one argument. If there are two arguments, m0 Deletes everything from the buffer pointer through the nth line terminator following it. 0K 0 Deletes everything from the pointer back to the beginning of the current line. -K -1 assumed Deletes everything from the pointer back to the beginning of the line preceding the current line. nK n<0 Deletes everything from the pointer back to the beginning of the nth line preceding the current line. m,nK m0 Advances the pointer to the beginning of the nth line following the current line. 0L 0 Moves the pointer back to the beginning of the current line. -L -1 assumed Moves the pointer back to the beginning of the line preceding the current line. -nL -n<0 Moves the pointer back to the beginning of the nth line preceding the current line. If you attempt to move the buffer pointer backward beyond the position immediately prior to the first character in the buffer, or forward beyond the position immediately after the last character in the buffer, TECO does not print an error message; however, TECO moves the pointer to the beginning or end of the editing buffer. Standard TECO PAGE 180 L (cont.) Examples: *J3L$$ The J command moves the pointer to the beginning of the first line in the buffer. The 3L command then moves it to the beginning of the fourth line. *ZJ-2L$$ The ZJ command moves the pointer to the end of the last line in the buffer. Then the -2L command moves the pointer to the beginning of the next to last line in the buffer (assuming that the last line is terminated by a line feed). *L4C$$ Advance the pointer to the position following the fourth character in the next line. Standard TECO PAGE 181 M (macro) 33.0 M MACRO COMMAND ====================================================================== Execute the command string stored in a Q-register. FORMAT: Mq nMq m,nMq where q is a Q-register ====================================================================== TECO command strings are composed of ASCII character and, as such, you can insert or read them into the editing buffer just like any other text. The command string stored in a Q-register is called a macro. When a command string is in the editing buffer, you can edit it. However, you may not execute it because, when it is in the buffer, it appears to be data to TECO. However, if you copy a command string from the editing buffer into a Q-register (using an X command), then this command string can be executed. The command Mq (where q is one of the 36 Q-registers) executes the text in that register. Thus, entering an Mq command is analogous to calling a subroutine. You may include any TECO command in the command string which is stored in and executed from the Q-register. The only restriction is that the commands must all be complete within the macro in the Q-register. For example, a command and its argument must not be split apart, one in the command string and the other in the Q-register. If you include iterations and conditional execution strings these must also be complete within the register. If you use an O command in the macro, the tag to which it branches must also be in the register. The forms of the M command are: Mq Execute the contents of Q-register q. nMq Execute the contents of Q-register q and use n as a numeric argument for the first command in the command string. m,nMq Execute the contents of Q-register q and use m,n as a numeric argument for the first command in the command string. Example: The following shows the creation of a macro to format a file into pages of 50 lines. The macro will be stored in a Q-register, then be Standard TECO PAGE 182 M (cont.) called to operate upon two files. *EWFIFTY.TEC$$ *@I/Y EC/$$ *HXA$$ *EC$$ *EBFILE1.FOR$$ *MA$$ *EBFILE2.FOR$$ *MA$$ * 1. This macro will be kept after it is created in the file FIFTY.TEC. 2. The Y brings in the first page of text. 3. The ^N will signal if the end-of-file flag has been set. 4. If it has been set, ^N; will cause a branching from the iteration. 5. If the page has fewer than fifty lines, a new page is appended to the buffer and the loop is continued. 6. If there are at least 50 lines, a form feed is appended, the 50 lines are output, then killed. 7. This will continue until the ^N flag is set, indicating the end of the file has been reached. 8. AFter the macro has been completed, it is stored with the HXA command into Q-register A. 9. FIFTY.TEC is then closed. 10. FILE1.FOR is then opened, and the Q-register is executed. 11. The procedure is repeated for FILE2.FOR Standard TECO PAGE 183 N (non stop search) 34.0 N NON-STOP SEARCH COMMAND ====================================================================== Search a file for a string until it is found. FORMAT: nNtext$ n@N/text/ where n>0 and / is an arbitrary delimiter which is not one of the characters in "text". ====================================================================== The N command combines the S command with input/output functions. Use the N command to search for a character string in a page of the input file which may not yet have been read into the editing buffer. The N command may accept a colon modifier. "text" may include the match control characters: ^Na Match anything except "a" ^Q Use the next command as match character ^S Match on a separator ^X Exempt position from match The N command differs from the S command in that it does not terminate at the end of the page currently in the buffer. If TECO does not find a match for the search string between the current buffer pointer position and the end of the buffer, the current page is output, the buffer is cleared, and the next page is read in. The search then starts over at the beginning of the new page. This process continues until a match is found or the input file is completely written to the output file. If an N search fails, the entire input file passes through the buffer and is written to the output file. TECO also clears the editing buffer but does not close the output file. Unless the : modifier was used or the search is within an interation, an error message is typed to notify the user that the search has failed. An N search can not detect a match when the matching characters are split across two buffer. It also can not detect a match if the characters are on separate lines unless you include the line separator in the search string. The output function of the N command is exactly like the P command. If a form feed character was encountered when a given page was read in, TECO appends a form feed character to that page when it is output; otherwise no form feed character is output. If you do not include a text argument with a search command, e.g., N$$, TECO executes the search using the last previous search command Standard TECO PAGE 184 N (cont.) argument. You may use the N command with a single numeric argument. The command nN causes a search for the nth occurrence of the search string. When you omit n, TECO assumes n=1. n must be greater than 0. The _ search differs from the N search in that the _ search produces no output. However, both will search through the entire file following the buffer pointer until a match occurs. Examples: *NDIGITAL$$ If page 5 of the text is currently in the buf- fer and the string DIGITAL does not occur un- til page 15, this command causes pages 5 through 14 to be output and page 15 to be read in. The pointer will be set immediately after the L in DIGITAL. *NLAST LIN PG1 If this string actually exists in the file but 1ST LIN PG2 the two lines are not read into the same buf- $$ fer, the N search will fail. In other words, ?SRH FAILED a search can be dependent on how TECO brings * information into the buffer. *NMASSACHUSETS$$ ?S?SRHLED An N search should not be used when an S *EF$$ search would suffice, becaus user errors with *EBOUTPUT.FI$$ the N command, such as the spelling shown *Y$$ here, can cause considerable delay. In this *NMASSACHUSETTS$$ example, the error causes two passes over the entire file instead of just one. Standard TECO PAGE 185 ^N 35.0 ^N ====================================================================== Flag that indicates if the end-of-file has been reached. FORMAT: ^N where the command can be entered as a or Caret-N ====================================================================== The ^N command returns a value indicating if the end of the file has been reached. It is most often used in conjunction with a command that inputs data. The setting of the flag will then be the cause of jumping from an iteration or the fulfillment of a condition for a conditional execution command. It is initially set to 0. When the end-of-file has been reached, it is set to -1. Example: *$$ each page of a file. *<^N^_; P> EX$$ This macro changes all occurences of ABC to DEF and all occurences of XYZ to PQR in an entire file. The ^N terminates the iteration when the ^N flag is set to -1. Standard TECO PAGE 186 O (gOto) 36.0 O GOTO COMMAND ====================================================================== Unconditional branch to a location. FORMAT: Otag$ where tag is composed of ASCII characters delimited by exclamation marks in the command string and by an ESCAPE in the O command. ====================================================================== The purpose of the tag following the O is to name the destination of the unconditional branch instruction. The tag location itself may be either before or after the O command in the command string. However, the branch cannot be before the beginning of the current iteration. For example, if you enter the following command string: . . .!tag1!. . .<. . .Otag1$. . .> TECO will produce an error message. However, the command string segment . . . is legal. The O command causes the command string execution pointer to be moved to the first character following the exclamation point that terminates the tag, and command execution continues from that point. Tags are ignored except when an O command forces TECO to scan the command string from them. There is no restriction on the length of the tag (except that it must fit into the buffer). The tag must also be in the same macro level, i.e., you cannot branch from within a called macro to outside of the contents of the Q-register nor can you branch from outside of a macro into it. Standard TECO PAGE 187 37.0 COMMAND ====================================================================== Change to octal radix. FORMAT: ^O ====================================================================== The entering of a ^O or changes the current radix to octal if TECO was not already in octal. If the radix is in octal, this command is a no-op. The intial radix of TECO is decimal. Standard TECO PAGE 188 P (page) 38.0 P PAGE COMMAND ====================================================================== Write the buffer's contents to the output file. FORMAT: nP m,nP where n may be positive, negative, or zero if there is one argument. If there are two arguments, m0 Executes the P command n times. This comand can be used to skip over several pages of text when no editing is required. The nP command causes the n pages of the input file, starting with the page currently in the editing buffer, to be output, and then the nth page after the current page to be brought in. m,nP m0 if there is one argument. If there are two arguments, m0) outputs n copies of the text in the buffer, appending a form feed to each copy. The PW command does not clear the buffer nor does it move the buffer pointer. (The same is also true of a P command used with two arguments.) Note also that when you use a PW command with a single argument, a form feed character is always automatically sent to the output file immediately following the data from the buffer. TECO appends the form feed character to the outgoing data regardless of whether or not it encountered a form feed character when the data was read in, i.e., regardless of the setting of the ^E form feed flag. This is not true of the P command. Table 3-10 lists the various forms of the PW command. Table 3-10 PW Command Command Argument Function PW 1 is assumed Writes the contents of the buffer onto the output file and appends a form feed character. The buffer is not cleared and the pointer position remains unchanged. nPW n>0 Same as n. This executes the PW command n times. m,nPW m0 Move the pointer backwards over n characters in the buffer from the current buffer pointer position. nR is equivalent to -nC. R 1 is assumed Move the pointer backward one character. 0R 0 This is a null command. -R -1 is assumed Move the pointer forward one character. This is equivalent to C. -nR -n<0 Move the pointer forward over n characters in the buffer from the current buffer pointer position. -nR is equivalent to nC. If an R command attempts to move the pointer across either buffer boundary, TECO ignores the command and prints the ?POP error message. Example: *0L2R$$ The 0L command moves the pointer back to the beginning of the current line. Then, the 2R command moves it back past the last two characters in the preceding line (i.e. back over the pair that are normally found at the end of a line. Standard TECO PAGE 195 S (search) 42.0 S SEARCH COMMAND ====================================================================== Search for a character string. FORMAT: nStext n@S/text/ where n>0 and text is less than 32 characters long. ====================================================================== Use the S command to search for a character string within the current editing buffer. If the string is not found between the current buffer pointer position and the end of the buffer, the search fails. After an unsuccessful S search, the buffer pointer is reset to the beginning of the buffer, and, unless you had used the : modifer or the search is within an iteration, TECO prints message. Type the search string as an alphanumeric argument following the S. Terminate it with an ESCAPE. "text" can contain any character except those listed is Table 1-1, Special Characters. "text" may not contain more than 31 characters. The S command may be used with a single numeric argument. The command nS causes a search for the nth occurrence of the specified search string. When n is omitted, n=1 is assumed. n must be greater than 0. If you are searching for text that contains an ESCAPE, you can use an @ modifier to the S command. If you do not include a text argument with an S command, e.g., S$$, TECO executes the search using the last previous search command argument. The S command may use the match control characters ^Na Do not match on "a" ^Q Use next command as match character ^S Match on a seperator ^X Exempt next positon from matching Examples: *SAB$$ This causes the pointer to be positioned immediately after the B, in the first occurrence of the string AB after the current position of the pointer. *SNIX$$ The string NIX is not found between the cur- ?SRH SEARCH FAILED rent pointer position and the end of the buffer. The error message is typed and the pointer is moved to the beginning of the Standard TECO PAGE 196 S (cont.) buffer. You may have typed an incorrect search string, the pointer may have been positioned somewhere in the buffer after the N, or the string NIX may not be in the editing buffer. *@3S+$+IEF$$ The command @3S+$+ searches for the third occurrence of the ESCAPE character following the buffer pointer. When this ESCAPE is found, the characters EF are inserted immediately after it. The + characters serve as the delimiters for the one-character search string $. The + characters are not part of the search string. Standard TECO PAGE 197 T (type) 43.0 T TYPE COMMAND ====================================================================== Type out text in the editing buffer. FORMAT: nT where n may be positive, negative, or zero. ====================================================================== You can type any part of the text in the editing buffer for examination by using the T command. The text TECO types depends on the position of the buffer pointer and the argument(s) given. The T command never moves the buffer pointer. When preceded by a single numeric argument, T is a line-oriented command; when preceded by a pair of numeric arguments, T is a character-oriented command. The T command variations are described in Table 3-12. Table 3-12 T Commands Command Argument Function T 1 assumed Type out everything from the buffer pointer through the next line terminator. If the pointer is at the beginning of a line, T causes the entire line to be TECO typed out. If the pointer is in the middle of a line, T causes that portion of the line following the pointer to be typed out. nT n>0 Type out everything from the buffer pointer through the nth line terminator following it. If the pointer is at the beginning of a line, this command types out the next n lines (including the current line). 0T 0 Type out everything from the beginning of the current line up to the pointer. This command is especially useful for determining the position of the buffer pointer. -T -1 assumed Types out everything in the line preceding the current line, plus everything in the current line up to the pointer. nT n<0 Types out everything in the n lines preceding the current line, plus everything in the current line up to the pointer. m,nT m0 Types the n characters immediately following the buffer pointer. .-n,.T n>0 Types the n characters immediately preceding the buffer pointer. HT H=B,Z Types out the entire contents of the buffer. Examples: The following examples assume the buffer contains the text ABCDE shown at the right, with the buffer pointer positioned be- FGHIJ tween the M and the N. KLMNO PQRST UVWXY Z *T$$ NO *3T$$ NO PQRST UVWXY *0T$$ Note that no carriage return/line feed exists between KLM* the beginning of the line the pointer is on and the pointer itself, therefore, none is typed. The second asterisk indicates that TECO is ready for the next command. *0TT$$ This pair of commands causes the line to be typed to be KLMNO typed out without moving the pointer. *-2T$$ ABCDE FGHIJ KLM* *.,.+6T$$ The six characters typed are NO, carriage return/line NO feed, and PQ PQ* *.-2,.T$$ LM *0LT$$ This pair of commands types out the entire current line KLMNO and leaves the pointer at the beginning of the line. Standard TECO PAGE 199 ^T 44.0 ^T TYPE-IN COMMAND ====================================================================== Use the ASCII code for the next character typed at the terminal as an argument. FORMAT: ^T ====================================================================== ^T is equivalent to the ASCII code for the next character you type at the terminal. When TECO executes a command string, every ^T character encountered causes it to pause and accept one character typed at the terminal. TECO then substitutes the ASCII code for this character for the ^T. This command is only useful as a numeric argument for another command. It is often used with an ^Atext message string preceding it. The message string inform the user that TECO is waiting for a character to be typed in. Example: * for an nI$ command. This command string in- ^TI$>$$ serts the letter which is typed in following FUNCTION LETTER M each occurrence of the string FUNCTION that is FUNCTION LETTER N found by the search command. FUNCTION LETTER C *^TUC$$ Places the ASCII value of the typed character Q-register C. Standard TECO PAGE 200 ^T 45.0 ^T TYPE-OUT COMMAND ====================================================================== Type out the character whose ASCII code precedes the command. FORMAT: n^T where n is the ASCII code for a character ====================================================================== The n^T command types out the character whose ASCII code is n. Example: *J$$ to type the next line. Standard TECO PAGE 201 46.0 INSERT COMMAND ====================================================================== Insert followed by text into editing buffer. FORMAT: text$ ====================================================================== The tab command is equivalent to the I command, except that the tab command causes TECO to insert the tab itself as well as all the following text up to the ESCAPE. In other words, if the first character of a text string to be inserted by an I command is a tab, you may omit the I. The number of characters in the text is limited by the amount of memory available for command string storage. During normal editing jobs, DIGITAL recommends that you limit insertions to about 10 or 15 lines each. If a long insertion command begins to exceed the TECO command storage capacity, TECO rings the terminal bell once when ten characters of storage remain and once after each additional character entered. When this occurs, terminate the command string immediately. Entering more than 10 additional characters into the current command string causes a fatal error. Example: If the buffer contains ABCDEF with the buffer pointer positioned between the D and E, then *XYX$$ produces ABCD XYZEF The pointer is now between the Z and E Standard TECO PAGE 202 U 47.0 U COMMAND ====================================================================== Insert number into a Q-register FORMAT: nUq where n is an integer and q is a Q-register designator. ====================================================================== The nUq command stores the integer n in Q-register q (where q is one of the 36 Q-registers). If anything was previously in the numeric part of the Q-register, it is destroyed. Example: *SLINE 1$0L.U1 This command string will delete the text be- SLINE 2$.U2 ginning at "LINE 1" and preceding "LINE 2". Q1,Q2K$$ Standard TECO PAGE 203 ^Uqtext$ 48.0 ^Uqtext$ COMMAND ====================================================================== Enter the text following the command into a Q-register. FORMAT: ^Uqtext$ @^Uq/text/ where q is a Q-register designator, text is the character string to be inserted into the Q-register, and / is an arbitrary delimiter which is not one the characters in "text". ====================================================================== Text is normally placed into a Q-register by copying it from the editing buffer (through the use of the Xq command). The ^U command gives you the option of directly inserting a text into a Q-register. TECO places the text into the Q-register when it begins executing the command string. The command can only be entered directly by using the circumflex construction. Because the text often contains ESCAPE characters, DIGITAL recommends that you use the @ modifier form. Standard TECO PAGE 204 W 49.0 W WINDOW COMMAND ====================================================================== 1. Perform a display cycle. FORMAT: W 2. Show n lines before and after the cursor. FORMAT: nW where n>0 ====================================================================== NOTE These commands are only used with non-refreshable CRTs. 49.1 W COMMAND Perform a display cycle. Update the display from the current buffer. 49.2 W COMMAND Set display mode to show n lines before and after line containing the cursor. The initial display shows 3 lines above and below the cursor. Standard TECO PAGE 205 X (eXtract) 50.0 X EXTRACT COMMAND ====================================================================== Insert text into a Q-register FORMAT: nXq m,nXq where n is positive, negative, or zero if there is one argument. If there are two arguments, m0 Copies everything from the current buffer pointer postion through the nth following line terminator character into Q-register q. Xq 1 is assumed Copies the text of the current line from the buffer pointer position to the next line terminator into Q-register q. 0Xq 0 Copies the text of the current line preceding the buffer pointer to the buffer pointer into Q-register q. -nXq -n<0 Copies everything from the current buffer pointer position back through the beginning of the line containing the nth preceding line terminator into Q-register q. -Xq -1 is assumed Copies the text of the line preceding the current line and the current line to the buffer pointer position into Q-register q. m,nXq m where n is the number of pages to be ignored. The Y command aborts if the text buffer is not empty and an output Standard TECO PAGE 208 Y (cont.) file is open. Examples: *ERREPORT.TE$Y$$ This command string opens the file REPORT.TE for input and reads in the first page of that file. *ERDTA3:DATA.FOR$YYY$$ This command string reads in and discards the first two pages of the DECtape file DATA.FOR, and then reads in the third page of that file. If an output file were open, you would have to type 3. Standard TECO PAGE 209 Z 52.0 Z POSITION INDICATOR ====================================================================== Indicates the last position in the editing buffer. FORMAT: Z ====================================================================== Z is a buffer position indicator that equals the number of characters in the buffer. Thus, Z is a number that is the count of how many characters are in the buffer. While Z is often used as an argument to a command, you can also use it in arithmetic expressions. Example: One common use of Z is to verify if characters have been read into the editing buffer, e.g., the command string segment ...ZU1 A Z-Q1"E... stores a number which is the count of the characters in the buffer, and appends a new page. The second Z indicates the new number of characters in the buffer. When the former count is subtracted from it, if that number equals zero, then no characters were read in. Standard TECO PAGE 210 ! (tags) 53.0 !tag! ====================================================================== A string of ASCII characters used to identify a location in a command string. FORMAT: !tag! where ! precedes and follows the ASCII string. ====================================================================== When an O command directs the execution of a command string from the its linear order of execution, the place to which TECO is directed is called a tag. The tag is delimited both before and after with exclamation points. Tags may be thought of in much the same way as labels in other programming languages. The length limitation of a tag is solely that of what will fit in the command string register. Because you do not have to reference tags, they can serve as comments within a command string or macro. (Normally, comments are included only in lengthly TECO macros that will be maintained.) Standard TECO PAGE 211 " 54.0 " BRANCHING COMMANDS ====================================================================== Depending upon the argument, skip any command that precedes an apostrophe at the same nesting level. FORMAT: n"X....' where n is the argument to the conditional execution command; " signals that the command is a conditional execution command; X is the condition to matched; and the ' represents the place to begin execution if the condition is not satisfied. ====================================================================== In this command, n is the numeric argument on which TECO bases its decision to execute a command string. The quotation mark (") is the first character of all conditional execution commands. Immediately following the " is a character which must be one of those listed in Table 3-14. Terminate this command string with an apostrophe ('). If n satisfies the condition, TECO executes all the commands until the ' in the usual manner. If there is no branch command within the range "...', then after TECO executes the last command in the range, command execution falls through the apostrophe and execution begins with the next command following it. If n does not satisfy the condition, then TECO skips all the commands before the apostrophe, and command execution continues with the first command following the apostrophe. Only use the " and ' in matching pairs. You may nest them in the same manner that parentheses surrounding arithmetic expressions can be nested. As TECO scans for the matching single quote, it keeps an iteration count for each level of nested iteration which it finds. TECO then ignores any single quotes which occur at a nesting level greater than 0. NOTE All conditionals must end at the same macro level in which they begin. The individual conditional execution commands are shown in table 3-14. Standard TECO PAGE 212 " (cont.) Table 3-14 Conditional Execution Commands Command Function n"C Execute the commands that follow if n is an ASCII character (A-Z, a-z, 0-9). n"E Execute the commands that follow if n=0. n"F Execute the commands that follow if n represents a false (flag is off)(i.e., if n=0). n"G Execute the commands that follow if n>0. n"L Execute the commands that follow if n<0. n"N Execute the commands that follow if not = 0. n"R Execute the commands that follow if n is the ASCII code for an alphanumeric character (A-Z, a-z, 0-9). n"S Execute the commands that follow if n represents success (i.e., if n<0). n"T Execute the commands that follow if n represents true (flag is on) (i.e., if n<0). n"U Execute the commands that follow if n represents unsuccessful (i.e., if n=0). n"< Execute the commands that follow if n<0. Same as n"G. n"> Execute the commands that follow if n>0. Same as n"L. n"= Execute the commands that follow if n=0. Same as n"E. Examples: *!START!JPDP-8 TECO $ !INSERT PAGE HEADING! !CHANGE 5K TO 6K! !CHANGE WAR TO LOVE! PZ"NOSTART$ !GET NEXT PAGE AND! 'EF$$ !RESTART IF NOT NULL! This small editing program also contains an example of the O unconditional branching command, i.e., the OSTART$ command which causes a jump back to !START!. String tags are also used purely for documentation, e.g., !INSERT PAGE HEADING!. This example also shows how a conditional execution command may be combined with an O command to produce a conditional branch. Standard TECO PAGE 213 " (cont.) 1. After TECO performs all three of the editing functions on the page, it executes the P command to write this page and read in the next. 2. The program then tests Z (the number of characters in the buffer) to determine if any data was read in. 3. If Z does not equal 0, data was read in; therefore a branch is taken to restart the program. 4. When Z=0, the command OSTART$ is skipped, and execution branches to the concluding EF command. This techinque fails when a file contains null pages (consecutive form feed characters). The ^N end-of-file test may be preferred. *YZ"N!##! Z-4000+1"G4000J 0L 12I$ 0,.P0,.K 0##$ 'ZJ A .-Z"NO##$ ' 'PEF$$ * This slightly more complex command string shows how conditional execution commands may be nested. If the first Y command produces no data, the "N command sends execution to the matching apostrophe on the right. This is the last apostrophe, immediately prior to the PEF. Otherewise, TECO executesthe commands following the "N. The function of this command string is to convert a file with pages of arbitrary lengths to one with pages of approximately 4000 characters each. The command string operates as follows: 1. Z-4000+1"G means if Z>4000, i.e., there are at least 4000 characters on the current page, execute the following commands; otherwise, skip to the matching apostrophe (between $ and Z). 2. If Z>4000, 4000J and 0L moves the pointr to the end of the last complete line before the 4000th character in the buffer. 3. Then, 12I$ and 0,.P outputs this much of the buffer with a form feed character after it, and 0,.K deletes that which has been output. 4. Now, go back to !##! and test Z again. Stay in this loop until Z<4000. 5. Execution then skips to the apostrophe. ZJ moves the pointer to the end of the current buffer. 6. A appends another page., but leaves the pointer (.) at the end of the previous page 7. .-Z"N checks to determine if any data was actually read in. Standard TECO PAGE 214 " (cont.) If so, the loop is reentered at !##!; otherwise the end of the file has been reached. 8. When .-Z=0, execution skips to the matching apostrophe and then falls through the next apostrophe to the PEF that closes the output file. NOTE Another algorithm would be Y EC$$ *$$ This example shows how the value returned by a colon search can be used as the argument for a conditional execution command. 1. The N command searches through the file for the first occurrence of SIN on any page. 2. When SIN is found, the command :SCOS$ checks for an occurrence of COS following SIN on the same page. 3. The colon search command returns the value -1 if the search is successful, and 0 if there is no COS following SIN on the page. 4. This value is then used as the numeric argument for the "S command. 5. If :SCOS$ has a value of -1, the occurrence of COS that was found is replaced by TAN. 6. If :SCOS$ has a value of 0, the commands -3DITAN$ are skipped. 7. We then jump to the end of this page, ignoring all further occurences of SIN and COS on it, and continue the iteration process. Standard TECO PAGE 215 % 55.0 % COMMAND ====================================================================== Change the number stored in a Q-register by n. FORMAT: n%q where n is a number and q is a Q-register designator. ====================================================================== The command n%q adds n to the integer in Q-register q and then returns the new value in the same manner as a Qq command. If you omit n, 1 is assumed (i.e., 1%q). Note that this command returns a value as well as incrementing the stored value. If you wish to increment the value in the Q-register, but do not want the returned value to be used as an argument for the next command, type an ESCAPE after the n%q command, (that is, n%q$). Standard TECO PAGE 216 . 56.0 . POSITION INDICATOR ====================================================================== Return a number equal to the number of characters preceding the buffer pointer in the editing buffer. FORMAT: . ====================================================================== A period equals the number of characters to the left of the current positon of the buffer pointer, and hence represents the buffer pointer position itself. That is, it represents the number of characters from the beginning of the buffer to the present buffer pointer position. The . can be used in arithmetic expressions. Standard TECO PAGE 217 : 57.0 : MODIFIER ====================================================================== 1. Return a value if a search fails. FORMAT: :nStext$ :n@S/text/ where S represents any search command and / is an arbitrary delimiter which is not one of the characters in "text". 2. Do not output a carriage return after typing out a number. FORMAT: := :== 3. Cause a Gq command to type-out its contents without inserting the contents into buffer. FORMAT: :Gq where q is a Q-register designator. ====================================================================== 57.1 : S MODIFIER Use the colon modifier to alter the execution of a serach command in the event a search fails. Normally, a search that fails causes TECO to print an error message; if you use the colon modifier, no error message is printed. Instead, every colon search returns a numeric value that TECO can print out, store in a Q-register, or test by a conditional branch. A colon search command returns the value -1 if the search is successful, and the value 0 if the search fails. The general form of a colon search command is the same for S, FS, N, and FN searches: nSstring$ The colon normally precedes the search command letter and its numeric argument, if any. Both the colon and @ modifier may be used on a search command in either order. Just as the Z command takes on a value that may be used as a numeric argument, so also the command :Sstring$ takes on a value of 0 or -1 after TECO executes the search. If this is the last command in a command string, or if the command following it does not take a numeric Standard TECO PAGE 218 : argument, the value returned by the colon is discarded. Consequently, a colon search should be followed by a command that takes a numeric argument. The colon search commands reposition the buffer pointer in the same manner as other search commands, regardless of whether or not the returned value is used. The primary use of the colon search is in programmed editing. The command is usually followed by a conditional command. 57.2 : NUMERICAL TYPE-OUT MODIFIER See the = and == discussion for information on how : modifies numeric type-out commands. 57.3 : Q-REGISTER TYPE-OUT COMMAND See the G command for information. Standard TECO PAGE 219 : 58.0 ; COMMAND ====================================================================== 1. If an argument is positive or zero, jump out of current iteration field. FORMAT: n; where n is a number, either explicit or returned. 2. If the search command immediately preceding the ; failed, jump out of current iteration field. FORMAT: ; ====================================================================== Terminate repetition of a command string loop before the iteration count is satisfied by using the conditonal iteration exit command, semicolon (;). You can only use the ; command within angle brackets. You may use it with or without a numeric argument. When you use a semicolon without a numeric argument, it evaluates the outcome of the last search (of any kind) that was executed before TECO encountered the semicolon. If this search was successful, command execution continues within the loop, as if no ; were present. If, however, the most recent search failed, the ; command causes all those commands that follow the ; in the loop to be skipped over, and command execution to pass to the first command following the right angle bracket which closes the innermost loop which contains the semicolon. The semicolon command is most often used with a numeric argument. TECO ignores the command n; if n<0. However, if n>0 or n=0, the command n; causes command execution to exit from the loop just as a ; command exits from the loop when a search fails. Standard TECO PAGE 220 <...> 59.0 <...> COMMAND ====================================================================== Continue executing the command string until conditions are met. FORMAT: n<...> where n is a positive number. If n is omitted, the command is executed an infinite amount of times or until an exit condition within the loop occurs. ====================================================================== You can cause a group of commands to be iterated (repeatedly executed) any number of times by placing the commands within angle brackets. The left angle bracket marks the beginning of a command string loop and the right angle bracket marks the end of the loop. These command string loops can be nested in the same manner as arithmetic expressions are nested within parentheses. Loops should be nested to no more than approximately 10 levels; otherwise, a pushdown list overflow may occur. You may use a numeric argument to type the number of times a given loop is executed. The argument is placed before the left angle bracket in the form n<...>. This causes the group of commands within the brackets to be iterated n times. In a command of the form <...>, if the argument is less than or equal to zero, TECO skips the commands within the angle brackets. If no argument is given, the number of iterations is assumed to be infinite. Example: *J8<$L>$$ This command string inserts a tab at the beginning of the first eight lines in the buffer and leaves the pointer positioned at the beginning of the ninth line. The J command starts the pointer off at the beginning of the first line. The first command in the loop, $, inserts a tab. Then the L command moves the pointer to the next line to prepare for the next iteration of the loop. *J<0LIJAN$ This command string inserts JAN at the begin- FS1969$1970$;> ning of the first line in the buffer and at HT$$ the beginning fo each line that contains JAN REPORT 1970. It also changes the 69 in every occur- DEPT: rence of 1969 to 1970. The action is as the JAN 1970 SALES J command starts the operation at the WHOLESALE beginning of the buffer. The first execution RETAIL of the 0L does nothing. IJAN$ then inserts JAN 1970 EXPENSES JAN at the beginning of the first line. Now OVERHEAD a search is made for 1969. When it is found, Standard TECO PAGE 221 <...> (cont.) ADVERTISING FS1969$1970$ changes 1969 to 1970. This com- JAN 1970 RETURNS pletes the first iteration; execution loops JAN 1970 INVENTORY the first iteration; execution loops back to the <. 0L moves the pointer to the beginning of the line where the 1969 was found. Here JAN is inserted and then a search is begun for the next 1969. This continues until the search comand fails to find another 1969. When the search fails, the pointer is moved to the beginning of the buffer. HT is the next command which is executed. (This macro assumes that no line contains more than one 1969.) *EBfilespec$50000EX$$ This removes all form feeds from a file. *$$ This command causes a search of the current page for all occurrences of the string READ and replacement of them with the string WRITE. *<@FN/ERROR//;>$$ This command causes TECO to search all of the following pages for the string ERROR and delete every occurrence of it. The @ construction must be used in this case because it allows you to specify a delimiter other than $. The delimiter must be specified twice after the string; the first to delimit the string and the second to indicate that a replacement string is not present. If $ were used as the delimiter, a double $ would be present which would cause an erroneous termination of the command string. Standard TECO PAGE 222 = 60.0 = NUMERICAL TYPE-OUT COMMAND ====================================================================== Type-out a number in decimal or octal (with or without a following carriage return) FORMAT: = := == :== where a single = means type out in decimal, a double = means type out in octal, and the : modifier means do not type a carriage return after typing. ====================================================================== Table 3-15 outlines this commands. Table 3-15 = Commands Command Function n= Type the value of n in decimal followed by a carriage return/line feed. n:= Same as n= except the carriage return/line feed is suppressed. n== Type the value of n as an unsigned octal number followed by a carriage return/line feed. n:== Same as n== except the carriage return/line feed is suppressed. Examples: *YZ==$$ This reads in a page and then types out the (deci- 2529 mal) number of characters in the page. *0A==$$ This types the octal representation of the next 40 character in the buffer. *YNCHAPTER $\=$$ This command searches for the next chapter heading 16 and then types out the number of the chapter. The buffer pointer points to the location immediately following the 6. Standard TECO PAGE 223 ? 61.0 ? COMMAND ====================================================================== Trace the execution of a TECO command string FORMAT: ? where ? is inserted into the command string. ====================================================================== The use of a question mark causes TECO to enter trace mode. In trace mode, TECO types out each command as it is executed. A second question mark takes TECO out of trace mode. The ? command only traces commands that TECO executes, i.e., if a branching command causes a command to be skipped over, TECO does not print the commands skipped over. Example: *JHT? !L!1A-9"N !M!1A-58"NCOM$ 'CD$ 'LOL$$ AB: LINE 1 LINE 2 C: LINE 3 LINE 4 !L!1A-9"N!M!1A-58"NCOM$1A-58"NCO!M!1A-58 "NCD $'LOL$1A-9"NLO!L!1A-9"N!M!1A-58" NCO!M!1A-58"NCD $'LO!L!1A-9"NLO!L!1A-9!M !1A-58"NC?POP *J?HT$$ J? AB: LINE 1 After the first question mark command, TECO LINE 2 begins typing out each command as it is exe- C: LINE 3 cuted. This enables you to see exactly what LINE 4 the command string is doing. The ?POP error message is caused by the attempt to move the pointer beyond the end of the fourth (and last) line with the C command. The second question mark command turns off trace feature so that the HT following it is not printed. Standard TECO PAGE 224 @ 62.0 @ TEXT DELIMITER MODIFIER ====================================================================== Modifies the next command which takes a text argument to use the delimiter form. FORMAT: @x/text/ where x is one of the commands listed in Table 3-16 that takes a text argument and / is an arbitrary delimiter which is not one of the characters in "text". ====================================================================== You use an @ modifier to alter the method by which TECO reads a command's text. The general form and the commands for which the @ modifier is applicable are listed in Table 3-16. Table 3-16 @ Commands @nS/text/ Search page @nN/text/ Search file @n_/text/ Search file @nFS/text1/text2/ Search page and replace @nFS/text1// Search page and delete @nFN/text1/text2/ Search file and replace @nFN/text1// Search file and delete @I/text/ Insert text n@I// Insert character @EB/filespec/ Edit Backup @EG// Exit and execute last @EG/text/ Exist and execute text @ER/filespec/ Edit read @EW/filespec/ Edit write @^Uq/text/ Insert text in Q-register Place the @ modifier before the command and before a numeric argument, if any. When you use the @ modifier, the text string is delimited not by the command and an ESCAPE, but by the first character you type after the command and the next recurrence of this command. In the above examples, the delimiting character is a slash. The delimiting character may be any character except a character that appears in the text itself. Using the @ modifier, you may enter single (but not double) ESCAPEs into a text string. Use the @ modifier in the above commands to separate the strings with a delimiting character other than an ESCAPE. This is useful in cases where a double ESCAPE cannot terminate the command. For example, if you are searching for a string, then deleting it without replacement, you would ordinarily type a double after an FS or FN command. However, if this were within a command string, the command would be Standard TECO PAGE 225 @ terminated at this point unless you used an @ modifier. Standard TECO PAGE 226 \ 63.0 \ COMMAND ====================================================================== 1. Returns the numbers following the buffer pointer. FORMAT: \ 2. Insert a character numeric string into the buffer. FORMAT: n\ where n is the number to be inserted. ====================================================================== 63.1 \ COMMAND The command (without a numeric argument) is equivalent to the value of the digit string (optionally preceded by a + or - sign) immediately following the current position of the buffer pointer. The value is terminated by the first character TECO encounters that is not a legal digit in the current radix. If there is no digit, TECO returns a 0. TECO interprets the digit string in the current radix. Example: *YNCHAPTER $\=$$ This command searches for the next chapter head- 16 ing and then types out the number of the chapter. The buffer pointer is positioned immediately following the 6 after thiscommand has been executed. 63.2 n\ INSERTION COMMAND You use the n\ command to insert the ASCII representation of a number n into the buffer. TECO inserts the number in the current radix. For example, 349\ inserts the ASCII characters, 3, 4, and 9 into the buffer immediately preceding the pointer. Note that n does not have to be a number typed in by the user. It can be a value which some other TECO command returns. Standard TECO PAGE 227 ^^ 64.0 ^^x COMMAND ====================================================================== Return the ASCII value of a character FORMAT: ^^x where x is an ASCII character ====================================================================== The ^^ command, when followed by an arbitrary character x, is equivalent to the ASCII value of that character. For example, in the command ^^A, the character A is an argument for ^^ and TECO does not interpret it as a command. Examples: *^^MU0$$ This command stores the ASCII value of the letter M (77) into Q-register 0. Standard TECO PAGE 228 _ 65.0 _ COMMAND ====================================================================== Search for a character string and discard all pages before the string is found FORMAT: n_text$ n@_/text/ which n indicates what occurence of the string is to be found and / is an arbitrary delimiter which is not one of the characters in "text". ====================================================================== The backarrow command is identical to the N command except that a _ search generates no output. Generally, where the N command executes a P, the _ executes a Y. You use the _ search for examination functions and for discarding parts of a file. You can also use the _ command with a single numeric argument. The command n_ causes a search for the nth occurrence of the search string. When you omit n, TECO assumes n=1. n must always be greater than 0. "text" may not be longer than 31 ASCII characters. "text" may include the match control characters ^Na No match on character "a" ^Q Use following command as match character ^S Match on separator ^X Exempt position from match The _ command may use a : modifier. Example: *5_VERSION88$$ This command can be used to determine if the string VERSION88 occurs in the input file five times. If it does, the pointer is positioned immediately after the fifth occurrence, and everything in the input file preceding the page on which the fifth occurrence is located, is discarded. If it is not, the entire file is is discarded. Standard TECO PAGE 229 Error Messages CHAPTER VII ERROR MESSAGE PROCESSING 7.1 ERROR MESSAGES When TECO encounters an illegal command or a command that cannot be executed, an error message is printed at the terminal. Error messages are of the form: ?XXX Message where "XXX" is an error code and "Message" is an explanatory message. When an error message is generated, the command to which it refers is not executed, the rest of the current command string is ignored, and TECO prints an asterisk at the left margin to indicate that it is ready to accept further commands. In some cases it may be difficult to determine which command in a long command string resulted in an error message. Typing a question mark immediately after the TECO-generated error message causes TECO to print the current command string up to and including the erroneous character. When used in this manner, the question mark must be the first character typed after the error message is printed. It is not necessary to follow the question mark with an ESCAPE. Some error messages include the mention of a specific character in error (or sometimes a string of characters in error). In such cases, the character in error is printed in a special format if it is not a printing character, so that you will be best able to see the error of your ways. If the character is a control character, , it will be displayed as , except for a few special control characters that will be displayed as shown in the following table: Character ASCII Special display 11 12 13 14 15 33 In addition, TECO-8 displays special symbols to represent the presence of match control constructs within a search string. These are shown below: Display Construct Meaning ^N Match anything except next construct ^X Match any character Standard TECO PAGE 230 Error Messages ^S Match any separator 7.2 IMPLEMENTATION-SPECIFIC ERROR MESSAGES If you are merely interested in the general flavor of TECO's error messages, or want to look up the meaning of a specific error message, consult APPENDIX M. In that appendix, all TECO error messages are listed alphabetically by their 3-letter code. This 3-letter code is, in general, the same across all TECO implementations. Whereas appendix M merely paraphrases the wording on the error messages, the following paragraphs give you the exact wording of all the error messages for all TECO implementations covered by this manual. The 3-letter code of the error message is given first, then the one-line error message (produced if EH&3=2) is given, then the detailed error message (produced if EH&3=3) is given. 7.2.1 TECO-11 ERROR MESSAGES Code Message ?BNI > not in iteration ?CPQ Can't pop Q-reg ?DTB Delete too big ?FNF No such file "filespec" ?IEC Illegal E character ?IFC Illegal F character ?IIA Illegal insert arg ?ILL Illegal command ?ILN Illegal number ?IPA Illegal P arg ?IQC Illegal " character ?IQN Illegal Q-reg name ?IRA Illegal radix arg ?ISA Illegal search arg ?ISS Illegal search string ?IUC Illegal ^ character ?MEM Memory overflow ?MRP Missing ) ?NAB No arg before ^_ ?NAC No arg before , ?NAE No arg before = ?NAP No arg before ) ?NAQ No arg before " ?NAS No arg before ; ?NAU No arg before U ?NFI No file for input ?NFO No file for output ?NYA Numeric arg with Y ?OFO Output file already open ?PDO Push-down list overflow ?POP Pointer off page ?SNI ; not in iteration Standard TECO PAGE 231 Error Messages ?SRH Search failure "string" ?STL String too long ?UTC Unterminated command ?UTM Unterminated macro ?XAB Execution aborted ?YCA Y command aborted RT-11 ERROR MESSAGES ?DEV Invalid device ?DIO Directory I/O error ?INP Input error ?MFN Missing file name ?NRO No room for output ?OUT Output error ?UEA EA not implemented ?UEI Edit indirect not implemented ?UEN EN not implemented ?UEP EP not implemented RSTS/E ERROR MESSAGES ?ERR RSX-11 ERROR MESSAGES (includes VAX/VMS) ?nnn Standard TECO PAGE 232 Error Messages 7.2.2 TECO-10 ERROR MESSAGES ?ARG Improper Arguments The following argument combinations are illegal: 1) , (no argument before comma) 2) M,N, (where M and N are numeric terms) 3) H, (because H=B,Z is already two arguments) 4) ,H (H following other arguments) ?ASN Ambiguous Switch Name: "/SWITCH" The switch "/SWITCH" is not uniquely abbreviated, i.e. more than one switch will match "/SWITCH". A longer, unique form of the switch should be used. ?BAK Cannot Delete Old Backup File Failure in RENAME process at close of editing job initiated by an EB command or a TECO command. There exists an old backup file "filnam.BAK" with a protection "" such that it cannot be deleted. Hence the input file "filespec" cannot be renamed to "filnam.BAK". The output file is closed with the filename "Filespec". The RENAME MUUO error code is "nn". ?BNF Block not found This is an internal error and should be reported. A block of text, such as a previously-executed command, or q-register text, was not in the linked list of such blocks. ?BPT Breakpoint in macro "q" The most recent EB file was: "filespec" The most recent ER file was: "filespec" The most recent EW file was: "filespec" The most recent search argument was: "string" EO="nn", ET="nn", ED="nn" ARG="nn", SARG="nn", VALUE="nn", Flags="nn" ?CCM CCL Command Missing TECO-10 was run with a run-offset of one (1) and there was no file 'EDT' in TMPCOR or ' EDT.TMP' on the user's disk area. ?CEF Core expansion failure The current operation requires more memory storage than TECO-10 now has and TECO-10 is unable to obtain more core from the monitor. This message Standard TECO PAGE 233 Error Messages can occur as a result of any one of the following things: 1) Command buffer overflow while a long command string is being typed, 2) Q-register buffer overflow caused by an X or [ command. 3) Too many Q-registers in use (.gt.5000), 4) Too much nesting or recursion of the M command. 5) Editing buffer overflow caused by an insert command or a read command or other causes. ?CFP Can't Find Overflowed PDL A PDL overflow trap occurred, but TECO-10 could not find the PDL that caused the overflow. This is an internal error and should be reported, along with a teletype printout showing what the user was doing. ?CON Confused use of conditionals Conditionals, parenthesized arguments, and iterations must be properly nested. The user probably used some construct like: N"E...(...' where an iteration or parenthesized argument is begun in a conditional but not terminated in the same conditional. ?EBD EB with Device "dev:" is Illegal The EB command and the TECO command may be specified only with file structured devices (ie: disk and DECtape.) ?EBF EB with Illegal File "filespec" The EB command and the TECO command may not be used with a file having the filename extension ".BAK" or a file having the name "NNNXTC.TMP" where NNN is the user's job number. The user must either use an ER-EW sequence or rename the file. ?EBO EW Before Current EB Closed An ER or EW command may not be given while an EB command is in progress. Give an EF to close the files if you wish to do an ER or EW, or an EK to cancel the current EB. ?EBP EB Illegal because of file "filespec" Protection The file "filespec" cannot be edited with an EB command or a TECO command because it has a protection "" such that it cannot be renamed at close time. ?EMA EM with Illegal Argument The argument N in an NEM command must be greater than zero. ?EMD EM with no Input Device Open EM commands apply only to the input device, and should be preceded by an ER (or equivalent) command. To position a tape for output, that Standard TECO PAGE 234 Error Messages unit should be temporarily opened for input while doing the EM commands. ?END EN with a Device is Illegal Since it is not possible to RENAME across devices. There must be no device specified in an EN command. The device is specified in the ER command which selected the file. ?ENO EN REQUIRES AN OPEN INPUT FILE EN commands apply to the file currently open for input. You must execute an ER command to select the file to be RENAME'd or deleted before executing an EN. ?ENT-00 Illegal Output Filename "filespec" ENTER UUO failure 0. The filename "filespec" specified for the output file cannot be used. the format is invalid. ?ENT-01 Output UFD for the file "filespec" not found ENTER UUO failure 1. The file "filespec" specified for output by an EE, EW, EA, EZ, OR MAKE command cannot be created because there is no user file directory with the project-programmer number "[p,pn]" on device "dev:". ?ENT-02 Output Protection Failure ENTER UUO failure 2. The file "filespec" specified for output by an EE, EA, EZ, EB, MAKE, or TECO command cannot be created either because it already exists and is write-protected against the user, or because the UFD it is to be entered into is write- protected against the user. ?ENT-03 Output File being Modified ENTER UUO failure 3. The file "filespec" specified for output by an EE, EW, EA, EZ, EB, or TECO command cannot be created because it is currently being created or modified by another job. ?ENT-06 Output UFD or RIB Error ENTER UUO failure 6. The output file "filespec" cannot be created because a bad directory block was encountered by the monitor while the ENTER was in progress. The user may try repeating the EE, EW, EA, EB, or TECO COMMAND, BUT IF The ERROR PERSISTS, IT IS IMPOSSIBLE TO PROCEED. Notify your system manager. ?ENT-14 No Room or Quota Exceeded on "dev:" ENTER UUO FAILURE 14. The output file "filespec" cannot be created because there is no more free space on device "dev:" or because the user's quota is already exceeded there. ?ENT-15 Write Lock on "dev:" Standard TECO PAGE 235 Error Messages ENTER UUO failure 15. The output file "filespec" cannot be created because the output file structure is write-locked. ?ENT-16 Monitor Table Space Exhausted ENTER UUO failure 16. The output file "filespec" cannot be created because there is not enough table space left in the monitor to allow the enter. The user may try repeating the EE, EW, EA, EB, or TECO command, but if the error persists he or she will have to wait till conditions improve. ?ENT-23 Output SFD Not Found ENTER UUO failure 23. The output file "filespec" cannot be created because the Sub-File-Directory on which it should be entered cannot be found. ?ENT-24 Search List Empty ENTER UUO failure 24. The output file "filespec" cannot be created because the user's file structure search list is empty. ?ENT-25 Output SFD Nested Too Deeply ENTER UUO failure 25. The output file "filespec" cannot be created because the specified SFD path for the ENTER is nested too deeply. ?ENT-26 No Create for Specified SFD Path ENTER UUO failure 26. The output file "filespec" cannot be created because the specified sfd path for the ENTER is set for no creation. ?ENT-41 Undefined Network Node. ENTER UUO failure 41. The device "dev:" cannot be opened because the node on which it resides is not on line. Try again later. ENTER FAILURE "nn" on Output File "filespec" The attempted ENTER of the output file "filespec" has failed and the monitor has returned an error code of "nn". This error is not expected to occur on an ENTER. Please report it to your systems manager with the tty printout showing what you were doing. ?EOA nEO Argument Too Large The argument "n" given with an EO command is larger than the standard (maximum) setting of eo="2" for this version of TECO-10. This must be an older version of TECO-10 than the user thinks he is using; the features corresponding to EO="n" do not exist. ?FNF-00 Input File "filespec" not Found LOOKUP UUO failure 0. The file "filespec" specified for input by an ER, EB, EI, EP, OR TECO command was not found on the input device "dev:". Standard TECO PAGE 236 Error Messages ?FNF-01 Input UFD - not Found LOOKUP UUO failure 1. The file "filespec" specified for input by an ER, EB, EI, EP, OR TECO command cannot be found because there is no User File Directory with project-programmer number "[p,pn]" on device "dev:". ?FNF-02 Input Protection Failure LOOKUP UUO failure 2. The file "filespec" specified for input by an ER, EB, EI, EP OR TECO command cannot be read because it is read-protected "" against the user. ?FNF-06 Input UFD or RIB Error LOOKUP UUO failure 6. The input file "filespec" cannot be read because a bad directory block was encountered by the monitor while the LOOKUP was in progress. The user may try repeating the ER, EB, EI, EP OR TECO command, but if the error persists all is lost. Notify your system manager. ?FNF-16 Monitor Table Space Exhausted LOOKUP UUO failure 16. The input file "filespec" cannot be read because there is not enough table space left in the monitor to allow the LOOKUP. The user may try repeating the ER, EB, EI, EP, OR TECO command, but if the error persists he or she will have to wait until conditions improve. ?FNF-23 Input SFD not Found LOOKUP UUO failure 23. The input file "filespec" cannot be found because the sub-file-directory on which it should be looked up cannot be found. ?FNF-24 Search List Empty LOOKUP UUO failure 24. The input file "filespec" cannot be found because the user's file structure search list is empty. ?FNF-25 Input SFD Nested Too Deeply LOOKUP UUO failure 25. The input file "filespec" cannot be found because the specified SFD path for the LOOKUP is nested too deeply. ?FNF-41 Undefined Network Node. LOOKUP UUO failure 41. The device "dev:" cannot be opened because the node on which it resides is not on line. Try again later. Lookup Failure ("nn") on Input File "filespec" The attempted LOOKUP on the input file "filespec" has failed and the monitor has returned an error code of "nn". This error is not expected to occur on a LOOKUP. Please give the terminal prinout showing what you were doing to your system manager. Standard TECO PAGE 237 Error Messages ?ICE Illegal ^E Command in Search Argument A search argument contains a ^E command that is either not defined or incomplete. The only valid ^E commands in search arguments are: ^EA, ^ED, ^EV, ^EW, ^EL, ^ES, ^E, and ^E[A,B,C,...]. ?ICN Illegal ^N Command in Search Argument When used in a search argument, the ^N command must be followed by a character. ?ICT Illegal Control Command "^x" in Text Argument The character "^x" is neither a printing control character nor a valid control command in a text string. TO RECOVER: immediately type "*81EOM8". The character "x" is legal text if EO=1. Alternatively, retype the string with the control characters preceded by ^Q, ^R, or ^T. ?IDV Input Device "dev:" not Available INITIALIZATION FAILURE. Unable to initialize the device "dev:" for input. Either the device is being used by someone else right now, or else it does not exist in the system. ?IEM Re-Init Failure on Device "dev:" After EM Unable to re-initialize the device "dev:" after executing an EM command on it. If this error persists after retrying to initialize the device with an ER command(or EW command if output to the device is desired), consult your system manager. ?IER Input Error While Reading a File While reading an initialization, EI, EP, etc. an i/o error occurred. ?IES Input Error While Reading SWITCH.INI An I/O error occurred whilst reading SWITCH.INI. ?IFC Illegal Character "^x" After F "F" was interpreted as part of a 2-letter command. "F"^x" is not recognized as a command. ?IFS Illegal Character "^x" in File Specification File specifications must be of the form: DEV:FILE.TXT[PATH] where DEV, FILE, and EXT are alphanumeric strings. No characters other than these may appear between the EB, ED, EE, EI, EN, EP, EW, or EZ command and the altmode terminator ($). ?ILL Illegal Command: "^x" Standard TECO PAGE 238 Error Messages The character "^x" is not defined as a valid TECO-10 command. ?ILM Illegal Memory Reference TECO-10 made an illegal memory reference. This is an internal error and should be reported, along with a teletype printout showing what the user was doing. The value of the buffer pointer is set to the beginning of the buffer; the buffer and file should (hopefully) remain intact. ?ILR Cannot LOOKUP Input File "filespec" to RENAME it Failure in rename process at close of editing job initiated by an EB command or a TECO command. Unable to do a LOOKUP on the original input file "filespec" in order to RENAME it to "filnam.BAK". The output file is closed with the name "Filespec". The LOOKUP UUO error code is "nn". ?ILS Illegal EL Specification A numeric specification for the EL command must be greater than or equal to 0, and less than or equal to 3. ?INP Input Error "nn0000" on File "filespec" A read error has occurred during input. The input file "filespec" has been released. The user may try again to read the file, but if the error persists, the user will have to return to his or her backup file. The input device error flags (status word right half with bits 22-35 masked out) are "nn0000" ("nn0000") ?INP-01 BLOCK TOO LARGE). ?INP-02 PARITY OR CheCKSUM ERROR). ?INP-03 BLOCK TOO LARGE AND PARITY ERROR). ?INP-04 DEVICE ERROR, DATA MISSED). ?INP-05 BLOCK TOO LARGE AND DEVICE ERROR). ?INP-06 PARITY ERROR AND DEVICE ERROR). ?INP-07 BLOCK TOO LARGE, PARITY ERROR, AND DEVICE ERROR). ?INP-10 IMPROPER MODE). Standard TECO PAGE 239 Error Messages ?INP-0 BLOCK TOO LARGE AND IMPROPER MODE). ?INP-12 PARITY ERROR AND IMPROPER MODE). ?INP-13 BLOCK TOO LARGE, PARITY ERROR, AND IMPROPER MODE). ?INP-14 DEVICE ERROR AND IMPROPER MODE). ?INP-15 BLOCK TOO LARGE, DEVICE ERROR, AND IMPROPER MODE). ?INP-16 PARITY ERROR, DEVICE ERROR, AND IMPROPER MODE). ?INP-17 BLOCK TOO LARGE, PARITY ERROR, DEVICE ERROR, AND IMPROPER MODE). ?IPA Illegal argument to "P" command The "P" command can take a numeric argument, which is the number of pages to move. A negative argument is illegal. ?IPP Illegal Character "^x" in PPN A PPN IS OF The FORM [PJ,PG,SFD1,...,SFDN] WheRE "PJ", "PG", AND ",SFD1,...,SFDN" ARE OPTIONAL. "PJ" AND "PG" MUST BE OCTAL NUMBERS. AN SFD is an alphanumeric or quoted string. ?IPR Illegal Character "^x" in /PROTECT Switch The format of the /PROTECT switch is: /PROTECT:NNN Where NNN is an octal number and may optionally be enclosed in angle brackets (ie: /protect:) ?IQC Illegal Character "^x" after " Command The ONLY VALID " COMMANDS ARE "G, "L, "N, "E, "C, "R, "A, "D, "V, "W, "T, "F, "S, and "U. ?IQN Illegal Character "^x" in Q-Register Name A Q-register name must be in one 2 formats: (1) X , where "X" is a printing character (except `,{,|,},~) (2) (FOO) where "FOO" is up to 6 alphanumerics, or is in quotes. ?IQR Illegal Character "^x" in Q-Register Name, please retype The Q-register name given in the "*" command contains an illegal character. Re-type the "*" and a legal q-register name. Standard TECO PAGE 240 Error Messages A Q-register name must be in one 2 formats: (1) X , where "X" is a printing character (except `,{,|,},~) (2) (FOO) where "FOO" is up to 6 alphanumerics, or is in quotes. ?IRB Cannot Rename Input File "filespec" to "filnam.BAK" Failure in rename process at close of editing job initiated by an EB command or a TECO command. The attempt to rename the original input file "filespec" to the backup filename "filnam.BAK" has failed. The output file is closed with the name "Filespec". The RENAME UUO error code is "nn". ?IRN Cannot Re-Init Device "dev:" for Rename Process Failure in rename process at close of editing job initiated by an EB command or a TECO command. Cannot reinitialize the original input device "dev:" in order to rename the input file "Filespec" to "filnam.BAK". The output file is closed with the name "filespec". ?ISW Illegal Character "^x" in a Switch AN ARGUMENT WAS EXPECTED AFTER The SWITCH "/SWITCH". A COLON (:) WAS EXPECTED. ?ITT Illegal TTCALL Type Value "nn" The EXTENDED TTCALL command must take the form "arg1,arg2:^T" where arg1 is the (optional) TTCALL argument and arg2 is the TTCALL type in decimal. The second argument must be a legitimate TTCALL type, With 0-13 legal except for 3(OUTSTR). :8^T will do a RESCAN, :1,8^T tests for CCL entry point. ?IUU Illegal LUUO A local uuo was encountered which is not legal. This error should not occur. close your files and report this problem to your system manager. ?LDV Cannot Access Log Device I can't get that device for a log file, dummy! ?LFE Cannot ENTER Log File I can't make the file, dummy! ?LLB Linked-list broken This is an internal error. The linked list of q-register values, etc. is broken. Try to save your edits and exit. This is an internal error which should be reported. Save your output. ?MAP Missing ' Standard TECO PAGE 241 Error Messages Every conditional (opened with the " command) must be closed with the ' command. ?MCP Missing Control PDL A pdl overflow was trapped and the control pdl was found to be missing. This error should not occur. Close your files and report the problem to your system manager. ?MEF Macro Ending with F A command macro being executed from a Q-register ends with the character "F". This is an incomplete command. F is the initial character of an entire set of commands. The other character of the command begun by F must be in the same macro with the F. ?MEO Macro Ending with Unterminated O Command The last command in macro "q" is an "O" command with no delimiter to mark the end of the tag-name. ?MEQ Macro Ending with " The macro "q" ends with a " character. This is an incomplete command. " must be followed by G, L, N, E, C, A, D, V, W, T, F, S, or U to indicate the condition under which the following commands are to be executed. This character must be in the Q-register with the ". ?MEU Macro Ending with ^ The macro "q" ends with a ^ character. This is an incomplete command. ^ followed by a character converts the character into a control character for command parsing. The character was not there. ?MIQ Macro Ending with "^x" The macro "q" ends with the "^x" command. This command requires a Q-register name of 1 character or up to 6 characters in parentheses. ?MLA Missing Left Angle Bracket There is a right angle bracket that has no matching left angle bracket. An iteration must be complete within the macro or command. ?MLP Missing ( There is a right parenthesis that is not matched by a corresponding left parenthesis. ?MRA Missing Right Angle Bracket Standard TECO PAGE 242 Error Messages There is a left angle bracket that has no matching right angle bracket. An iteration must be complete within the macro or command. ?MRP Missing ) There is a right parenthesis that is not matched by a corresponding left parenthesis. ?MSC Missing Start of Conditional A ' command (end of conditional) was encountered. Every ' command must be matched by a preceding " (start of conditional) command. ?MUU Macro Ending with ^^ The macro "q" ends with either a control-^ or ^^. This is an incomplete command. The ^^command takes a single character text argument that must be in the Q-register with the ^^. ?NAE No Argument Before = The command N= or N== causes that value N to be typed. The = command must be preceded by either a specific numeric argument or a command that returns a numeric value. ?NDI No Delimiter After I If the I command has a numeric argument it must be followed by a null text string i.e.: 33I$ or 33@i// ?NAQ No Argument Before " The " command must be preceded by a single numeric argument on which the decision to execute the following commands or skip to the matching ' is based. ?NAU No Argument Before U The command NUI stores the value N in Q-register I. The U command must be preceded by either a specific numeric argument or a command that returns a numeric value. ?NFI No File for Input Before issuing an input command (Y, ^Y, or A) it is necessary to open an input file by use of an ER, EB, or TECO command. ?NFO No File for Output Before giving an output command (PW, P, ^P, N, EX, or EG) it is necessary to open an output file by use of an EA, EB, EW, EZ, MAKE, or TECO command. Standard TECO PAGE 243 Error Messages ?NLF No Log File Open A command of the form nEL was given, but there is no log file open to have parameters modified. ?NSI Null Switch Name is Illegal A switch name must consist of one or more alphanumeric characters. ?NTQ No text in Q-register The Q-register "q" does not contain text. ?NYA Numeric argument to "Y" or "EY" command The "Y" command does not take numeric arguments. Did you type "0YY" instead of "0TT"? ?ODV Output Device "dev:" Not Available Initialization failure. Unable to initialize the device "dev:" for output. Either the device is being used by someone else right now, or it is write locked, or else it does not exist in the system. ?OFO EW Before Current Output file Closed An EB,EW,EA, or EZ command may not be given while an output file is open. Give an EF to close the file if you wish to save the output file as it is, or an EK to throw away the current output file. ?OUT Output Error "nn0000". Output File "filespec" Closed An error on the output device is fatal. The output file is closed at the end of the last data that was successfully output. It has the filename "Filespec". See the TECO Reference Manual section 4.4 for a recovery technique. The output device flags (status word right half with bits 22-35 masked out) are "nn0000" ("nn0000") ?OUT-00 End of Tape). ?OUT-01 Block Number Too Large, Device Full or Quota Exceeded). ?OUT-02 Parity or Checksum Error). ?OUT-03 Block Number Too Large and Parity Error). ?OUT-04 Device Error, Data Missed). Standard TECO PAGE 244 Error Messages ?OUT-05 Block Number Too Large and Device Error). ?OUT-06 Oarity Error and Device Error). ?OUT-07 Block Number Too Large, Parity Error, and Device Error). ?OUT-10 Improper Mode or Device Write Locked). ?OUT-11 Block Number Too Large and Improper Mode). ?OUT-12 Parity Error and Improper mode). ?OUT-13 Block Number Too Large, Parity Error, and Improper Mode). ?OUT-14 Device Error and Improper Mode). ?OUT-15 Block Number Too Large, Device Error, and Improper Mode). ?OUT-16 Parity Error, Device Error, and Improper Mode). ?OUT-17 Block Number Too Large, Parity Error, Device Error, and Improper Mode). ?OWL OUTPUT ERROR writing LOG FILE AN OUTPUT ERROR OCCURED, DUMMY! ?PAR Confused Use of Parentheses An iteration may not be contained within a parenthesized expression. ?PES Attempt to Pop Empty Stack A ] command (pop off q-register stack into a q-register) was encountered when there was nothing on the q-register stack. ?PNF Page Number "nn" Not Found An attempt to move to page "nn" of the input file "filespec" was made with the ^P or ^Y command. that page does not exist in the input file. ?POP Attempt to move Pointer Off Page. Standard TECO PAGE 245 Error Messages The argument specified with a J, C, R, or D command must point to a position within the current size of the buffer. (ie: between B and Z inclusive.) This can also occur on a "]()" command since the numeric value will be used for ".". This can also occur with the nA command (A with numeric argument) if (.+n) attempts to access a character off either end of the buffer. ?PPC Attempt to Move Previous to Current page with ^P or ^Y The argument to a ^P or ^Y command is an absolute page number in the file. it must be greater than or equal to the current page number. ?PTS PDL Table Too Small There are not enough ENTRIES in the pdl table. This error is not expected to occur. Close your files and report the problem to your system manager. ?RNF-01 UFD for "filespec" Not Found RENAME UUO failure 1. The new filespec "Filespec" specified by an EN command cannot be used because there is no directory "[p,pn]" on device "dev:". ?RNF-02 Protection Failure for "Filespec" RENAME UUO faulure 2. the filespec "Filespec" specified by an EN command cannot be used because you are not privileged to RENAME the input file. ?RNF-03 File Being Modified RENAME UUO failure 3. The filespec "filespec" specified by an EN command cannot be used because the input file is being modified by someone. ?RNF-04 Rename Filename "filespec" already exists RENAME UUO failure 4. The filespec "filespec" specified by an EN command could not be used because there is already a file by that name. ?RNF-06 UFD or RIB Error RENAME UUO failure 6. The filespec "filespec" specified by an EN command could not be used because a bad directory block was encountered by the monitor. Notify your system manager. ?RNF-22 Cannot Delete a Non-Empty Directory RENAME UUO failure 22. The filespec "filespec" specified by an EN command could not be used because the input file was a directory which was not empty, and therefore cannot be deleted. Standard TECO PAGE 246 Error Messages ?RNF-23 Output SFD Not Found RENAME UUO failure 23. The output file "filespec" specified by an EN command could not be used because the Sub-File-Directory on which the file should be placed does not exist. RENAME failure "nn" for "filespec" The attempted Rename of the Input file has failed and the monitor has returned an error code of "nn". This error should probably not happen on a RENAME. Please report the problem to your systems manager. ?RNO Cannot Rename Output File "Filespec" Failure in rename process at close of EDITING job initiated by an EB command or a TECO command. The attempt to rename the output file "Filespec" to the name "filespec" originally specified in the EB or TECO command has failed. The original input file "filespec" as been renamed "filnam.BAK", BUT The OUTPUT FILE IS CLOSED WITH The NAME "Filespec". The RENAME UUO error code is "nn". ?SAL Second Argument Less Than First In a two argument command, the first argument must be less than or equal to the second. ?SEF Superceding Existing File: "filespec" The output file "filespec" already exists on "dev:". This message is warning the user that his or her existing file is being overwritten. ?SNA Initial Search With No Argument A search command with null argument has been given, but there was no preceding search command from which the argument could be taken. ?SNI ; Not in Iteration The semicolon command may be used only in an iteration. ?SRH Cannot Find "string" A search command not preceded by a colon modifier and not within an iteration has failed to find the specified character string "string". If an S, FS, FD, or any negative or bounded search fails, the pointer is unchanged. After an n or _ search fails, the last page of the input file has been read and, in the case of N, output, and the buffer cleared. ?STC Search String Too Long The maximum length of a search string is 80 characters, including Standard TECO PAGE 247 Error Messages all string control commands and their arguments. ?STL Search String Too Long The maximum length of a search string is 36 character positions, not counting extra characters required to specify a single position. ?TAG Missing Tag !tag! The tag !tag! specified by an O command cannot be found. This tag must be in the same macro level as the O command referencing it. ?TAL Two Arguments With L The L command takes at most one numeric argument, namely, the number of lines over which the buffer pointer is to be moved. ?TSD Too Many Nested SFD'S The number of Sub-File-Directories specified in a path exceeds the number allowed by TECO-10. IF DESIRED, The USER MAY RE-ASSEMBLE TECO-10 WITH 'C$SFDL' EQUAL TO The DESIRED NESTING LEVEL OF SFD'S. ?TTY Illegal TTY I/O Device A teletype may be specified as an input/output device in an ER, EW, EZ, or MAKE command only if it is not being used to control an attached job, the user's own terminal. ?UAT Unenabled APR Trap An APR trap occurred which was not enabled. This error should not occur. Please report it to your systems manager. ?UCA Unterminated ^A Command A ^A message type-out command has been given, but there is no corresponding ^A to mark the end of the message. ^A commands must be complete within a single macro level. ?UEN Unimplemented "EN" command The EN command is not implemented, sorry. ?UFS Macro Ending with Unterminated File Selection Command The last command in the macro "q" is a file selection command (ER, EW, EB, ED, EL, EI, EN, or EZ) with no delimiter to mark the end of the file specification. The file selection command must be complete within the Q-register. ?UIN Unterminated Insert Command Standard TECO PAGE 248 Error Messages An insert command (possibly an @ insert command) has been given without terminating the text argument at the same macro level. ?UQN Unterminated Q-Register Name (missing ) ) If a multi-character q-register name is specified, it must be terminated by a right parenthesis. the format is: ) > ?USN Unknown Switch Name: "SWITCH" The switch "/SWITCH" is not defined with either input or output file selection commands. The currently implemented switches are: /PROTECT, /ASCII, /LSN, /NOIN, /NOOUT, /APPEND, /SIXBIT, /OCTAL, /NONSTD, /GENLSN, and /SUPLSN. ?USR Unterminated Search Command A search command (possibly an @ search command) has been given without terminating the text argument at the same macro level. ?UTG Unterminated Tag A command string tag has been indicated by a ! command, but there is no corresponding ! to mark the end of the tag. Tags must be complete within a single command level. ?VAI Version incompatability The current version of TECO-10 may be incompatable with save files written with the EE command with an old version of TECO-10. Re-compile all your macros and re-issue the EE command if possible. If this is not possible, it may be possible to continue, but random errors may occur. ?XTB Attempt to execute the Text editing Buffer. The Q-register "q" is currently sharing with the blank Q-register, which is the Text-editing buffer. Do "HXqMq". ?XXX Should Not Occur. Please report this problem to your systems manager as soon as possible. sorry for the inconvenience. try to close your files if possible. ?YCA "Y" or "_" command aborted due to non-empty buffer The "Y" and "_" commands are only legal if the editing buffer is empty, or if 2ED is set, or in a macro. "EY" is the same command as "Y" but without this restriction. "E_" is the same command as "_" but without this restriction. Standard TECO PAGE 249 Error Messages 7.2.3 TECO-8 ERROR MESSAGES ?ARG Improper Arguments The following argument combinations are illegal: 1) , (no argument before comma) 2) m,n, (more than two arguments) 3) H, (because H=B,Z is already two arguments) ?MEM Storage Capacity Exceeded The current operation requires more memory storage for text (in the text buffer) than TECO has available. In 8K machines, there is room for at most xxxx characters of text. On larger machines, there is room for 4000 (decimal) characters. ?FER File Error File error can mean one of five things: 1) Input file not found on an ER command 2) Error while trying to enter the output file on an EW or EB command 3) The device specified in a file specification does not exist 4) EB command given on a non-file-structured device 5) Attempt to perform an EB on a file with a .BK extension ?FUL Output Command would have Overflowed An output command such as P, EX, EC, EG, PW, N, or FN would have written more data to the output file than there was room allocated on the output device. The data that would have overflowed the output device is still in the text buffer and has not been written out. You can close the output file with an EF command and then open a new output file and continue editing. When you are all done, PIP can be used to merge the two output files back into one. ?IEC Illegal Character "x" after E The only commands starting with the letter E are EB, EC, ED, EF, EG, EH, EK, EO, ER, ES, ET, EU, EW, EX and EY. When used as a command (i.e. not in a text argument), E may not be followed by any character except one of these. Secondary I/O streams (EA, EP, EI), magtape commands (EM), wildcard lookups (EN), and device initialization (EZ) are not available in TECO-8. The ES flag does not currently do anything. ?IFC Illegal Character "x" after F Standard TECO PAGE 250 Error Messages The only commands starting with the letter F are FS, F, and FN. When used as a command (other than EF or in a text argument), F may not be followed by any character other than one of these. The S, , or N must immediately follow the F with no intervening spaces or commands. The two characters in an F command may not be split across macros. The FR command is not implemented in TECO-8. ?IFN Illegal Character "x" in Filename File specifications must be in the form dev:filnam.ext where dev, filname, and ext are alphanumeric. The file specification may optionally end with a /S which means ignore end-of-file on any subsequent input. No characters other than the ones specified may appear in a text argument to an ER, EW, or EB command. ?ILL Illegal Command "x" The specified character is not defined as a valid TECO command. (The W command is only available with VT support.) ?INP Input Error An I/O error occurred while trying to read from the input file. ?IQC Illegal Character "x" after " The only valid " commands are "C, "R execute if alphanumeric "E, "= execute if = 0 "F, "U execute if unsuccessful "L, "< execute if less than 0 "G, "> execute if greater than 0 "N execute if not equal to 0 "S, "T execute if successful "D execute if digit "A execute if alphabetic The commands "V, and "W are not available in TECO-8. ?IQN Illegal Q-register Name "q" The Q register name specified by a command such as Q, U, X, G, %, or M must be a letter (A-Z) or a digit (0-9). Pseudo-Q-registers and * are not available in TECO-8. ?ISA Negative or Zero Argument to S The argument preceding a search command indicates the number of times a match must be found before the search is considered successful. This argument must be greater than 0. Backward searches and bounded searches are not permitted in TECO-8. Standard TECO PAGE 251 Error Messages ?UTM Unterminated Macro A command macro being executed from a Q-register terminated with an incomplete command, such as 1) macro ended with with only one character of a two character command (such as F, E, or ^) 2) macro ended with a command that requires a Q-register name (such as X, G, M, %, Q, U, or ^U) but no Q-register name was specified 3) macro ended with a command that takes a string argument (such as ERfile$, Itext$, Stext$, Otag$, etc.) and the text argument was not properly terminated by an ALTMODE (or the specified delimiter if the at-sign form was used) 4) An O command was issued and the specified tag was not found in that macro (subsequent to the start of the current iteration) ?BNI > not in an Iteration There is a right angle bracket not matched by a left angle bracket somewhere to its left. (Note: an iteration in a macro stored in a Q-register must be complete within the Q-register.) ?NAE No Argument before = The command n= or n== causes the value of n to be typed. The = command must be preceded by either a specific numeric argument or a command that returns a numeric value. ?NAQ No Argument before quote The " command must be preceded by a single numeric argument on which the decision to execute the following commands or skip to the matching ' is based. ?NAU No Argument before U The command nUq stores the value n in Q-register q. The U command must be preceded by either a specific numeric argument or a command that returns a numeric value. ?NFO No File for Output Before giving an output command (P, PW, N, EC, or EG) it is necessary to open an output file by use of an EB, EW, MAKE or TECO command. To prevent possible loss of data, the EX, EC, and EG commands will be aborted if there is no output file open and there is text in the text buffer. The HKEX command will always work. To abort TECO immediately, use the ^C command. ?POP Attempt to Move Pointer Off Page with "x" Standard TECO PAGE 252 Error Messages The argument specified with a J, C, or R command must point to a position within the current size of the text buffer, i.e. between 0 and Z inclusive. The argument to commands that reference pointer positions, such as nA or m,nP or m,nK must reference buffer pointer positions bewteen 0 and Z inclusive. ?POP Reference to Pointer Position Off Page with "x" Command The argument specified with a J, C, or R command must point to a position within the current size of the text buffer, i.e. between 0 and Z inclusive. The argument to commands that reference pointer positions, such as nA or m,nP or m,nK must reference buffer pointer positions bewteen 0 and Z inclusive. ?DTB Delete too big A D command was issued with an argument that was so large that the command would delete character positions outside the current buffer. The D commmand may only delete existing characters. No characters were deleted. ?OUT Output Error An error occurred while trying to write to the output file, or there was not enough room to enter the file on an EW or EB command. ?SNI ; not in an Iteration The semicolon command was used at command level. The ; command may only be used within a string of commands enclosed by angle brackets, i.e. an iteration field. ?SRH Search failed "string" A search command not preceded by a colon modifier and not within an iteration has failed to find the specified character string. After an S (or FS) search fails, the buffer pointer is left positioned at the beginning of the buffer. After an N or search fails, the last page of the input file has been input and, in the case of N, output, and the buffer cleared. The string that you were searching for is shown in the one-line error message. Note that the special search characters CTRL/N, CTRL/S, and CTRL/X are indicated in this string as "^E". Backward searches and bounded searches are not permitted in TECO-8. Anchored searches are also not permitted. Note that the action of "^" in search strings depends on the setting of the ED&1 bit. If 0, then ^ means convert next character to its control character. Standard TECO PAGE 253 Error Messages ?STL Search String too Long The maximum length of a search string is 31 characters (38 characters if you have no VR12 or VT scope support). ?UTC Unterminated Command An incomplete command has been given. This could be caused by any of the following: 1) A command that requires a text string (such as @ER/file/, @S/text/, ^Atext^A, etc.) ended the command string, but the text argument was not properly terminated. 2) An O command was issued and the specified tag was not found in the command string subsequent to the start of the current iteration. ?PDO Internal Push Down Overflow Your macros and iterations have been nested too deeply. ?QMO Q-register Memory overflow There is not enough room allocated to Q-register storage and command string storage to satisfy the current command. If you were typing a command string when you got this error message, you might be able to recover most of the command string by immediately typing CTRL/S as the very next command, thus putting the previous command string into Q-register Z. ?NYA Numeric Argument to Y The Y command may not be preceded by a numeric argument. To yank multiple pages, use the n command. ?NPA Negative or Zero Argument to P The argument to a P command specifies the number of times the P command is to be executed. This argument must be positive. ?NCA Negative or Zero Argument to , The number before a comma refers to a position within the text buffer. This value must be between 0 and Z inclusive and may not be negative. ?NYI Case Support not Implemented [use W for Watch Command] The case control commands ^V and ^W are not available in TECO-8. To get TECOs version number, issue the EO command. To use the watch command (with VR12 or VT support) use the W command. Also, the push [ and pop ] commands are not implemented in TECO-8. Standard TECO PAGE 254 Error Messages ?NYI Case Support not Implemented [Use EO for Version number] The case control commands ^V and ^W are not available in TECO-8. To get TECOs version number, issue the EO command. To use the watch command (with VR12 or VT support) use the W command. Also, the push [ and pop ] commands are not implemented in TECO-8. ?UIS Undefined I/O Switch The only I/O switch that is defined in TECO-8 is the /S switch. ?WLO Cannot Write Out Error Message Overlay The system device is write-locked. ?YCA Y or _ Command Aborted To prevent accidental loss of data, the commands Y, and F will abort if there is text in the text buffer and there is an output file open. If you don't care about the output file, you can kill it with the EK command. The HKY command is always permitted. Yank protection can be disabled by clearing bit 10 of the ED flag, i.e. by issuing the TECO command: ED&1ED This command may be put into your TECO.INI if you dislike yank protection. ?CCL CCL.SV not found or EG argument too big You issued a command of the form EGcommand$ and the specified command was too large (more than 43 characters) or CCL.SV was not found on the system device. ?XAB Execution aborted Execution of your TECO command or command input was aborted because you typed a CTRL/C. To get out of TECO, type a CTRL/C immediately after TECO's prompt. If you accidentally got back to monitor level there is a slight chance that you can get back to TECO by using ODT to restart your core image at location 203. ?ICE Extended CTRL/E match control not implemented The character CTRL/E is not permitted within a search string. This character is reserved for special use in future versions of TECO-8. Note that the presence of a "^E" in the string printout within the ?SRH error message denotes the presence of one of the special match control constructs, CTRL/N, CTRL/X, or CTRL/S. ?NAB No Argument Before ^_ The one's complement command ^_ was used without a numeric Standard TECO PAGE 255 Error Messages argument. The form of the command is n^_ and the command returns the one's complement of the argument n. ^_ is not a unary operator and must be used after a numeric argument (not before it). ?UEx Unimplemented character "x" after E The commands EA, EI, EL, EM, EN, EP, EV, and EZ are not implemented in TECO-8. The only legal E commands are EBfilespec$ Edit Backup EC closes output file after moving across input EF closes output file EG$ performs EX then re-executes last compile class cmd EGcommand$ performs EX then executes command specified EK kills output file ERfilespec$ Opens file for input EWfilespec$ Opens file for output EX moves across input to output file, then closes it and exits TECO EY unprotected Y command The following commands are valid flags: ED, EH, EJ, EO, ES, ET and EU. Standard TECO PAGE 256 Appendices APPENDIX A RT-11 OPERATING CHARACERISTICS Startup TECO is started with the .R TECO command. TECO is now immediately ready to accept commands. The text buffer and Q-register areas are empty. The EDIT command .EDIT/TECO filespec is used to edit an already existing file. It is equivalent to .R TECO *EBfilespec$Y$$ For those RT-11 users that will use TECO as the primary editor, a monitor SET command is provided: .SET EDITOR TECO Once this command is issued, the /TECO option on the EDIT command is no longer necessary since the default editor is now TECO. Since this SET command only has affect between system bootstraps, it is recommended that the command be placed in the appropriate startup file (e.g., STARTS.COM). Now, assuming the SET command has been issued, the command .EDIT filespec can be used to edit an already existing file. The standard RT-11 EDIT command options are all available with TECO. .EDIT/CREATE filespec .EDIT/INSPECT filespec .EDIT/OUTPUT:filespec filespec Another option, /EXECUTE, is also available: .EDIT/EXECUTE[:string] filespec The /EXECUTE option causes TECO to process the filespec (assumed .TEC filetype) as a set of TECO commands. If "string" is used, the string is placed into TECO's text buffer. If "string" Standard TECO PAGE 257 Appendices contains only alphanumeric characters, it does not have to be enclosed in quotes. If it is to contain blanks, it must be quoted with single quotes. The equivalent TECO commands would be .R TECO *ERfilespec$YHXZHKIstring$MZ$$ Note the input file remains open and can provide more input to the macro. Startup Conditions The initial value of the ET flag is 0. The initial value of the EU flag is -1. The initial value of the ED flag is 0. File Specification The file access commands ER, EB, and EW accept a file specification in the standard RT-11 format: dev:filename.type in which dev: is a physical device name or a user assigned logical name; if dev: is not specified, the default DK: is assumed. The filename field must be specified in the commands ER, EB, and EW and be a legal RT-11 filename. The type field is a file extension and must be explicitly given if used (there is no default). The EB and EW commands also accept the extended notation for an output file size dev:filename.type[n] The optional [n] specifies the output file size where n is the number of blocks to be allocated. Backup Files The EB command maintains one level of file backup on RT-11. The pre-edited input file name is changed to filename.BAK before the new output file is closed with the original name. Only normal file closing commands (EC, EF, EG, and EX) cause this renaming to happen. If TECO is aborted or the output file is purged by the EK command, the input filename remains unchanged. Note only one .BAK file for a given name is kept; earlier .BAK backup files are deleted each time a new backup file is created. Standard TECO PAGE 258 Appendices A good policy to follow when editing is to close the edited file frequently enough so that an unexpected incident would not cause a substantial loss of work. Files should be backed up regularly. TECO has the power to let an unsuspecting user alter a good file into a completely useless state. The SRCCOM program can be used to verify an editing session. Exit and Go If TECO is exited via the EGstring$ command, the string is passed to the system as the next command to execute. This string may be any valid command or an indirect command file specification. The action taken when the user types depends on what TECO is doing. At command level is a valid input character and has no special meaning. Note though, that if TECO executes as a command from command level, TECO is aborted. If TECO is executing commands or doing I/O, a double will stop the operation and generate the ?XAB error message. A ^T command within a macro can read a as its input character, but another will normally abort the macro. Sometimes it is desireable for a TECO macro to detect when a double was typed. By detecting the double , the macro can exit cleanly back to command level (pop saved Q-registers, restore any flag values, etc.). To do this, the macro sets Bit 15 (Octal 100000, Decimal -32768) of the ET flag. When a double is typed, TECO will automatically turn off Bit 15, but will continue execution of the macro. The macro periodically checks Bit 15 and exits cleanly if it ever goes off. For example: [0 [1 -32768#ETET < ... ET; > 32767&ETET ]1 ]0 REENTER and CLOSE The RT-11 REENTER command may always be used to continue TECO. Its primary differences from running TECO is that when REENTER is used, the text buffer and Q-register areas are unmodified, as opposed to when TECO is run the text buffer and Q-register areas are cleared. The input and output file are always lost upon reentering TECO. If an output file was open before reentering TECO, the file will have to be recreated with the appropriate E-command. (Note that the monitor commands GT ON, GT OFF, LOAD, and UNLOAD disallow a REENTER.) Standard TECO PAGE 259 Appendices The output file is not closed if TECO is aborted. The RT-11 CLOSE command can be used to make the output file permanent, but be aware that the output file will not be complete because of internal buffers that TECO keeps. TECO may be reentered after a CLOSE command. File Recovery TECO can be a useful tool in recovering ASCII files lost on a block replaceable device. TECO allows block replaceable devices to be opened in a non-file structured mode. This gives the user the capability to open a disk and access ASCII data anywhere on it, independent of file boundaries. The command ERdev:$ is used to open the device at which point _ (underscore or backarrow) searches may be used to locate specific ASCII data and transfer it to new output files. Note that files tend to get reproduced, in whole or part, many places on a block replaceable device; be sure to verify that any given text is indeed complete and the correct version. System Crash Recovery TECO and RT-11 are highly reliable, but if during an important edit session a random system failure should occur, the following procedure may help save some or all of the editing. 1. Bootstrap the system 2. Immediately perform a SAVE command to save as much of memory as possible into a file on SY:. The address range form of the SAVE command must be used. The SAVE command will not allow any part of the monitor to be saved, e.g., if you have a 28K system and are running SJ you cannot save 28K but only 26.3K. 3. Perform standard startup procedures, e.g., DATE. 4. Use TECO on the SAVEd file to try and recover useful parts of the edit. VT11 Graphics Support If the monitor supports the VT11 graphics processor (GT ON and GT OFF work) TECO will automatically start up in display mode, adjusting to both the size of the display screen and to the presence or absence of the scroller. If the display fails to start with a working VT11, TECO has decided that there is not enough free memory and will not Standard TECO PAGE 260 Appendices allocate the display file buffer or start the display. See Section 5.15 for a description of the available commands to interact with the display. Various aspects of the display screen become immediately obvious upon seeing them; the text pointer, its position and shape and its position between lines; wrap around of more than 72 characters per line; the scroller interaction and so on. Experiment with a scratch file for more familiarity. EXCEPTIONS RT-11 TECO does not support the following commands that are part of TECO-11 on most other PDP-11 operating systems: 1. Secondary Stream commands (EA, EP, ER$, EW$) 2. Indirect File Input (EI) 3. Wildcards (EN) Standard TECO PAGE 261 Appendices APPENDIX B RSTS/E OPERATING CHARACERISTICS Startup TECO is started with the RUN $TECO command. TECO is now immediately ready to accept commands. The text buffer and Q-register areas are empty. The CCL command TECO filespec is used to edit an already existing file. It is equivalent to RUN $TECO *EBfilespec$Y$$ The CCL command TECO filespec1=filespec2 is used to edit existing file "filespec2" into a new file "filespec1". It is equivalent to RUN $TECO *EWfilespec1$ERfilespec2$Y$$ The CCL command TECO/INSPECT filespec is used to inspect an already existing file. It is equivalent to RUN $TECO *ERfilespec$Y$$ The /INSPECT switch may be abbreviated as /IN, /INS, /INSP, etc. The CCL command MAKE filespec is used to create a new file with TECO. It is equivalent to RUN $TECO *EWfilespec$$ One more CCL command exists for TECO. It is Standard TECO PAGE 262 Appendices MUNG filespec --or-- MUNG filespec,text This is equivalent to RUN $TECO *Itext$EIfilespec$$ In other words, the MUNG command will process the filespec as a TECO indirect command file passing an argument of text in the text buffer. This is a convienent way to invoke TECO macros. The TECO and MAKE CCL commands may have the /VTEDIT switch added to automatically invoke the VTEDIT editing macro. $VTEDIT.TEC is loaded into Q-register I and automatically started. The CCL command switches /DETACH and /SIZE:n (or /SIZE:+n) can be used with TECO. If /DETACH is used and the user is privileged, TECO will detach the job before any further processing. If /SIZE:n is used, TECO will pre-expand the text and Q-register storage area to nK. If /SIZE:+n is used, TECO will set the text storage and Q-register storage area to n+3K initially (TECO's default startup size is 3K). Startup Conditions The initial value of the ED flag is always 0. When TECO is initially invoked it will automatically set the ET and EU flags as described below. The ET flag is set to 0 for non-scope terminals without lower case input, to 2 for scope terminals without lower case input, to 4 for non-scope terminals with lower case input, and to 6 for scope terminals with lower case input. In addition, Bit 9 (value 512) will be set if the VT52 "WATCH" feature of TECO is present and your terminal is a VT52 type terminal. Note: The actual ET flag value will be 128, 130, 132, or 134 (Bit 7 on in addition to the above) when TECO initially starts. TECO automatically clears Bit 7 every time it reaches prompt (*) level. The EU flag is set to 0 (flag lower case) for upper case only terminals. It is set to -1 (no flagging) for lower case terminals. File Specification The file access commands ER, EB, EW, and EI accept a file specification in the standard RSTS/E format: Standard TECO PAGE 263 Appendices dev:[p,pn]filename.ext in which dev: is a physical device name or a logical device name; if dev: is not specified, the public structure is assumed. If [p,pn] is not specified, the user's current logged in account is assumed. The filename field must be specified whenever the device name references a file structured device. The .ext field is a file extension and must be explicitly given if used. There is no default extension except for EI commands which default the .ext field to .TEC. The file specification switches /RONLY, /MODE:n, and /CLUSTERSIZE:n can be included in a file specification. TECO automatically opens all disk input files in /RONLY mode. The file size switches /FILESIZE:n and /SIZE:n might leave an output file larger than the amount of data output by TECO. These file size switches are therefore illegal and produce an error if included in a file specification. The EB and EW commands also accept the extended notation for an output file protection code dev:[p,pn]filename.ext The optional specifies the output file protection code. Editing BASIC-PLUS Programs The line feed, carriage return, null combination that signals a continuation line to BASIC-PLUS can cause problems when those files are edited with TECO. To overcome this, TECO has a special "BASIC-PLUS file" edit mode. Simply append a slash to the file specification. dev:[p.pn]filename.ext/ This changes TECO's handling for file input and/or output as follows. On input, TECO will strip off and ignore all nulls (Octal 0, Decimal 0) and carriage returns (Octal 15, Decimal 13). For every line feed (Octal 12, Decimal 10), TECO will automatically insert a carriage return preceeding the line feed. In this way the text buffer has all lines ending with the carriage return, line feed combination. Editing of the text buffer is now easy. On output, TECO will ignore all carriage returns. For every line feed TECO do one of the following: 1) If the character two positions before the line feed was the character ampersand (&), TECO will output carriage return and line feed. In other words, the text buffer sequence &, CR, LF will be output unchanged. This is the BASIC-PLUS "EXTEND" mode convention for line continuation. Standard TECO PAGE 264 Appendices 2) If the character following the line feed is a digit (i.e., the start of a line number) or no characters follow the line feed, TECO will output a carriage return, line feed. 3) If the character following the line feed is not a digit (start continuation line with a tab to ensure this) or the line feed is the last character but a form feed is to be output, TECO will output a line feed, carriage return, null sequence. Editing RSX-11 Run-Time System Generated Files TECO will correctly read RSX-11 Run-Time System generated files of type 1 (fixed length records), type 2 (variable length records), and type 4 (ASCII stream). All types are converted to ASCII stream format in the text buffer. All TECO output files are ASCII stream. Backup Files The EB command maintains one level of file backup on RSTS/E. The pre-edited input file name is changed to filename.BAK before the new output file is closed with the original name. Only normal file closing commands (EC, EF, EG, and EX) cause this renaming to happen. If TECO is aborted or the output file is purged by the EK command, the input filename remains unchanged. Note only one .BAK file for a given name is kept; earlier .BAK backup files are deleted each time a new backup file is created. A good policy to follow when editing is to close the edited file frequently enough so that an unexpected incident would not cause a substantial loss of work. Files should be backed up regularly. TECO has the power to let an unsuspecting user alter a good file into a completely useless state. The FILCOM program can be used to verify an editing session. Wild Card Lookup The EN command will process wild card lookups on RSTS/E. To preset the wild card lookup file specification, use the standard RSTS/E format dev:[p,pn]filename.ext The device name must reference a file structured disk device, be the public structure (SY:), or be omitted which defaults to the public structure. The [p,pn] field cannot be wild. It defaults to the user's current logged in account. The filename field must be specified and can be explicit, fully wild (i.e., *), or Standard TECO PAGE 265 Appendices partially wild (i.e., containing one or more ?'s). If the .ext field is omitted, only files with no extension will be looked for. Otherwise, the extension field can be explicit, fully wild (*), or partially wild (?'s). Exit and Go If TECO is exited via the EGstring$ command, the "string" is executed as a RSTS/E CCL command after the input and output file(s) are closed. The action taken when the user types depends on what TECO is doing. If TECO is executing commands, the ?XAB error occurs. If TECO is in the midst of doing I/O, the error "?ERR ?Programmable ^C trap" occurs. If TECO is at command level or asking for a character with the ^T command, TECO simply restarts and reprompts its asterisk. If two s are typed to TECO when it is at command level, it will exit. Sometimes it is desireable for a TECO macro to detect when a was typed. By detecting the , the macro can exit cleanly back to command level (pop saved Q-registers, restore any flag values, etc.). To do this, the macro sets Bit 15 (Octal 100000, Decimal -32768) of the ET flag. When a is typed, TECO will automatically turn off Bit 15, but will continue execution of the macro. The macro periodically checks Bit 15 and exits cleanly if it ever goes off. For example: [0 [1 -32768#ETET < ... ET; > 32767&ETET ]1 ]0 If Bit 15 is on and TECO is waiting for a response to a ^T command and the user types a , TECO will turn off Bit 15 and return an ASCII code of 3 (the code for ). ET Flag Handling TECO will automatically turn off the following bits in the ET flag on every error: 1's bit (image output), 8's bit (no echo on ^T), 16's bit (cancel ^O), 32's bit (no stall on ^T), and the high-order bit (^C trap). In addition, TECO always turns off Bit 7 (exit on error, etc.) every time TECO reaches prompt (*) level. Standard TECO PAGE 266 Appendices Bit 6 (detach) is handled specially by TECO. Every time the ET flag is read (used as a numeric value), TECO ensures that Bit 6 is on if the job is attached or off if the job is detached. This allows a TECO macro to check for "detachedness". If a non-privileged user attempts to set Bit 6, the request is ignored and Bit 6 will read back as a 0 (assuming the job is attached). When a privileged user sets Bit 6, the job will become detached. Further reading of Bit 6 will return a 1 to indicate the detached condition. Installing TECO The following commands will install TECO on your RSTS/E V06C system. (Note: dev: is your distribution medium.) RUN $PIP.SAV *[0,1]*.*<60>=dev:[0,1]TECO.RTS *[0,1]*.*<60>/MO:16=[0,1]TECO.RTS *$*.*<104>=dev:$TECO.TEC *$*.*<104>=dev:$VT52.TEC *$*.*<104>=dev:$TYPE.TEC *^Z RUN $UTILTY < UTILTY's header line > ? NAME TECO=$TECO.TEC ? NAME TECO=$VT52.TEC ? NAME TECO=$TYPE.TEC ? ^Z Inclusion of TECO on System Startup The following commands will include TECO on your RSTS/E V06C system at system startup time. RUN $UTILTY < UTILTY's header line > ? ADD TECO ? CCL MAK-E=$TECO.TEC;[PRIV ]n ? CCL MU-NG=$TECO.TEC;[PRIV ]n ? CCL TE-CO=$TECO.TEC;[PRIV ]n ? CCL TY-PE=$TYPE.TEC;n ? ^Z The n above is a memory usage limit. If n is 0 then the TECO will expand its memory on demand up to the user's memory limit. If n is non-zero then TECO will not expand its memory over nK. For most installations, n will be 0 for MAKE, MUNG, and TECO. For TYPE, n is usually 8. If PRIV is included and TECO.TEC's protection code is changed to <232>, TECO will expand its memory beyond the user's private memory limit (but never beyond the limit set by n if Standard TECO PAGE 267 Appendices any). Most installations will not include PRIV in their CCL definitions. Standard TECO PAGE 268 Appendices APPENDIX C RSX-11 OPERATING CHARACERISTICS Startup TECO is started with the TECO command. TECO is now immediately ready to accept commands. The text buffer and Q-register areas are empty. The command TECO filespec is used to edit an already existing file. It is equivalent to TECO *EBfilespec$Y$$ The command TECO filespec1=filespec2 is used to edit and rename an already existing file. It is equivalent to TECO *ERfilespec2$EWfilespec1$Y$$ The command MAKE filespec is used to create a new file with TECO. It is equivalent to TECO *EWfilespec$$ One more command exists for TECO. It is MUNG filespec --or-- MUNG filespec,text This is equivalent to TECO *Itext$EIfilespec$$ In other words, the MUNG command will process the filespec as a Standard TECO PAGE 269 Appendices TECO indirect command file passing an argument of text in the text buffer. This is a convienent way to invoke TECO macros. If the MUNG command is not installed, TECO macros may also be invoked with the command TECO @filespec It is equivalent to TECO *EIfilespec$$ In systems supporting dynamic task expansion, TECO will expand its buffer space as necessary, up to a limit defined in the task build command file. (As supplied, this limit is roughly 7K words.) Also, TECO'S buffer space may be explicitly allocated in the startup command RUN $TEC/INC=n If a larger text buffer is needed than the expansion limit, TECO should be started up with a /INC allocation greater than the limit; it will then expand to the maximum size the system will allow. Startup Conditions The initial value of the ED flag is always 1. When TECO is initially invoked it will automatically set the ET and EU flags according to the user's terminal characteristics. If the terminal supports CRT style rubouts, then bit 1 of the ET flag is set to do the same in TECO. If the terminal supports lower case type in, then bit 2 of the ET flag is set and the EU flag is set to -1 to turn off case flagging. Thus the initial value of the ET flag will be either 0, 2, 4 or 6. While the command line is being processed, bit 7 of the ET flag is also set to cause TECO to exit should any errors occurr. ET bit 7 is cleared every time TECO reaches prompt (*) level. File Specification The file access commands ER, EB, EW, and EI accept a file specification in the standard RSX-11 format: dev:[p,pn]filename.typ;version in which dev: is a physical device name or a logical device name; if dev: is not specified, SY: is assumed. If [p,pn] is not specified, the user's current default directory is assumed. The filename field must be specified whenever the device name references a file structured device. The typ field is a file Standard TECO PAGE 270 Appendices type and must be explicitly given if used. There is no default type except for EI commands which default the .typ field to .TEC. The switch /RW may be applied to any file specification in an ER, EW, and EI command. If the file specification references a magtape, the tape is rewound before the file is opened. Note that for output files, this has the effect of zeroing the tape. The /RW switch is ignored for all other device types. The presence of version numbers in Files-11 causes file processing to behave slightly differently under RSX-11 than under other operating systems. For example, no .BAK files are used; each execution of an EB command simply produces a new version of the file. Thus a user may retain any level of backup he feels to be comfortable. It also means that one must occasionally delete obsolete files to avoid cluttering the disk. Thus the command EBname.typ;version$ is equivalent to the commands ERname.typ;version$EWname.typ;0$ The EW command also creates a new version (one higher than the current highest) if no version number is given. If an explicit version number is given, then that number is used, and if another file of the same name, type, and version previously existed, it is superseded without warning. (See use of the EP and EK commands below.) In reading files, version numbers behave the same as in other RSX-11 utilities: the default is the highest version. This leads to a problem in re-opening the input file while a file is being edited with EB. Since the output file is already created and in the directory, the input file is no longer the highest version. One may deduce the version number of the input file by doing a G* (returning the file string of the output file) and subtracting one from that version number. In symmetry with the EB command, the EK command functions by simply deleting the current output file. Note, however, that a supersede (EW of same name, type, and version) is not undone - the file is already deleted! The EP and EA commands, while simulating two channels each with an open file for each of input and output, in fact only keep one file open for each to conserve buffer space. This means that they are only useful for disk files. Also, it means that if one opens a file and then supersedes it, one should not switch the input channel away from it with an EP or ER$ command, since it will not be possible to open the file again. Wild Card Lookup Standard TECO PAGE 271 Appendices The EN command will process wild card lookups on RSX-11. To preset the wild card lookup file specification, use the standard RSX-11 format dev:[p,pn]filename.typ;version The device name must reference a file structured disk device or magtape. All other fields of the file specification may be fully wild (*), including either or both halves of the directory. The version number may be explicit, wild, or default. As with the other file specification commands, there is no default file type. Exiting from TECO The normal method of exiting from TECO is with the EX command. This copies the remaining input file to the output file, closes all files and exits. To protect against accidental loss of text typed in, the EX command will not allow TECO to exit if there is text in the buffer and no open output file. To exit after just looking at a file, one must use the sequence HKEX. The EG command is identical in action to the EX command, since RSX-11 has no facility for passing control from one program to another. The (or Caret-C) command is the "give up and get out" command. Executed from main command level, it will cause TECO to exit regardless of the state of the buffer. If there is an open output file, it is deleted. The command is roughly equivalent to EKHKEX. The action taken when the user types depends on what TECO is doing. If TECO is executing commands, or is awaiting type-in for the ^T command, the ?XAB error occurs. If TECO is at command level, the is simply entered into the command string. Note that execution of the command causes instant exit from a main level command string. Sometimes it is desireable for a TECO macro to detect when a was typed. By detecting the , the macro can exit cleanly back to command level (pop saved Q-registers, restore any flag values, etc.). To do this, the macro sets Bit 15 (Octal 100000, Decimal -32768) of the ET flag. When a is typed, TECO will automatically turn off Bit 15, but will continue execution of the macro. The macro periodically checks Bit 15 and exits cleanly if it ever goes off. For example: Standard TECO PAGE 272 Appendices [0 [1 -32768#ETET < ... ET; > 32767&ETET ]1 ]0 Setting the intercept bit in the ET flag must be done with some care; if the bit is set inside a command loop which does not check it, it will be impossible for the user to abort the loop. The only remedy for this situation is to abort TECO from another terminal. ET Flag Handling TECO will automatically turn off the following bits in the ET flag on every error: Bit 0 (image output), Bit 3 (no echo on ^T), Bit 4 (cancel ^O), Bit 5 (no stall on ^T), and Bit 15 (^C trap). In addition, TECO always turns off Bit 7 (exit on error, etc.) every time is reaches prompt (*) level. Bit 6 (the detach flag) controls TECO'S treatment of the terminal. Normally, TECO keeps the terminal attached to gain control of interrupts. Setting bit 6 of the ET flag causes TECO to run with the terminal detached. All commands function normally, except that typing causes the MCR to be activated, allowing other tasks to be run from the same terminal concurrently with TECO. It is, of course, the user's problem to sort out the confusion that will arise if both TECO and another task request input from the terminal at the same time. File Record Format Files-11 files are record structured, while TECO'S text buffer is ASCII stream. Thus TECO must make format conversions when reading and writing files. The conversion depends on the record attributes of the file. While reading a file, the records are packed into the buffer. If the file is implied carriage control (the standard RSX-11 source format) or Fortran carriage control, TECO inserts a carriage return and line feed after each record to make each record appear as a line of text in the buffer. The one exception to this processing is a record containing just a form feed. This is interpreted as an end of page mark; it stops the read operation but is not entered in the buffer. If the input file has no carriage control (also called internal carriage control), TECO simply packs the records together in the text buffer. On output, TECO scans the text buffer for carriage return / line feed sequences. Each carriage return / line feed delimits the end of an output record. If the output file is implied or Fortran carriage control, the carriage return and line feed are not output with the record; if the file is internal carriage control, they are. Form feed characters in the buffer are always output as a single character record. Note that solitary carriage Standard TECO PAGE 273 Appendices returns and line feeds, and line feed / carriage return sequences do not delimit records, but remain embedded in the records being output. Switches may be applied to the input and output files to control their carriage control attributes. The switch /CR forces implied carriage control; /-CR forces no (internal) carriage control; /FT forces Fortran carriage control. When a carriage control switch is applied to an input file, the file is read as if it had that attribute; when the switch is applied to an output file, the file is written with that attribute. Applying a switch to an EB file specification causes the switch to apply to both input and output files. When an output file is created, its carriage control attributes are defaulted to those of the currently open input file as follows: Input Output implied implied none implied Fortran Fortran Files read with the EI command have their record attributes interpreted in the same manner. This leads to an unexpected side effect with EI files containing an entire command. The last record of the file presumably contains as its last characters the two alt modes which initiate execution of the macro. If the file is implied carriage control, however, there are also the final carriage return / line feed belonging to the last record, which remain in the type in buffer while the macro executes. If the macro attempts to receive input with the command, the carriage return / line feed will be the first two characters read. Alternatively, if the macro does no type in, the carriage return / line feed will be read by TECO as the first two characters of the next command. Then no asterisk (*) will appear as the prompt for the next command. The remedy for both cases is for the macro to execute an EI$ command early on. This causes the remainder of the indirect file to be discarded and further input to be read from the terminal. Command Line Processing The mechanism used to process the command line in RSX-11 TECO is designed to allow sophisticated TECO users the greatest flexibility in customizing TECO for their own use. It functions as follows: The initialization routine places the original MCR command line (if any) into the filename buffer. It copies into the text buffer the text of a TECO macro that will be used to interpret the command line. Then it starts up TECO with the command HXY HKG* HXZ HK :EITECO$$ Standard TECO PAGE 274 Appendices in the type in buffer. This loads the command line into Q-register Z and the macro into Q-register Y. It then executes the file named TECO.TEC located in the user's default directory, if it exists. After the user's TECO.TEC, and any files it might link to with EI, have been executed, TECO executes the command MY$$, thus executing the macro to interpret the command line and open the files requested. The uses of TECO.TEC are limited only by the user's imagination. They range from simply loading a few utility macros into Q-registers, through interpreting and perhaps modifying the command line (available in Q-register Z) or the command processing macro (in Q-register Y), to loading and starting up a higher level editing macro which handles the command line itself and takes its own commands from the terminal. Installing TECO The first step in installing TECO is to copy the files from the distribution medium into an available directory on the system disk. TECO distributed on Magtape or DECtape is in DOS format and must be read with FLX; disks are in Files-11 format. The command line thus is of the form FLX SY:=MT:[200,200]*.* or PIP SY:=DK1:[200,200]*.* One must then build TECO with the command TKB @TECBLD Note that TECO uses the Utility Library. In RSX-11M this is located in the file [1,20]PIPUTL.OLB in the system distribution kit; in RSX-11D it is located in the file [11,5]UTLLIB.OLB. These must be available to build TECO. Users with unmapped RSX-11M systems will need to edit the TKB command file to alter the PARTITION directive to fit their system. RSX-11M users should also note that the size of TECO is about 7.5K words, excluding its text buffer. Thus, TECO requires a minimum partition of about 10K words to be useful. Once task built, TECO needs to be installed under three names to make all of the commands available: INS TEC default name is ...TEC INS TEC/TASK=...MAK for the MAKE command INS TEC/TASK=...MUN for the MUNG command In IAS, TECO is installed instead under the task names $$$TEC, $$$MAK, and $$$MUN to implement the three commands. Standard TECO PAGE 275 Appendices TECO makes use of some of the advanced features of RSX-11M V3 and RSX-11D V6.2, such as dynamic task expansion, the read with special terminators terminal function (i.e., TECO mode), and unsolicited character AST's. TECO may be reconfigured to do without some of these features to allow it to run on subset or older systems; instructions on this are to be found in the assembly and TKB command files, and in the assembly prefix file TECPRE.MAC. Standard TECO PAGE 276 Appendices APPENDIX D OS/8 OPERATING CHARACERISTICS D.1 Startup TECO is started with the .R TECO command. TECO is now immediately ready to accept commands. The text buffer and Q-register areas are empty. The TECO command .TECO filespec is used to edit an already existing file. It is equivalent to .R TECO *EBfilespec$Y$$ OS/8 "remembers" the filespec as the name of the last file that has been edited. The MAKE command .MAKE filespec is used to create a new file. It is equivalent to .R TECO *EWfilespec$$ OS/8 "remembers" the filespec as the name of the last file that was edited. The command .TECO filespec1=filespec2 is used to edit filespec2 into filespec1. That is, filespec2 is opened as the input file, and filespec1 is created as the output file. It is equivalent to .R TECO *ERfilespec2$EWfilespec1$Y$$ OS/8 "remembers" the fielspec1 as the name of the last file that was edited. The command Standard TECO PAGE 277 Appendices .TECO with no arguments, causes CCL to execute the command .TECO filespec where filespec was the file that was previously remembered as the last file to be edited. The system purposely does not remember filenames from one day to the next, but it will remember names across bootstraps. The command .MUNG filespec executes the specified TECO program. The default extension is .TEC . This is equivalent to the sequence: .R TECO *ERfilespec$YHXYHKMY$$ Another format of this command is .MUNG filespec,argument which is used to pass an argument to the TECO program to control its action. This is equivalent to the sequence: .R TECO *ERfilespec$YHXYHKIargument$MY$$ The argument may be the name of a file that the TECO program is to mung, or it may be a command to the program to specify what action to take, or whatever. It is up to the TECO program to decode this argument (which is left in the text buffer) and take appropriate action. A TECO program executed via the MUNG command must never destroy the text storage area of Q-register Y and expect to ever see the light of day again. Note the input file remains open and can provide more input to the macro. D.2 Startup Conditions The initial value of the EU flag is 0 if the CCL command SET TTY NO SCOPE had been previously issued, and is -1 if the CCL command SET TTY SCOPE had previously been issued. The initial value of the ET flag is as follows: Bit value Initial value 1 0 Standard TECO PAGE 278 Appendices 2 0 (1 if terminal is a scope) 4 0 8 0 16 0 32 0 64 0 128 1 (TECO's prompt sets this to 0) 256 0 512 0 (1 if VT support is present) 1024 0 (1 if VR12 support is present) 2048 0 The initial value of the ED flag is 1. D.3 File Specification The file access commands ER, EB, and EW accept a file specification in the standard OS/8 format: dev:filename.type in which dev: is a physical device name or a user assigned logical name; if dev: is not specified, the default DSK: is assumed. The filename field must be specified in the commands ER, EB, and EW and be a legal OS/8 filename. The type field is a file extension and must be explicitly given if used (there is no default). Any characters after the second will be ignored, thus the filespecs FOO.TEC and FOO.TE are equivalent. The EB and EW commands do not accept the extended notation for an output file size dev:filename.type[n] specifying an output size allocation. D.5 Backup Files The EB command maintains one level of file backup on OS/8. The pre-edited input file name is changed to filename.BK before the new output file is closed with the original name. Only normal file closing commands (EC, EF, EG, and EX) cause this renaming to happen. If TECO is aborted or the output file is purged by the EK command, the input filename remains unchanged. Note only one .BK file for a given name is kept; earlier .BK backup files are deleted each time a new backup file is created. A good policy to follow when editing is to close the edited file frequently enough so that an unexpected incident would not cause a substantial loss of work. Files should be backed up regularly. TECO has the power to let an unsuspecting user alter Standard TECO PAGE 279 Appendices a good file into a completely useless state. The SRCCOM program can be used to verify an editing session. D.6 Exit and Go If TECO is exited via the EGstring$ command, the string is passed to the system as the next command to execute. This string may be any valid command or an indirect command file specification. The command may be either a KBM or a CCL command. This command is especially useful while running under BATCH. If TECO is exited via the EG$ command, then OS/8 will re-execute the last explicit compile-class command that was executed that day. The commands that are considered to be compile-class commands are: COMPILE file LOAD file EXECUTE file LINK file MACRO file. This feature, combined with OS/8's other remembering features, minimizes the number of keystrokes necessary to do normal program development. The programmer does not have to constantly type in the name of the file he is working with. A typical debugging session would look like this: .MAKE FOO.MAC *!type in assembly language file to be executed! *EX$$ .EXECUTE FOO (get error messages) .TECO *!fix bugs! *EG$$ !re-compile and execute program! (watch program work or repeat process) D.7 The action taken when the user types depends on what TECO is doing. At command level is an immediate action command. If typed as the very first character in a command string (not necessarily the first keystroke) it aborts TECO and returns to the keyboard monitor. If this was done accidentally, TECO may be restarted (at your own risk) by using ODT to branch to location 207 in your program's image. If is typed int he middle of entering a command string, then the ?XAB error message is given and TECO reprompts with its asterisk. Note that if TECO executes as a command from command level, TECO is aborted. If TECO executes a command from within a macro, TECO is also aborted. If a is typed while TECO is running, or while TECO is typing on the Standard TECO PAGE 280 Appendices terminal, or while an error message is printing, then the ?XAB error message is given and TECO reprompts with its asterisk. Similarly, if is typed while TECO is waiting for input because of a T command. Note that if TECO is performing I/O using non-system handlers, the non-system handler may intercept the and abort back to the keyboard monitor. In such a case, you may attempt to re-enter TECO, however, part of your file has been lost and good luck in attempting to issue an EF command. Manually resetting the value of Z might recover your data. If TECO is executing commands or doing I/O, e will stop the operation and generate the ?XAB error message. Sometimes it is desireable for a TECO macro to detect when a was typed. By detecting the , the macro can exit cleanly back to command level (restore any flag values, etc.). To do this, the macro sets Bit 0 (Octal 4000, Decimal 2048) of the ET flag. When a is typed, TECO will automatically turn off Bit 0, but will continue execution of the macro. The macro periodically checks Bit 0 and exits cleanly if it ever goes off. If the trap bit is on, then the T can read a typed at the terminal. It has an ASCII value of 3. D.8 File Recovery TECO can be a useful tool in recovering ASCII files lost on a block replaceable device. TECO allows non-file-structured devices to be opened in a non-file structured mode. This gives the user the capability to open a disk and access ASCII data anywhere on it, independent of file boundaries. To do this, you must issue a command of the form .SET dev: NOFILES to the monitor to make it think that your disk is non-file-structured. The command ERdev:$ is used to open the device at which point _ (underscore or backarrow) searches may be used to locate specific ASCII data and transfer it to new output files. Note that files tend to get reproduced, in whole or part, many places on a block replaceable device; be sure to verify that any given text is indeed complete and the correct version. If the disk's directory has not been clobbered (or if you are willing to create a new one), then it is not necessary to turn the disk into a non-file-structured device. Merely open up a file early on the disk for input and read through end-of-files until you locate the lost file. To read through end-of-files, you must use the /S switch on an ER, EB, or EW command. For Standard TECO PAGE 281 Appendices example, the command ERFOO.MAC/S$ will open the file FOO.MA for input and put tECO into "SUPERTECO" mode. In this mode, TECO will not treat a found in a file as an end-of-file character. Instead, will be treated like any other character. It is not a line terminator or a page terminator. This mode continues until an ER, EW, or EB command is issued without a /S switch. D.9 VR12 Graphics Support If TECO is run on a PDP-12, TECO will automatically start up in display mode, adjusting to both the size of the display screen and to the presence or absence of the scroller. On a PDP-12, TECO only permits one-page input and output handlers. See Section 5.15 for a description of the available commands to interact with the display. Various aspects of the display screen become immediately obvious upon seeing them; the text pointer, its position and shape and its position between lines; wrap around of more than 72 characters per line, and so on. Experiment with a scratch file for more familiarity. D.10 EXCEPTIONS TECO-8 does not support the following commands which are described in this manual: 1. Secondary streams (EP, EA, ER$, EW$) 2. Auxiliary command streams (EI) 3. Wildcards (EN) 4. Zeroing of directories (EZ) 5. Magtape commands (EM) 6. View command (V) 7. Bounded searches 8. Anchored searches 9. Search verification (ES) 10. Command verification (EV) Standard TECO PAGE 282 Appendices 11. Backward searches 12. Extended string build or match constructs (^Ex) The following incompatibilities exist between TECO-8 and Standard TECO: 1. In octal mode, the digits 8 and 9 are not treated as errors when occurring in a numeric string. 2. The *q immediate action command is not implemented. Instead, the immediate action command * has the same effect as *Z of the standard. (The immediate mode command ^S is still accepted for compatibility with OS/8 TECO V5.) D.11 Chaining to TECO A user program may chain to TECO passing it a command to be executed. There are two formats that such a command may take. Format 1 (the TECO command format) passes TECO a valid TECO command to be executed. This TECO command is placed in a buffer starting at location 17600, one 7-bit ASCII character per word. A negative word represents a pointer to a continuation buffer in field 1. There may be any number of continuation buffers, but they must all begin above location 4000 in field 1. Since TECO clobbers most of field 1, these buffers must in fact start above location 7400. TECO will never load into page 7400 of field 1. The buffer ends with a fullword 0. Format 2 (the CCL command format) passes TECO a CCL command to be parsed and executed. Such a command usually begins with the words TECO, MAKE, or MUNG, but is not limited to these words. Such a CCL command is placed in a buffer starting at location 17601, one 7-bit ASCII character per word. Location 17600 must be a fullword 0 to specify that this format is being used. A negative word in the buffer represents a pointer to a continuation buffer in field 1 as described above. The buffer ends with a fullword 0. If this format is used, the passed CCL command will be parsed and executed by TECO.TEC as described below. A user may write his own TECO.TEC, thus implementing his own CCL commands. There is no limit to the possiblities, other than the user's imagination. D.12 User Initialization If a user has a file called TECO.INI on SYS:, then when TECO starts up (via a CCL command, it will execute the contents of this file (as a TECO macro). This file must contain a valid TECO program (which will execute out of Q-register W). God help you if you have any errors in this program. This start-up file must Standard TECO PAGE 283 Appendices not modify itself (Q-register W) and must not modify the contents of Q-register V. It should not indiscriminately modify the contents of Q-register Z or the text buffer. TECO.INI will be executed before TECO opens any files. That is, if TECO was invoked via a MAKE command, TECO.INI will be executed before the EW command (for the MAKE) is executed. At this point, the text buffer will contain a copy of the CCL command that invoked TECO (assuming your monitor has TECO.TEC support). However, TECO has not as yet parsed this line. The user may examine this line for himself, and modify it, but you had better know what you are doing (and do it right!). TECO.TEC will parse the contents of the text buffer at the conclusion of execution of TECO.TEC. If your monitor does not have TECO.TEC support, or if a user program chained to TECO passing it a TECO command (rather than a CCL command), then the initial TECO command will be in Q-register Z when TECO.INI gets control. That command has not as yet been executed. The initialization file may examine the contents of Q-register Z to determine what TECO command will be executed and proceed accordingly. It may also modify the contents of Q-register Z (but you better know what you are doing). In this case, TECO.INI is started up via the sequence @:ER/SYS:TECO.INI/"SYHXWHK@^UZ^@teco command^@MW+0ES.,.XWMZES"N0ESMX'$$ which loads TECO.INI into Q-register W, loads the chain argument consisting of an appropriate teco command into Q-register Z, and temporarily stores the value returned by TECO.INI in the search verification flag (this feature may change in a subsequent release). Q-register W and ES are cleared before the post-processing command in Q-register X is executed. Note that the chain argument may not contain any embedded nulls. D.13 RETURNED VALUES FROM TECO.INI TECO.INI may also return a value. If your monitor does not support TECO.TEC, then only two values are permitted. Returning a 0 (or not returning anything) is the normal sequence of events. Returning a 1 means that TECO should execute the contents of Q-register X (via an MX command) after it executes the initial TECO command (in Q-register Z). TECO.INI may set up Q-register X with the appropriate post-processing commands. A typical use of this feature would be to have TECO.INI load up Q-register I with an editing macro and then put an "MI" command in Q-register X for subsequent execution. If your monitor does have TECO.TEC support, then TECO.TEC can support additional returned values. It is recommended that TECO.TEC support the returned values of 0 and 1 as above, but in addition, it may support additional values determined by the user. Note that TECO.INI is not invoked if TECO is started with a RUN or R command. Standard TECO PAGE 284 Appendices D.14 TECO.TEC Support If the version of CCL you are using to invoke TECO supports TECO.TEC, then it will chain to TECO with a 0 at location 17600 and will pass TECO the invokig CCL command (beginning at location 17601). If TECO is invoked in this manner, it will parse this CCL command by executing the TECO command line parser macro stored in SYS:TECO.TEC. This macro can be modified by the user to parse switches or do any special processing that is desired. TECO.TEC is started up via the command @I^@ccl command^@:ER/SYS:TECO.TEC/"F^ACan't find SYS:TECO.TEC ^A^C^CA.,ZXV.,ZKMV.,.XV$$ which puts your CCL command in the text buffer and then loads (the first page of) TECO.TEC into Q-register V. TECO.TEC is then executed with the MV command and then Q-register V is cleared. It is the responsibility of TECO.TEC to parse the command line in the text buffer and do the appropriate processing and clean-up. It is also the responsibility of TECO.TEC to execute a user's start-up file (TECO.INI) if one is present. Note that TECO.TEC is not invoked if TECO is started via a RUN or R command. Also note, that the CCL command may not contain any embedded nulls. D.15 Overlays The key to writing fast TECO programs lies in understanding TECO-8's overlay structure. If TECO-8 is run in 16K or more (20K or more if VT support is present), then the overlays will be memory-resident rather than disk-resident. Although this is much faster than swapping from the disk, swapping from memory still involves some overhead, so it would be wise to structure your TECO program to minimize the number of swaps necessary. The overlay structure is designed so that the minimal number of swaps will be required unless obscure TECO features are used. There are five overlays to TECO: 1. The I/O-overlay. This overlay handles file opening and is initially resident. Thus no swapping is necessary to do in initial ER, EW, or EB. 2. The Q-overlay. This overlay contains most of the frequently used conditional commands and branching commands. It is intended that this overlay swap in once and remain in memory until TECO is exited. 3. The X-overlay. This is the exit overlay and handles commands needed only when TECO is exiting, such as EX, EF, EC, and EG. It is intended that this overlay will swap in only once when you are ready to leave TECO. 4. The F-overlay. This overlay contains the flag commands and other little-used commands. It is intended that Standard TECO PAGE 285 Appendices this overlay be not used at all, or if it is used, it will be used so infrequently that it will not slow down system performance. 5. The E-overlay. This is the error overlay. It is swapped in only when an error occurs. It is intended that this overlay never be swapped in. To write efficient TECO code, the user must know exactly which commands are handled by which overlay. This information is summarized below. Overlay Commands I-overlay ERfile$, EWfile$, EBfile$, :ERfile$, :EBfile$ Q-overlay Otag$, n"Xthen|else', n;, search;, n<...>, <...> X-overlay EC, EG$, EGcmd$, EF, EK, EX, *q, ?, nEJ, n^_, V, ^B, ^E, ^F, ^L, ^N, ^Uqtext$ F-overlay ED, EH, EO, ES, ET, EU, ^D, ^O, ,break \, n\, n=, n==, n:=, n:==, | Several things are immediately obvious. The command 0TT should always be preferred tot he V command. ELSE clauses should be avoided. (In future releases, we will try to move the processing of the | command into overlay Q.) The commands \ and = should be used as infrequently as possible from within long-running macros. Xq is preferred to ^Uq to load up a Q-register. -n-1 is preferred to n^_ to take a one's complement. Radix changes should be avoided. Flags, such as ET and ED, should be set once at the beginning of a macro, and then not fiddled with if at all possible. D.16 Installation Instructions The source of TECO consists of the following modules: TECO.MAC Main module TECINI.MAC Initialization module TECTBL.MAC Tables TECDEF.MAC Global definitions TECO12.MAC VR12 support TECOVT.MAC VT support TECOVI.MAC I/O-overlay TECOVQ.MAC Q-overlay TECOVX.MAC X-overlay TECOVF.MAC F-overlay TECERR.MAC E-overlay and error processor TECSRH.MAC Search processor TECNUM.MAC Arithmetic processor Standard TECO PAGE 286 Appendices Each of these modules should be assembled (using MACREL V2 or later). This can be accomplished via the command .MAC TEC???.MAC if your monitor supports wildcards in compile-class commands. The resulting relocatable modules are then linked together (using LINK V2 or later) to produce the executable TECO.SV image which should be put on SYS: (but it may reside on any device). If your monitor supports TECO.TEC, then TECO.TEC must be placed on SYS:. D.17 ARITHMETIC PRECISION TECO-8 performs 13-bit arithmetic except that multiplication and division by negative numbers gives unpredictable results. All numbers stored in Q-registers are 13 bits long. Number stored in flags (such as ET, EU, etc.) are only 12-bits long. When storing a number into a flag, the high order (sign bit) is lost. When using the value of a flag in an arithmetic expression, the 12-bit value is sign extended first. D.18 ALTERNATE STARTING ADDRESS The normal starting address of TECO is location 00200. In this (normal) mode, TECO will simulate tabs by spaces on type-out and will simulate vertical tabs and form feeds by line feeds. If your terminal has hardware tabs and vertical tabs (such as a KSR-35), then TECO can take advantage of these features. To enable this ability, you should change TECO's starting address to be 05200. This can be done by the monitor commands: .GET SYS:TECO .SAVE SYS:TECO;5200 D.19 VT05 SUPPORT TECO will automatically handle command string scope editing correctly on a VT05. The VT support (obtained via use of the -1W command) will handle VT05's correctly. The VTEDIT macro does not currently support the VT05 keypad. Standard TECO PAGE 287 Appendices APPENDIX E TOPS-10 OPERATING CHARACTERISTICS TMPCOR SUPPORT The EQ and E% commands support the pseudo-device TMP: for TMPCOR. Only the first three letters of the file name will be used, to try and access a TMPCOR file. If that fails, it will try nnnNAM.TMP where nnn is your job number and NAM is the three-character name. For example: for job 23, EQqTMP:FOOBAR$ will read TMPCOR file FOO or 023FOO.TMP. Q-REGISTER NAMES Any printable character (except open parenthesis) is valid as a Q-register name. A Q-register whose name is a lower case alphabetic character is the same as the Q-register whose name consists of the corresponding upper case letter. Thus Qa and QA are equivalent commands. Q-register names may also be up to 6 characters long, by enclosing the name in parentheses. For example, Q(FOOBAR). Q-register names may contain any printable characters, however all characters other than letters, digits, dollar-sign, space, and underline are reserved for special use by TECO. A Q-register name consisting entirely of zero or more spaces is the same as Q-register (), which is special and discussed below. Trailing spaces in Q-register names are discarded, and lower case is converted to upper case. REFERENCING THE TEXT BUFFER AS A Q-REGISTER The Q-register with the null name: () is the text buffer. The numeric part of this Q-register is the value of dot. The sequence [A ]() causes Q-register A to share with the text buffer. The old main text buffer is lost (unless it is also sharing with some Q-register or if it has been saved on the Q-register push-down list). The text in Q-register A becomes the text buffer and the numeric part of Q-register A is used for "." if it is in range, otherwise dot is set to 0. SHARING OF Q-REGISTER POINTERS Q-registers may share their text with each other and with the text buffer as a result of [ and ] commands. When a Q-register is pushed ontot he Q-register pushdown list, all that is pushed is the numeric part of the Q-register and a pointer to the text part of the Q-register. Thus a command such as [A ]B would cause Q-registers A and B to share the same text. The commands X, ^U, and EQ could be applied to either Q-register without modifying the other, since the Q-register is unbound from its previous text first. However, the colon-modified forms of X and ^U append to the existing text, so a :X or :^U command for either of them would affect the other. Standard TECO PAGE 288 Appendices <<>> Standard TECO PAGE 289 Appendices APPENDIX F VAX/VMS OPERATING CHARACTERISTICS To be supplied by either Andy Goldstein or Mark Bramhall. Standard TECO PAGE 290 Appendices APPENDIX G reserved for TOPS-20 OPERATING CHARACTERISTICS Standard TECO PAGE 291 Appendices APPENDIX H OCTAL & DECIMAL ASCII CHARACTER SET CHAR OCT DEC CHAR OCT DEC CHAR OCT DEC CHAR OCT DEC NUL 000 000 SP 040 032 @ 100 064 ` 140 096 ^A 001 001 ! 041 033 A 101 065 a 141 097 ^B 002 002 " 042 034 B 102 066 b 142 098 ^C 003 003 # 043 035 C 103 067 c 144 099 ^D 004 004 $ 044 036 D 104 068 d 144 100 ^E 005 005 % 045 037 E 105 069 e 145 101 ^F 006 006 & 046 038 F 106 070 f 146 102 ^G 007 007 ' 047 039 G 107 071 g 147 103 ^H 010 008 ( 050 040 H 110 072 h 150 104 TAB 011 009 ) 051 041 I 111 073 i 151 105 LF 012 010 * 052 042 J 112 074 j 152 106 VT 013 011 + 053 043 K 113 075 k 153 107 FF 014 012 , 054 044 L 114 076 l 154 108 CR 015 013 - 055 045 M 115 077 m 155 109 ^N 016 014 . 056 046 N 116 078 n 156 110 ^O 017 015 / 057 047 O 117 079 o 157 111 ^P 020 016 0 060 048 P 120 080 p 160 112 ^Q 021 017 1 061 049 Q 121 081 q 161 113 ^R 022 018 2 062 050 R 122 082 r 162 114 ^S 023 019 3 063 051 S 123 083 s 163 115 ^T 024 020 4 064 052 T 124 084 t 164 116 ^U 025 021 5 065 053 U 125 085 u 165 117 ^V 026 022 6 066 054 V 126 086 v 166 118 ^W 027 023 7 067 055 W 127 087 w 167 119 ^X 030 024 8 070 056 X 130 088 x 170 120 ^Y 031 025 9 071 057 Y 131 089 y 171 121 ^Z 032 026 : 072 058 Z 132 090 z 172 122 ALT 033 027 ; 073 059 [ 133 091 { 173 123 FS 034 028 < 074 060 \ 134 092 | 174 124 GS 035 029 = 075 061 ] 135 093 } 175 125 RS 036 030 > 076 062 ^ 136 094 ~ 176 126 US 037 031 ? 077 063 _ 137 095 DEL 177 127 Standard TECO PAGE 292 Appendices APPENDIX I Differences between OS/8 TECO V5 and TECO-8 V7 TECO-8 V7 has fixed the following bugs: 1. The AY command didn't work (used to give ?NAY error message). 2. Certain conditionals within conditionals weren't working. 3. When the warning bell is rung indicating that you are within 10 characters of overflowing command input memory, a bell (but no "^G") is typed. 4. (^G)* didn't work properly if there was text in Q-registers, (^U) immediate mode command sometimes failed if there was a * in the command string, and rubbing out a line feed in scope mode used to fail in certain instances. 5. n*0 is now 0 rather than 4096. Multiplication and division by negative numbers is still not properly supported. 6. TECO V5 failed to run correctly in 8K machines. 7. TECO used to blow up if you tried to skip over a W command. 8. The 0<...> command used to not clear the number flag, so that a subsequent T command wouldn't work. 9. The $ command used to not clear the comma flag, so that certain subsequent commands (such as H$T) would fail if a second argument were pending. 10. After an insert command, an iteration with an unspecified iteration count used to not work properly. Standard TECO PAGE 293 Appendices TECO-8 V7 has the following new features: 1. Symbiont support. This allows TECO-8 to run under the OS/78 operating system while a symbiont is running. 2. VT support. This provides a window feature into the text buffer (for use with VT52 and VT100 terminals). 3. W command. -1W updates window into text buffer. 0W resets cursor line to its default position. nW if n is positive, sets the cursor line to line n. If n is negative, nW causes the VT support to 'forget' the top -n-1 lines on the screen. These commands are only operable if VT support is enabled. 4. The (^S) immediate mode command no longer gives you an error message if used immediately after a (^S) had already been used. 5. :ER and :EB commands. These are the same as ER and EB, however, if the specified file is not found, then no error message is generated. Instead, no new file is opened and the command returns a value of 0. If the command had succeeded, then a value of -1 is returned. 6. The /S switch is now legal in filespecifications. For example, ERFOO.TE/S$ is permitted. This switch puts TECO in 'SUPERTECO' mode. In this mode, TECO will be able to read through end-of-files. A (^Z) in an ASCII file will not mean end-of-file. Instead, the (^Z) will be read in like any other character. (^Z) is not considered to be a line terminator or a page terminator. TECO reverts back to normal mode the next time an ER, EW, or EB command is issued and no /S switch appears within the filespecification. 7. F_ command. Similar to FS and FN but _ searching is employed. This command is affected by yank protection and the 2's bit in the ED flag (qv). 8. ^L command. This command types a form feed on the terminal when it is executed. 9. The ^A command can now be @-sign modified. The form is thus @^A/text/ where / denotes any delimiter that does not appear within the text. If the ! or O command is @-sign modified, unpredictible results will occur. 10. ED flag bits. Two bits have been implemented. 1. The 1's bit (bit 11). If this bit is on (1), then up-arrows (^'s) in search strings are treated as ordinary up-arrows. This is the default. If this bit is off (0) then an ^ in a search string is a Standard TECO PAGE 294 Appendices special string build character. It takes the next character and converts it to its corresponding control character. The result is as if that control character had appeared in the string. 2. The 2's bit (bit 10). If this bit is off (0), then Yank protection is enabled. Yank protection causes the commands Y, _, and F_ to abort if there is text in the text buffer and there is an output file open. This is the default. If this bit is on (1), then Yank protection is disabled (thus all Y commands would work regardless of possible loss to data). 11. When you chain to TECO.SV, the chain argument (TECO command) can now be much larger tha before. The argument passed must be in ASCII (one character per word) beginning at location 17600. Such characters must be positive (bit 0 off). If a negative number is encountered, then this tells TECO that the command is continued at the specified address in field 1. A word of 0 terminates the command. This feature is not of much use at the presnt time. 12. If you are not on a PDP-12, and you do not have VT support, then you get an extra 7 characters in your search buffer (limits length of search strings). 13. Several new bits in the ET flag have been implemented: 1. Bit 10 (value 2). This bit is initially on if you had typed a SET TTY SCOPE command to the monitor and off if you had typed SET TTY NOSCOPE. User modification of this bit has no effect. 2. Bit 9 (value 4). This bit is initially on for compatibility with TECO-11 macros. That means that TECO will read lower case characters typed on the terminal as is, and will not convert them to upper case. User modification of this bit has no effect. 3. Bit 6 (value 32). This bit has meaning only if VT support is present. This bit is initially off (0). If turned on, then T commands read a character if one is available in the type-ahead buffer (or the terminal buffer), but if no input character is available, then this command returns a -1. This bit is cleared by TECO everytime TECO returns to prompt level. 4. Bit 5 (value 64) is initially 0 is not current used by TECO-8. 5. Bit 4 (value 128). This is now the abort on error bit. This bit is initially on. Whenever this bit Standard TECO PAGE 295 Appendices is on (1) and TECO prints an error message, control subsequently returns to OS/8. If this bit is off (0), then control returns to TECO's prompt. Whenever TECO prompts with a *, this bit is turned off. 6. Bit 3 (value 256). This bit only has meaning if VT support is available. If this bit is on, then displayed lines are truncated at the right edge of the screen. If this bit is off (default), then lines that are longer than the terminal width are continued on the next line of the display. 7. Bit 2 (value 512). This bit is on initially if you have VT support and off if you don't. User modification of this bit has no effect. 8. Bit 1 (value 1024). This bit is on initially if you have a PDP-12 and VR12 support is available. It is 0 if not. User modification of this bit has no effect. 9. Bit 0 (value 2048). This bit enables trapping of CTRL/C's. If this bit is on (1), then whenever a CTRL/C is typed, this bit is turned off and the CTRL/C is entered into TECO's type-in buffer just as any other character. It has ASCII code 3 and may then be read by the T command. Whenever this bit is off (0), then typing a CTRL/C has special effect as usual (causes a ?XAB error message if TECO was executing commands). This is the default. This bit only has effect if VT support is enabled. 14. VT05 scope support (at editing level) is now automatically established if you have a VT05 and you had performed a SET TTY SCOPE command to the OS/8 monitor. This support enables the CTRL/U immediate mode command to properly erase the line from the screen. It also allows rubouts to work properly on VT05s. 15. The CTRL/R character is now identical with the CTRL/Q character within search strings. It causes the next character to be interpreted literally. 16. The ?POP error message now tells you whether it was a C, R, or J command that attempted to move the pointer outside the bounds of the text buffer area. If another command (such as nA or m,nK or m,nP) tries to access a pointer position outside the text buffer, you also get a ?POP error code with a different message. Furthermore, if an nD command tries to delete non-existent character positions, no characters are deleted and you get the ?DTB (Delete Too Big) error message. Standard TECO PAGE 296 Appendices 17. The "= command. It is synonomous with the "E command. 18. The error codes ?NAC, ?NAS, and ?NAY have been changed to ?NCA, ?ISA, and ?NYA respectively. 19. Type ahead. If VT support is enabled, then you can type-ahead to TECO. 20. EXIT protection. The EX, EC, and EG commands now abort (with the ?NFO error) if there is text in the text buffer and there is no output file open. This is meant to protect user's from accidental loss of data. The commands can always be executed by proceeding them with an HK. 21. Auto ? feature. If bit 9 (4's bit) of the EH flag is on (1), then TECO will simulate the action of a ? after printing an error message. This automatic action does not occur when bit 9 is off (0), the default. 22. If TECO is chained to, then before it parses your TECO command, it will look to see if you have a file called TECO.INI on SYS:. If you have one, then it will be read into Q-register W and it will be executed. If an error occurs in this file, then the TECO command that you passed to TECO will not be executed. After this command has been executed, Q-register W will be cleared and TECO will proceed to execute your command that was passed to it upon chaining (i.e. an EW command if you had invoked TECO with a MAKE CCL command). When that is done, TECO will execute Q-register X if and only if the TECO.INI program returned a non-zero value. It is up to TECO.INI to load up Q-register X and return a value (preferably 1) if this feature is to be used. A useful way to uset his feature is to have TECO.INI load Q-register I with an editing macro and then put an MI command in Q-register X. 23. If TECO is chained to and location 7600 in field 1 contains a 12-bit 0, then TECO works completely different than before. In that case, TECO assumes that a CCL command (like TECO FOO/INSPECT) is being passed to it rather than a TECO command. Such a command begins at location 17601 and consists of ASCII text terminated by a fullword 0. A negative word indicates a pointer to subsequent text. TECO will then parse this CCL command by invoking SYS:TECO.TEC with the specified command left in the text buffer. TECO.TEC will execte out of Q-register V which will be cleared upon conslusion of command parsing. This feature would be useful if CCL were modified to pass TECO commands directly to TECO rather than parsing them itself. This gives the user much flexibility in adding options to his TECO commands. 24. When an illegal character occurs in a command such as Standard TECO PAGE 297 Appendices Eq, if that character is a tab, TECO will print it as rather thana s int he error message. 25. If the contents of EH bits 10 and 11 is 3, then TECO is put into super extended error message mode (war and peace mode), provided you have at least 16K and no VT support or 20K with VT support. In this mode, each error message will be accompanied by an explanatory paragraph of helpful information culled from the file SYS:TECHLP.TXT which can be edited by the user to suit his own needs. (Note: always leave TECO and re-enter it after editing TECHLP.TXT since TECO notes its location upon startup and unpredictible results will occur if this file is moved during TECO's execution.) 26. With the same memory restrictions as above, if the EH help level is not set to 3, you can still get the paragraph of help information by typing / as the very first character after TECO's prompt. This will give you a detailed song and dance about your previous error. 27. TECO will turn off trace whenever it comes back to prompt level. 28. The * immediate mode command has been implemented. If typed as the very first keystroke after TECO's prompt, it will save away the previous command string in Q-register z. It will also type a z to inform you of this fact. It is exactly equivalent to the CTRL/S feature of OS/8 TECO V5 and is preferred since CTRL/S may go away in a subsequent release. 29. The ^_ command. n^_ returns the ones complement of the number n. Note that ^_ is a TECO command and is not a unary operator. 30. The V command. This command is identical to 0TT and was put in for TECO-11 compatibility. This command currently does not accept an argument. The 0TT command is preferred inside macros since it will run faster. (The V command is located in a little-used overlay.) 31. The "D and "A conditionals. These test the numeric argument to see if it is the ASCII code for a digit or alphabetic character repsectively. 32. The EY command. This is equivalent to Y but is not affected by Yank protection. 33. The immediate action commands LF and BS have been added. If typed as the very first keystroke after TECO's prompt, LF will cause an effective LT command to be immediately executed and BS (Backspace or CTRL/H) will cause an immediate -LT command to be executed. No double ALTMODE is necessary. Standard TECO PAGE 298 Appendices 34. Additional error messages were added to warn of commands such as [A and EP that are implemented in other TECOs but not available in TECO-8. 35. The m,n commands were added. They turn off those bits specified by m and turn on those bits specified by n. 36. Display of search string in search failure error message now shows the match control constructs as , , and . is displayed as . Standard TECO PAGE 299 Appendices The following features of OS/8 TECO V5 have been removed and are not in TECO-8 V7: 1. The execution-time command CTRL/P has been removed. It is equivalent to the CTRL/C execution-time command. 2. TECO no longer displays the contents of the memory location specified in the swith register in the MQ. Standard TECO PAGE 300 Appendices APPENDIX J DIFFERENCES BETWEEN TECO-10 V1 AND TOPS-10 TECO V24 TECO-10 has the following new features that were notin DEC's TECO (V24): 1. Y protection. 2. Defaulting unspecified fields in ER, EW, and EB commands. 3. EW aborts if output file open. 4. Log file capability (EL) 5. Rename capability 6. EQ 7. Additional Q-register names 8. TTCALLS with ^T 9. TECO image can be saved 10. :ER, :EB. :J, :C, :R, and :D 11. PPNs of form [-], [,], [m,] and [,n] allowed 12. Chars typed by ^A command print immediately and are not buffered 13. I/O switches may be abbreviated. 14. Backward searches (-S) 15. Bounded searches (FB and FC) 16. Anchored searches (::S) 17. Appending to files (EW/APPEND) 18. CTRL/C - REENTER works 19. ^C TECO command 20. EI and EP [SIC] 21. TECO.INI 22. FD and FK 23. Search failures preserve . if 16's bit in ED flag set Standard TECO PAGE 301 Appendices 24. nEC 25. n^P and n^Y 26. n,m= 27. GETTABs via n,m^G 28. n^F 29. EO value is 1 30. New switches /SIXBIT, /ASCII, /OCTAL, /PROTECTION:nnn 31. Command line scope editing 32. Window support 33. n%q 34. nA 35. Split Q-registers 36. <...> truly infinite 37. is not treated as + 38. Arguments can pass through [ and ] 39. EU works on lower case terminals 40. ^G* 41. EC 42. EK 43. FR 44. n^_ 45. nV 46. := and :== 47. n^T 48. ^B 49. "< and "> and "= 50. :Gq 51. Additional error messages: Standard TECO PAGE 302 Appendices 1. ?CPQ Can't pop Q-register 2. ?OFO Output file already open 3. ?YCA Y command aborted 4. ?ABS Ambiguous I/O switch abbreviation 5. ?BFS Bad file specification 6. ?DDR Double directory illegal 7. ?DDV Double device illegal 8. ?DEX Double extension illegal 9. ?DFN Double Filename illegal 10. ?ILD Illegal Device 11. ?IPA Illegal ^P or ^Y argument 12. ?ITT Illegal TTCALL type value 13. ?NAL No Altmode after nEL 14. ?NLF No log file open 15. ?NXD Non-existent device 16. ?PTL Page number too large 17. ?RNF Rename failed 52. :Qq 53. ^S TECO command 54. @O and @! 55. ^U TECO command 56. Appending to Q-registers (:X and :^U) 57. :] 58. == prints unsigned 59. "R 60. Bit 2 of ED flag controls Yank protection 61. EX aborts with ?NFO if output file is open and text is in text buffer Standard TECO PAGE 303 Appendices 62. nY aborts with ?NYA 63. nP aborts with ?IPA if n is negative 64. ^EB, ^R, and ^EM match control constructs 65. EY 66. EJ Standard TECO PAGE 304 Appendices APPENDIX K DIFFERENCES BETWEEN TECO-11 V34 AND TECO-11 V29 1) EO returns 34 instead of 29 2) ^R command (radix set/read) ^R returns the current radix (8, 10, or 16) n^R sets the radix (only legal values are 8, 10, or 16) (^O and ^D both still work; ^R would return 8 and 10 respectively) 3) n=== prints n in hexidecimal followed by a cr/lf n:=== prints n in hexidecimal without any cr/lf 4) n and will operate with hexidecimal radix 5) Ostring$ can use the string building constructs for the tag (e.g., ^EQq) 6) Q command has three (3) formats: Qq returns the value in Q-reg q :Qq returns the size of Q-reg q nQq returns the value of the (n-1)th character in Q-reg q or -1 if n is too large 7) Immediate lf after * prompt if .=z already then a nop (normal EV processing does take place) else does +1L then if EV is active (<>0) lets EV processing take place else does a T 8) Immediate bs after * prompt if .=0 already then a nop (normal EV processing does take place) else does -1L then if EV is active (<>0) lets EV processing take place else does a T 9) The only special characters in an indirect command file (EI) are double ESCape which starts command execution (all other normal command entry specials are not treated as special) 10) EJ command: -1EJ returns operating system dependent value 0EJ returns job dependent value (e.g., job number) 1EJ returns terminal dependent value (e.g., terminal number) 2EJ returns PPN or UIC 11) EG command: EG$ EX then exit to operating system and re-execute last compile class command if you can EGcmd$ EX then exit to operating system and execute 'cmd' :EGcmd$ operating system dependent action... returns a value of -1 for success, 0 for illegal 'cmd', or other value for error when executing 'cmd' 12) ED flag: Bit value 4 means 'no arbitrary memory expansions'; a Y (or the Y part of P, N, etc.) will not try to enlarge the text buffer if a form feed was not encountered (this is good when editing large files without any form feeds); the A command always ensures that there are 256. free bytes in the text buffer (and will expand memory if needed) 13) Error messages: Standard TECO PAGE 305 Appendices ?IRA Illegal radix other than 8, 10, or 16 to n^R ?IUC Illegal ^ character other than ASCII octal 100 through 137 or ASCII octal 141 through 172 after ^ 14) W command: W VT52: forget screen image, SEEALL mode, mark, hold mode VT11: refresh screen using last defined view amount 0W VT52: forget screen image, SEEALL mode, mark, hold mode, and set cursor line to default (16) VT11: turn off screen +nW VT52: forget screen image, SEEALL mode, mark, hold mode, and set cursor line to n (default is 16) VT11: set view amount to n (default is ??) and refresh screen -1W VT52: refersh screen VT11: nop -nW VT52: forget top n-1 lines of screen VT11: nop 32768W VT52: forget that output was done VT11: nop 15) :W command: :W same as 0:W 0:W returns scope type (0=>VT52, 2=>VT100 in VT52, 4=>VT100 in ANSI, 6=>VT05) 1:W returns scope width 2:W returns scope height 3:W returns SEEALL mode (0=>off, -1=>on) 4:W returns mark (0=>none, n=>mark @ n-1) 5:W returns hold mode (0=>off, -1=>hold whole screen, n=> hold all but top and bottom n lines) 6:W returns "dot" position of upper left hand corner of last -1W 32768+n:W inserts characters at "dot" until... characters are read (echo off) from the terminal and inserted at "dot" until and according to the microcoded bits in n 128 => return immediately if no terminal characters 64 => return on any character 32 => don't update screen (i.e., do a -1W) 2 => return on TAB's return is always done on control characters (0 through 37 and 177 except TAB) returned value has return character code in low byte (0 through 177 or 377 for returned immediately); sign bit (value 32768) is set if one or more inserts were done n,:W same as n,0:W n,0:W sets scope type (n must be 0, 2, 4, or 6) n,1:W sets scope width (n must be between 10 and 254 and even) n,2:W sets scope height (n must be between 10 and 127) n,3:W sets SEEALL mode (n=0 for off, n<>0 for on) n,4:W sets mark (n=0 for none, n<>0 for mark @ n-1) n,5:W sets hold mode (n=0 for off, n=-1 for hold whole screen, n>0 for hold all but top and bottom n lines) n,6:W sets "dot" position for upper left hand corner for next -1W (applies only if hold mode is on and cursor is within the specified limits) Standard TECO PAGE 306 Appendices 16) ^C^C => unconditionally exit from TECO (second ^c must be a real CTRL/C) 17) F> => flow to > (go to end of iteration; count iteration; loop if more) 18) $$ => unconditionally end macro/command (second $ must be a real ESCape) 19) F< => flow to < (go back to start of iteration or macro/command; don't count if in iteration) 20) :; => opposite of ; (also valid after iteration searches) 21) m,nUq => same as nUQm 22) F' => flow to ' (exit from conditional) 23) F| => flow to | (go to else clause of conditional) 24) FB => bounded search m,nFBstring$ => search between m and n; backwards if m>n nFBstring$ => same as .,(n^Q+.)FBstring$ 25) FC => bounded search and replace FCstg1$stg2$ => same as FBstg1$FRstg2$ 26) E_string$ => _string$ without yank protection 27) EY => Y without yank protection 28) :P, :Y, :EY => return 0 if eof; else return -1 29) A => append page :A => append page; return 0 if eof; else return -1 nA => return char @ .+n; else return -1 n:A => append n lines; return 0 if eof; else return -1 30) m,n => n(m^_) 31) nOtag0,tag1,tag2,tag3,...$ => go to tag n; else continue in-line 32) ED flag: Bit value 16 means 'do not reset dot to zero on search failure' 33) String build characters: ^R same as ^Q ^EUq use character corresponding to value of Q-reg q 34) Match control characters: ^EB same as ^S 35) Error messages: ?NYA Numeric arg with Y replaces ?NAY ?IPA Illegal P arg negative or zero argument to P 36) "= => same as "E 37) " | ' (If ... Then ... Else) INCOMPATIBILITIES INTRODUCED BY TECO V34 1) :A (append 1 line) is now 1:A and returns 0 if eof; else -1 2) nA (get character value at .+n) now returns -1 instead of ?POP Standard TECO PAGE 307 Appendices APPENDIX L Incompatible, Obsolete, and System-Specific Commands This appendix describes commands that are peculiar to specific operating systems. These commands fall into many categories. Some are obsolete, and are kept around only as a convenience to the user. Others are so system specific or so obscure, that it was felt best not to include them in the main body of the manual. Some are commands that are incompatible across operating systems. Some are new commands that have not become firmly established and may change in the future. In general, use these commands at your own risk and with the understanding that in future releases of TECO, these commands may change, or go away completely. Implementors of TECO's on other operating systems would be well-advised to contact the TECO SIG before implementing any of these features. L.1 SPECIFIC FEATURES OF TECO-11 L.1.1 TECO COMMANDS Command Description m,nStext$ Performs the same function as the nS command, but m serves a bound limit for the search. If the search string can be found without moving the pointer more than ABS(m)-1 places, the search succeeds and the pointer is repositioned to immediately after the last character of the string. Otherwise, the pointer is left unchanged. (See 2.13 for a description of the ^Q operator. It converts line moving arguments to character moving arguments.) 0,nStext$ Performs the same function as the nS command, but the pointer position will remain unchanged on search string failure. (Essentially an unbounded search with no pointer movement on failure.) m,Stext$ Identical to "m,1Stext$". m,-nStext$ Performs the same function as the m,nS command, but searches is the reverse direction. m,-Stext$ Identical to "m,-1Stext$". G* Get most recent filespec string. The asterisk is not actually a Q-register but Standard TECO PAGE 308 Appendices represents TECO's filespec string area. Copy the contents of the filespec string area into the buffer at the current position of the buffer pointer, leaving the pointer positioned after the last character copied. The filespec string area contains the fully expanded filespec of the last E command (see Appendices). :G* Print the contents of the filespec buffer on the terminal. G_ Get most recent search string. The underscore (backarrow) is not actually a Q-register but represents TECO's search string area. Copy the contents of the search string area into the buffer at the current position of the buffer pointer, leaving the pointer positioned after the last character copied. :G_ Print the contents of the search string buffer on the terminal. ^Q n^QC is identical to nL. The N^Q command returns the number of characters between the buffer pointer and the nth line separator (both positive and negative). This command converts line oriented command argument values into character oriented argument values. Used after an expression. L.1.2 STRING BUILD CONSTRUCTS Construct Description Q* Q* indicates that the string stored in the filespec buffer is to be used in the position occupied by the ^EQ* in the search string. Q registers are discussed in section 2.9 below. Q_ Q_ indicates that the string stored in the search string buffer is to be used in the position occupied by the ^EQ_ in the search string. Q registers are discussed in section 2.9 below. Standard TECO PAGE 309 Appendices L.2 SPECIFIC FEATURES OF OS/8 L.2.1 IMMEDIATE ACTION COMMANDS Command Description If used as the first keystroke after TECO's prompt, this command is the same as *Z, that is, it saves the last command string in Q-Register Z. This command echoes as *Z and does not have to be followed by an ESCAPE. Standard TECO PAGE 310 Appendices L.3 SPECIFIC FEATURES OF RSX-11/M, RSX-11/D, IAS, and VAX/VMS 3.1 IMMEDIATE ACTION COMMANDS Command Description Aborts command execution and returns control to the operating system. Equivalent to typing . L.4 SPECIFIC FEATURES OF RSTS/E L.4.1 TECO COMMANDS Command Description :EGRTS$ Switch to private default run-time-system. :EGRTS foo$ Switch to RTS "foo". :EGFSS string$ File strign scan "string". :EGCCL cmd$ Try "cmd" as a CCL command. :EGRUN file$ Try to run "file". :EGRUN file=xx$ Try to run "file" with "xx" placed in core common. :EGEMT$ Issue a monitor directive. The FIRQB is loaded from Q-registers A through P and the XRB is loaded from Q-registers Q through W. The low byte of teh value in Q-register A is the monitor EMT code to issue. If the high byte of the value in Q-reg A is >0 then the text part of Q-reg A is put into the XRB for a 'write' (XRLEN= size of A, XRBC=size of A, XRLOC->A); if Q-reg A high byte is <0 then the text part of Q-reg A is put into the XRB for a 'read' (XRLEN=size of A, XRBC=0, XRLOC->A) Returned value is -1 for success, 0 for unrecognized command, or >0 for the RSTS/E error code The FIRQB is placed in the numeric part of Q-regs A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P The XRB is placed in the numeric part of Q-regs Q, R, S, T, U, V, W 32768+n:W inserts characters at "dot" until... characters are read (echo off) from the terminal and inserted at "dot" until and according to the microcoded bits in n 128 => return immediately if no terminal characters Standard TECO PAGE 311 Appendices 64 => return on any character 32 => don't update screen (i.e., do a -1W) 2 => return on 's return is always done on control characters (0 through 37 and 177 except ) returned value has return character code in low byte (0 through 177 or 377 for returned immediately); sign bit (value 32768) is set if one or more inserts were done L.4.x SWITCHES Switch Description / Same as /B+ Standard TECO PAGE 312 Appendices L.5 SPECIFIC FEATURES OF TOPS-10 L.5.1 TECO Commands Command Description nEM Positions a magtape. The magtape must first be opened for input with an appropriate ER command, then it can be positioned. To output to the magtape, it must then be reopened for output. The positioning function that takes place depends on the value of n. [TECO-10 only] Value Action 1EM Rewind the currently-selected input magtape to load point. 3EM Write an end-of-file record. 6EM Skip ahead one record. 7EM Back up one record. 8EM Skip ahead to logical end of tape (defined by two successive end-of-file marks). Leave the magtape positioned between the two end-of-file marks so that successive output correctly overwrites the second EOF. 9EM Rewind and unload. 11EM Write 3 inches of blank tape. 14EM Advance tape one file. This leaves the tape positioned so that the next item read will be the first record of the next file (or the second end-of-file mark at the logical end-of-tape). 15EM Backspace tape one file. This leaves the tape positioned so that the next item read will be the end-of-file mark preceding the file backspaced over (unless the file is the first file on the tape). EM Same as 1EM Standard TECO PAGE 313 Appendices ^Q n^QC is identical to nL. This command returns the number of characters between the buffer pointer and the nth line separator (both positive and negative). This command converts line oriented command argument values into character oriented argument values. Used after an expression. F0 Pointer position of start of window. Same as 6:W. FZ Pointer position of end of window. FH Same as F0,FZ. FX Software maintained horizontal coordinate of location of cursor on screen (0-origin). Updated by TECO on terminal output. If TECO cannot determine the updated location of the cursor, this value is set to -1. nFX Set value of FX register to n. FY Software maintained vertical coordinate of location of cursor on screen (0-origin). Updated by TECO on terminal output. If TECO cannot determine the updated location of the cursor, this value is set to -1. nFY Set value of FY register to n. FP Equivalent to FY,FX. m,nFP Equivalent to mFYnFX. m,nFF Updates FY and FX registers as if the m,nT command were executed. nFF Assumes that the scope cursor is pointing at the character that is just to the right of the text buffer pointer (the current character). Then this command advances n screen lines and goes to the end of that line and returns that pointer position. nFQq Compares characters beginning at dot with characters beginning at the nth character in Q-register q (0-origin). When a match fails or the match ends, this command moves the pointer to after the last character that matched and returns the index into the Q-register. E=filespec$ Renames the input file. ::Gq Same as :Gq but types literally. ::ER Same as ER but no defaults are used <<>> ^Z Closes output file and exits from TECO. Standard TECO PAGE 314 Appendices ^P Returns current page number. n^P Executes P commands until page n has been reached. n^Y Executes Y commands until page n has beenr eached. n,m= Same as m=n^T. m,n^G <<>> m,n:^T Does an arbitrary TTCALL. E&filespec$ Run the specified program when TECO exits. Can take a numeric argument which is the run-offset. 0 is the default. m,nE* Does an arbitray TRMOP to your terminal. [Not availbale on TOPS-20.] Standard TECO PAGE 315 Appendices APPENDIX M ERROR MESSAGES TECO error messages consist of a three letter message preceded by a question mark (?) or proceeded by ?TEC. A short description of the error optionally follows (dependent on the current value of the EH flag). Typing ? (question mark) immediately after an error message printout causes the command string to be printed up to and including the character which causes the error message. Typing *q (asterisk, Q-register name) immediately after an error message printout saves the entire command string in the specified Q-register. This is especially useful for recovering mistyped insert commands. Both the ? and *q facilities may be used when an error occurs. TECO-11 also produces two warning messages. These messages do not abort the command and execution continues. %Superseding existing file Indicates that the file to be created as the result of an EW command already exists. If the output file is closed the old copy of the file will be deleted. The EK command may be used to "take back" the EW command. %Search fail in iter Indicates that a search command has failed inside iteration brackets. A ; (semi-colon) command immediately following the search command can typically be used to suppress this message. ERROR MESSAGES These error messages are listed alphabetically by their three-letter code. In general, these three-letter codes have the same meaning on all implementations, although not all error messages are produced by each implementation. The one-line error message given here is a paraphrasing of the message given, which may differ slightly from system to system. For the exact wording that a particular implementation gives for a specific error message, consult chapter VII. ?ARG Improper Arguments Three arguments are given (a,b,c or H,c). ?BNI > not in iteration There is a close angle bracket not matched by an open angle bracket somewhere to its left. (Note: Standard TECO PAGE 316 Appendices an iteration in a macro stored in a Q-register must be complete within the Q-register.) ?CCL CCL.SV not found or EG argument too long The EGcommand$ command on OS/8 was unable to locate SYS:CCL.SV or the specified command has more than 46 characters. ?CPQ Can't pop into Q-register A ] command has been executed and there is nothing saved on the Q-register push down list. ?DEV Invalid device A file specification string in an E command contains an unknown device name. ?DTB Delete too big An nD command has been attempted which is not contained within the current page. ?ERR RSTS/E error message (RSTS/E only) Some RSTS/E monitor call failed. The error message text explains the error. ?FER File Error The file specified in an ER, EW or EB command was not found. ?FNF File not found "filespec" The requested input file could not be located. If this occurred within a macro the colon modified ER or EB command may be necessary. ?FUL Output Command would have overflowed output device The page of text currently in the text buffer will not fit in the open output file. Until enough free space can be obtained on the output device the file may have to be split. An EF command to close the current output file, followed by a new EW command to a temporary file may be used. The files should then be concatenated when the space problem is alleviated. ?IEC Illegal character "x" after E An invalid E command has been executed. The E character must be followed by an alphabetic to form a legal E command (i.e., ER or EX). ?IFC Illegal character "x" after F An invalid F command has been executed. The only valid F commands are FB, FC, FD, FK, FN, FR, FS, and F_. ?IFN Illegal character "x" in filename The filespec as an argument to one of the E Standard TECO PAGE 317 Appendices commands is unacceptable to the system. The file specification must be appropriate to the system in use. ?IIA Illegal insert arg A command of the form "nItext$" was attempted. This combination of character and text insertion is illegal. ?ILL Illegal command "x" An attempt has been made to execute an invalid TECO command. ?ILN Illegal number An 8 or 9 has been entered when the radix of TECO is set to octal. ?INP Input error The system has reported an error attempting to read the current input file. The text buffer may be corrupt. This operation may be retried, but if the error persists, the user may have to return to a backup file. ?IPA Negative or 0 argument to P The argument preceding a P or PW command is negative or 0. ?IQC Illegal " character One of the valid " commands did not follow the ". Refer to Section 2.12 (conditional exectution commands) for the legal set of commands. ?IQN Illegal Q-reg name "x" An illegal Q-register name was specified in one of the Q-register commands. ?IRA Illegal radix argument to ^R The argument to a ^R radix command must be 8, 10, or 16. ?ISA Illegal search arg The argument preceding a search command is 0. This argument must not be 0. ?ISS Illegal search string One of the search string special characters (^Q, ^V, ^W, etc.) would have modified the search string delimiter (usually ESCAPE). ?IUC Illegal character "x" following ^ The character following an ^ must have ASCII value between 100 and 137 inclusive or between 141 and 172 inclusive. Standard TECO PAGE 318 Appendices ?MEM Memory overflow Insufficient memory available to complete the current command. Make sure the Q-register area does not contain much unnecessary text. Breaking up the text area into multiple pages might be useful. (Section 2.18.) ?MFN Missing file name An ER or EW command has been executed in which the file name has been left out. ?MRP Missing ) A command string has been executed which contains a parenthetical expression that is not closed by a right parenthesis. ?NAB No arg before ^_ The ^_ command must be preceded by either a specific numeric argument or a command that returns a numeric value. ?NAC No arg before , A command has been executed in which a , is not preceded by a numeric argument. ?NAE No arg before = The = or == command must be preceded by either a specific numeric argument or a command that returns a numeric value. ?NAP No arg before ) A ) parenthesis has been encountered and is not properly preceded by a specific numeric argument or a command that returns a numeric value. ?NAQ No arg before " The " commands must be preceded by a single numeric argument on which the decision to execute the following commands or skip to the matching ' is based. ?NAS No arg before ; The ; command must be preceded by a single numeric argument on which the decision to execute the following commands or skip to the matching > is based. ?NAU No arg before U The U command must be preceded by either a specific numeric argument or a command that returns a numeric value. ?NCA Negative argument to , A comma was preceded by a negative number. Standard TECO PAGE 319 Appendices ?NYA Numeric argument with Y The Y command must not be preceded by either a numeric argument or a command that returns a numeric value. ?NFI No file for input Before issuing an input command, such as Y, it is necessary to open an input file by use of a command such as ER or EB. ?NFO No file for output Before issuing an output command such as N search or P it is necessary to open an output file by use of a command such as EW or EB. ?NPA Negative or 0 argument to P A P command was preceded by a negative or 0 argument. ?NRO No room for output The output device is too full to accept the requested output file. ?NYI Not Yet Implemented A command was issued that is not yet implemented in this version of TECO. ?OFO Output file already open A command has been executed which tried to create an output file, but an output file currently is open. It is typically appropriate to use the EC or EK command as the situation calls for to close the output file. ?OUT Output error The system has reported an error attempting to do output to the output file. Make sure that output device did not become write locked. Use of the EF command (or EK if necessary) and another EW can be considered until the condition is fixed. ?PDO Push-down list overflow The command string has become too complex. Simplify it. ?POP Attempt to move Pointer Off Page with "x" A J, C or R command has been executed which attempted to move the pointer off the page. The result of executing one of these commands must leave the pointer between 0 and Z, inclusive. The characters referenced by a D or nA command must also be within the buffer boundary. ?SNI ; not in iteration A ; command has been executed outside of an open Standard TECO PAGE 320 Appendices iteration bracket. This command may only be executed within iteration brackets. ?SRH Search failure "text" A search command not preceded by a colon modifier and not within an iteration has failed to find the specified "text". After an S search fails the pointer is left at the beginning of the buffer. After an N or _ search fails the last page of the input file has been input and, in the case of N, output, and the buffer is cleared. In the case of an N search it is usually necessary to close the output file and reopen it for continued editing. ?STL String too long A search or file name string is too long. This is most likely the result of a missing ESCAPE after the string. ?UEA EA not implemented The EA command has no meaning in this version of TECO. ?UEI Edit Indirect not implemented The EI command has no meaning in this version of TECO. ?UEN Edit Next not implemented The EN command has no meaning in this version of TECO. ?UEP EP not implemented The EP command has no meaning in this version of TECO. ?UTC Unterminated command "x" This is a general error which is usually caused by an unterminated insert, search, or filespec argument, an unterminated ^A message, an unterminated tag or comment (i.e., unterminated ! construct), or a missing ' character which closes a conditional execution command. ?UTM Unterminated macro This error is the same as the ?UTC error except that the unterminated command was executing from a Q-register (i.e., it was a macro). (Note: An entire command sequence stored in a Q-register must be complete within the Q-register.) ?XAB Execution aborted Execution of TECO was aborted. This is usually due to the typing of . ?WLO System Device Write-Locked Standard TECO PAGE 321 Appendices TECO-8 needs to write on the system device when it is running in less than 16K (less than 20K if VT52 is present) so that it can later swap in overlays. ?YCA Y command aborted An attempt has been made to execute an Y or _ search command with an output file open, that would cause text in the text buffer to be erased without outputting it to the output file. The ED command (section 2.14) controls this check. ?nnn I/O Error or Directive Error (RSX-11 only) All errors from the executive and file system are reported in this format, where nnn is the decimal I/O or directive error status. The accompanying message is the corresponding message from the QIOSYM message file. A complete list of I/O and directive errors appears in Appendices to the various Executive reference manuals and in the IAS/RSX-11 I/O Operations Reference Manual. Standard TECO PAGE 322 Appendices GLOSSARY OF OBSCURE TECO TERMS Abort-on-error bit The 128's bit of the ET flag. If this bit is set, then TECO will abort execution on encountering an error (after printing the error message) and control returns to the operating system. This bit is initially set when TECO starts up, but is reset whenever TECO issues its prompt. One of several characters that TECO treats specially for use as a delimiter. Known as ESCAPE in more recent times, but traditional TECO users will still go on ending their command strings with "ALT" "ALT". Usually shown as $ in this manual. Anchored search A search (S) or search and replace (FS) command that is preceded by a ::. This indicates that the search must match the characters immediately following the current pointer position. If these characters do not match, no further searching is performed and the text buffer pointer does not move. Argument pair A command of the form m,n where m and n are numbers (or TECO commands that return numbers). When used before a command that normally acts on lines, the argument pair causes the command to work on characters. The characters specified by this argument pair is the set of characters between pointer positions m and n. The number m should normally be less than or equal to n. ASCII code The American Standard Code for Information Interchange. A code used by TECO to represent characters internally. Consult Appendix H for details. @-sign modified command A command that is preceded by an @-sign modifier. @-sign modifier An at-sign (@) that proceeds a command. It indicates to TECO that the search argument to the command is to delimited on both sides by a user-supplied delimiter rather than to be delimited only at the end by a TECO-designated delimiter (normally ). Automatic type-out The feature of TECO that causes lines of text to be automatically typed out. The ES flag may be used to control the automatic type-out of lines Standard TECO PAGE 323 Appendices after search commands, and the EV flag may be used to cause automatic type-out of lines after command execution. Auto-Trace Mode A mode that TECO goes into when the 4's bit of the EH (Help-level) flag is set. In this mode, TECO will automatically print out the erroneous command string after an error occurs. Backup Protection The process of preserving the user's original file (as a backup) when editing that file with the EB (Edit with Backup) command. Backwards searches A search that proceeds in the backwards direction. If the string being looked for does not occur at the current pointer position, the pointer position is moved back one character and the search is tried again. This continues until the string is found or until the boundary of the search has been reached or until the beginning of the current text buffer has been reached. Backward searches are initiated by using a negative argument to a search command or by using an argument pair m,n with m greater than n to an FB or FC command. Bounded searches A search command that requires searching only a portion of the text buffer. Of particular importance is the case where you only want to search the current line for a given string. Bounded searches are accomplished using the FB command. Case flagging A mode of TECO wherein, on type-out, it will flag alphabetic characters (in either upper or lower case) by preceding them with a single quote. Lower case flagging is particularly useful on terminals that do not display lower case. Case falgging is controlled by EU, the cae flag. Setting EU to 0 sets lower case flagging mode; setting EU to 1 sets upper case flagging mode, and setting EU to -1 removes all case flagging. Character-oriented editor An editor that allows modification of single characters, so that if just one character of a line is wrong, the entire line does not have to be retyped. TECO is a character-oriented editor. Colon-modified Command A command that is preceded by a colon (:) Standard TECO PAGE 324 Appendices modifier. Colon-modifier A colon preceding a TECO command, used to indicate that the action of the command is to change. Frequently indicates that the command is to return a value (-1 if the command succeeded, 0 if the command failed). Command line The current line of the command string that is being typed into TECO. Command string scope editing The feature of TECO that is enabled when editing is performed on a CRT terminal. In this mode, typing the immediate action command causes the character deleted from the command string to physically disappear from the screen. Other commands, such as also behave differently, taking best advantage of the properties of a video terminal. Command string The string of TECO commands that is currently being typed into TECO, or is currently being executed by TECO. Comment An informative message used within a TECO program, to make the code more readable. The comment explains the meaning and purpose of the associated TECO commands. The comment is enclosed in exclamation marks. Compile-class command A set of operating systems commands (such as COMPILE) that causes compilation (translation) of a source file written in a computer language into machine instructions. The EG$ command is useful to finish an editing session and re-execute the last compile-class command (normally a command that compiles the file that was just edited). Conditional A TECO language construct used to specify code to be conditionally executed depending upon the results of some test. The most general form of the TECO conditional is n"X | ' which tests the number n using condition X (See section 5.12 for details). The commands specified by the are executed if the condition succeeds, otherwise the commands specified by the are executed. Standard TECO PAGE 325 Appendices Control-character An ASCII character whose octal code is in the range 0-37. Usually denoted in this manual by where X is the character whose ASCII code is 100 (octal) greater thant he ASCII code for the control character being represented. TECO displays such a character as ^X (Caret-X) except for , , , , AND which have their normal display, and which is displayed as $ (dollar sign). Anytime a single control-character, is a valid TECO command, the two-character sequence, ^X, may be used instead. trapping A mode of operation wherein TECO will regain control (rather than the operating system) when or is typed on the user's terminal, to abort execution of the current command string. trapping is enabled by setting the high-order bit of the ET flag. Current character The character immediately following the current text buffer pointer position. Cursor A visible pattern on a CRT terminal (usually blinking) that would specify to a true scope editor (like VTEDIT) the current location of the text buffer pointer, or which would specify the location where subsequently typed characters would be displayed. Destructive search A form of global search in which pages of text that are passed over (because they did not contain the string being searched for) are discarded rather than writtent ot he output file. Destructive searches are initiated in TECO via use of the _ command. Display editor A true display editor is on which makes efficent use of a CRT terminal or display scope. Such an editor maintains a "window" into the text being edited. As characters are typed on the terminal, these characters immediately are entered into the text buffer and the window is immediately updated to reflect this change. With the help of some macro support, TECO can be made to be a true display editor. Dot A mnemonic for "the current text buffer pointer position". Stems from the fact that the . (dot, or period) TECO command returns this number as its Standard TECO PAGE 326 Appendices value. E Command One of several two-character TECO commands that start with the letter 'E'. Echo mode A normal mode of operation in which TECO will automatically echo (display) each character that is typed in response to a ^T command. Opposite of no-echo mode. This mode is controlled by the 8's bit of the ET flag. (0 means no-echo mode.) ED flag The edit level flag. Edit-class command A type of operating system command (such as MAKE and TECO) that specifies that file editing is to occur. Many operating systems remember the argument specified with the last Edit-class command, so that the next time an edit-class command is used without an argument, the previous argument can be recalled. Edit level flag A bit-encoded flag, referenced by the ED command, that describes how TECO should behave with reference to certain features. See section 5.14 for more details. Edit verify flag A flag that describes how TECO should act after processing of a command string. This flag can be set so that TECO will display the line just edited on the terminal after each command. See section 5.14 for more details. EH flag The help level flag. Either-case search mode A standard mode of operation in which alphabetic characters specified within a search string are permitted to match a corresponding character of either upper or lower case. Else-clause The part of a conditional command that is executed if the condition is not satisfied. In TECO,t hese are the commands that occur between the | and the ' characters within the conditional construct. End-of-file flag A read-only flag, referenced by the ^N command that specifies whether or not end-of-file has been seen on the currently selected input stream. A value of 0 means that end-of-file has not been seen; a value of -1 means that end-of-file has Standard TECO PAGE 327 Appendices beenr eached. This falg is initially 0 and is reset to 0 each time a new file is selected for input. EO level The current version level of TECO-10. ES flag The search verification flag. The character whose ASCII code is 33 (octal). It is a general-purpose delimiter used by TECO. Traditionally known as an . ET flag The terminal characteristics flag EU flag The upper/lower case flag. EV flag The edit verify flag. Exact-case search mode A mode of operation in which alphabetic characters within a search string must match the exact case (upper case or lower case) of character specified. Exit Protection A protective feature of TECO that prevents a user from exiting TECO if a potential los of data is imminent. The EX and EG commands are aborted (with the ?NFO error message) if there is text in the text buffer, but no output file is open. F Command One of several two-character TECO commands that start with the letter 'F'. Flag A data register used by TECO to control various modes of operation. The contets of the flag are set by specifying the new value before the flag name; and the contents are returned by using the flag name without a numeric argument. The TECO flags are: ^X, ^E, ^N, ED, EH, EO, ES, ET, EU, and EV. Flow command A TECO-11 command that is used to flow (branch) to a particular character. The current flow commands are F<, F>, F', and F|. Form feed flag A read-only flag, referenced by the ^E command that specifies whether the previous append from the input file terminated because of encountering a form feed character in the input file, or because the text buffer became nearly full. The value of this flag is automatically set to -1 by TECO if input is terminated by the presence of a form feed character in the input file. Standard TECO PAGE 328 Appendices Garbage collection A process used by TECO-10 to remove vestigial data from memory when more memory is required. Global search A type of search that continues through the entire input file until the specified characters are found. Successive pages of the file are read into the text buffer and then written out into the output file (if the strign is not located). Global searches in TECO are initiated via the N command. Hard-copy editing mode A mode of operation that TECO uses when the user's terminal is not a CRT. In this mode, when a character is rubbed out using the key, the rubbed-out character is re-typed on the terminal as a visible indication that this character was rubbed out. Opposite of scope editing mode. This mode can be entered, even on a scope terminal, by turning off the 2's bit of the ET flag. Help level flag A bit-encoded flag, referenced by the EH command, that controls properties of TECO having to do with error messages and user assistance. Immediate Action Command A special command to TECO that takes immediate effect, requiring no s to begin it's execution. Such commands are usually used to perform editing of the TECO command string currently being entered into TECO. For example, the commands and are immediate action commands. Immediate aid A type of immediate action command that must be typed as the first keystroke after TECO's prompt and provides assistance to the user. Examples of such aids are: ?, /, *q, , and . Iteration A language construct that permits a sequence of commands to be re-executed indefinitely or a given number of times. In TECO, this is accomplished by enclosing the commands in angle brackets. Kernel The TECO-11 kernel refers to the TECO-11 module that implements all those features of TECO-11 that are common to all PDP-11 operating systems. Operating system specific features and the interface to the operating system is accomplished by linking an I/O module tailored for the desired Standard TECO PAGE 329 Appendices operating system with the kernel. Keypad editor A true scope editor that uses special keys on the terminal (such as a VT52 or VT100) to control editing functions. VTEDIT is an example of a keypad editor. Line A portion of text delimited by , , , or the beginning or end of the text buffer. The final delimter is considered to be part of the line. Line-numbered file In TOPS-10, an ASCII file that contains line numnbers embedded in to the start of each line. TECO does not require these line numbers, but can handle them if they are present. They can also be generated or suppressed via the /GENLSN and /SUPLSN switches respectively. Line-oriented editor An editor that primarily uses line numbers to direct editing, and most of whose commands are line-oriented. TECO is a character-oriented editor but also has many commands that work on lines. Line-wrap mode A standard mode of TECO's window support wherein lines that are too long to fit on a single physical line of the user's terminal are automatically continued on the next line. Opposite of truncate mode. Literal Type-out mode A mode that TECO can be put into by setting the 1's bit in the ET flag. In this mode, any characters typed by a TECO program via use of one of the commands T, V, ^A, or :G, will be displayed on the user's terminal without any modification. When not in this mode, TECO will convert characters that normally do not print to a form that can be displayed on the user's terminal (e.g. displays as ^X and displays as $). literal type-out mode is particularly useful when trying to do real-time displays on a CRT terminal. Normal (up-arrow) mode is particularly useful to let you see what characters are really in your file. Log file An audit trail that TECO-10 can keep showing all the commands that were typed to TECO and/or all the type-out made by TECO. This is useful for reviewing what went wrong with a 'bad' edit. The Standard TECO PAGE 330 Appendices log file is initiated witht he EL command (see Appendix L). Macro The text portion of a Q-register, when it contains a TECO command string (subroutine) to be executed. Macro level Two commands within the same TECO macro are said to be at the same macro level. Mark Mode If I new what this mode was, I would have described it here. Match control construct A command, consisting of certain special characters, used within a search string to indicate to TECO that special groups of characters are permitted to match at this point. Memory Expansion TECO's act of acquiring additional storage from the operating system when te currently allocated storage is insufficient to handle the current TECO command. Typically, TECO will attempt to acquire this additional memory before it completely runs out of memory, so as to allow a 'buffer zone' for the user. This allows him to complete a few more commands even in the case where TECO is unable to get more memory. The informative message "[nK Bytes]" or its equivalent is printed onthe terminal informing the user that memory usage has expanded. Mung A recursive acronym for "Mung Until No Good"; an act applied by novice TECO users to their source files. MUNG Command An operating system command used to invoke a pre-written TECO program. The most general form of this command is "MUNG file,data" where "file" is the name of a TECO source program, and "data" is data to be passed to that program. Nest level Two TECO commands are said to be at the same nest level if one is not outside of a conditional that contains the other. No-echo mode A mode of operation in which TECO will not automatically echo (display) the character typed by the user in response to the ^T command. This mode is entered by setting the 8's bit of the ET flag. Opposite of echo mode. Standard TECO PAGE 331 Appendices Page A portion of text delimited by form feeds. The form feeds are not considered to be part of the page. Sometimes the term 'page' is used to refer to all the text currently in the text buffer. Panic Mode A condition that occurs (on small, single-user operating systems), when, in the middle of outputting during an edit, the output device fills up so that the I/O transfer cannot continue. TECO recovers gracefully from this condition by printing the ?FUL error message and returning control to TECO without any loss of data. At this point, the user closes the current output file and opens another one on another device (with more room) and resumes editing. At a subsequent time, the two parts of his file are concatenated back together. Pipeline editor An editor which only makes sequential edits to a file. The file to be edited is read into the text buffer one piece at a time. Each piece is edited and then written out. Once a piece has been written out, further editing to that piece is not possible unless the output file is re-opened in a later edit as a new file to be edited. TECO is a pipeline editor. Pointer preservation mode A mode of operation in which the text buffer pointer will not change after a failing search. This mode is controlled by the 16's bit of the ED flag. Primary input stream A term used by TECO-11 to refer to the main input file that TECO is using. Primary output stream A term used by TECO-11 to refer to the main output file that TECO is using. Prompt level A TECO command is said to be executed from prompt level if it is not executed from within a macro. That is, it was typed in directly in response to TECO's prompt. Q-register One of 36 special-purpose registers used by TECO. Each register can hold both a number and a string of text. Of particular importance is the ability to store TECO command strings in Q-registers to be used as 'subroutines'. Standard TECO PAGE 332 Appendices Q-register push down list A last-in first-out stack available to users for saving and restoring the contents of Q-registers. Read-with-no-wait mode A mode of operation in which the ^T command will not hang until a key is typed on the user's terminal. In this mode, if no key has been struck, TECO returns a -1 as the value of the ^T command. This mode is entered by setting the 32's bit of te ET flag. Search verification flag A flag, referenced by the ES command, that controls the action of TECO subsequent to the execution of a command string containg a search command. Proper setting of this flag will enable the user to verify that the search located the correct string, by having the line containing the string found displayed ont he terminal. See section 5.14 for more details. Search mode flag A flag, referenced by the ^X command, that controls how TECO treats alphabetical characters within search strings. This flag is used to put TECO into either exact-case mode, or either-case mode. If the ^X flag is set to 0, then either case matches in searches. If the ^X flag is set to 1,t hen exact case matches are required. Secondary input stream A term used by TECO-11 to refer to an auxiliary input "channel" that was formed by use of the EP command. See appendix L for details. Secondary output stream A term used by TECO-11 to refer to an auxiliary output "channel" that was formed by use of the EA command. See appendix L for details. Scope editing mode A mode of TECO in which command line scope editing (q.v.) algorithms are used. This mode is enabled by setting the 2's bit of the ET flag. It is usually automatically enabled by TECO if the operating system can detect that the user has invoked TECO from a scope terminal. Opposite of hard-copy editing mode. Split Q-registers The facit of TECO that permits storing of both a number and a string within a Q-register. Each Q-register can be considered to consist of two compartments. Standard TECO PAGE 333 Appendices String build construct A command, consisting of special characters, used within a text argument to build up the contents of the text argument from other components. SUPER TECO mode A mode of TECO-8 wherein TECO will read past the end-of-file mark (CTRL/Z) of a sequential ASCII file. This mode is enabled by using the /S switch on an ER, EW, or EB command and is terminated when an ER, EW, or EB command is issued with no /S switch. This mode is useful for scanning through mass storage devices in an attempt to recover data from files that had previously been deleted. Switch A construct of the form /SWITCH used within a command that takes a filespecification, to modify the action of the command or attributes of the file specified. Tag A label specified within exclamation marks to mark a point within a TECO program. Control can be transferred to this point by the use of a GOTO (Otag$) command. TECO Text Editor and COrrector program. TECO.INI A file containing TECO commands that is used as a user's private initialization file. When TECO starts up, it looks for such a file in the user's area, and if it finds one, the TECO commands in this file are executed before editing commences. TECO.TEC A TECO macro used by many operating systems to parse the user's edit-class commands. TECO I/O mode A mode of I/O operation under the RSX-11 operating system, in which the system buffers most characters and returns control to the caller (usually TECO) only when interesting characters (such as , , etc.) are typed. TECO's prompt refers to the asterisk (*) that TECO prints to indicate that it is ready to accept commands. TECO SIG A DECUS Special Interest Group, consisting of users who are dedicated to the spread of, improvement of, and standardization of TECO. Terminal characteristics flag A bit-encoded flag, referenced via the ET command, that contains information about the user's editing terminal and specifies in what modes TECO should Standard TECO PAGE 334 Appendices support it. Text buffer The main buffer used by TECO to hold the text to be edited. Text buffer pointer An imaginary pointer that marks the position within the text buffer where TECO is currently 'at'. This pointer always points to positions between characters; it never points at a character. The current character is considred to be the character immediately to the right of the current position of the text buffer pointer. Then-clause The set of commands within a conditional that are executed if the condition is satisfied. In TECO, these commands immediately follow the "X at the start of the conditional. They are terminated by a | or ' character. Tracing The act of watching the command-by-command execution of a TECO program. This is accomplished by putting TECO into trace mode, via use of the ? command. Trace mode A mode of TECO wherein each command that is executed by TECO is also displayed on the user's terminal as it is being executed. This mode is useful for debugging complicated TECO programs. TECO is toggled in and out of this mode via use of the ? command. See section 5.18 for more details. Truncate mode A mode of TECO's window support wherein lines that are too long to fit on a single physical line of the user's terminal are truncated when the right margin of the scope is encountered. This mode is entered by setting the 256's bit in the ET flag. Opposite of line-wrap mode. Type-out-time command A special command that makes sense only while TECO is typing out text on the terminal. These commands are , , and and affect the type-out. Consult the appropriate appendix to see what your operating system does if these commands are issued at a time when TECO is not typing out text. Up-arrow mode A standard mode of operation wherein upon type-out, TECO will display control characters by Standard TECO PAGE 335 Appendices typing the visible two-character sequence ^X to represent the control character . On many older terminals, the caret character (^), whose octal ASCII code is 136, prints as an up-arrow. Some control characters are excepted in up-arrow mode, notably , , , , and . Also, in this mode, the character is displayed as a dllar sign ($). Upper/lower case flag A flag, referenced by the EU command, that specifies whether or not case flagging is to occur. If set to -1, no case flagging occurs. If set to 0, lower case characters are flagged on typeout. If set to +1, upper case characters are flagged on typeout. View all mode A mode of window operation in which all characters have a distinctive visible display, including characters such as , , and , which normally do not display. War and Peace mode A mode of operation in which TECO outputs a large informative paragraph of information automatically upon encountering an error in a user's program. This paragraph of information describes the error in painstaking detail and tells the user how to recover. This mode is entered by setting the help level to 3. This mode is particularly useful to Novices and particularly obnoxious to experts. Window The portion of the text buffer that is currently being displayed on the user's terminal or auxiliary display device. Window support Assembly language code, built into TECO, that maintains a window into the text buffer on the user's terminal or auxiliary display device. Yank protection A feature of TECO wherein any Y, _, or F_ command that will potentially destroy valid data is aborted. This mode is normally enabled and will cause any of the aforementioned commands to abort with the ?YCA error message if there is text in the text buffer and an output file is open. This feature can be disabled by turning off the 2's bit in the ED flag. Standard TECO PAGE 336 Appendices APPENDIX N INDEX TO TECO COMMANDS AND SPECIAL CHARACTERS I001 ^A Output message to terminal . . . . . . . . . . 73 I002 ^B Current date . . . . . . . . . . . . . . . . . 106 I003 ^C Stop execution . . . . . . . . . . . . . . . . 53, 62 I004 ^D Set radix to decimal . . . . . . . . . . . . . 112 I005 ^E Form Feed flag . . . . . . . . . . . . . . . . 106 I005a ^EA (Match char) Match alphabetics . . . . . . . 88 I005c ^EC (Match char) Match Symbol Constituent . . . . 88 I005d ^ED (Match char) Match numerics . . . . . . . . . 88 I005g ^EGq (Match char) Match contents of Q-reg . . . . 88 I005l ^EL (Match char) Match line terminators . . . . . 88 I005q ^EQq (String char) Use contents of Q-reg q . . . 87 I005r ^ER (Match char) Match alphanumerics . . . . . . 88 I005s ^ES (Match char) Match non-null space/tab . . . . 88 I005v ^EV (Match char) Match lower case alphabetic . . 89 I005w ^EW (Match char) Match upper case alphabetic . . 89 I005x ^EX (Match char) Match any character . . . . . . 89 I006 ^F Contents of console switch register . . . . . 106 I007a ^G^G Kill command string . . . . . . . . . . . . 53 I007b ^G Retype current command line . . . . . . . 53 I007c ^G* Retype current command input . . . . . . . . 53 I010 ^H Current time of day . . . . . . . . . . . . . 106 I011 TAB Insert tab and text . . . . . . . . . . . . . 79 I012 LF Line terminator; Ignored in commands . . . . . 6 I013 VT Not a TECO command . . . . . . . . . . . . . . 336 I014 FF Page terminator; Output Form Feed . . . . . . 6 I015 CR Ignored in commands . . . . . . . . . . . . . 6 I016 ^N End of file flag . . . . . . . . . . . . . . . 107 I016s ^Nx (Match char) Match all but x . . . . . . . . 88 I017 ^O Set radix to octal . . . . . . . . . . . . . . 111 I017t ^O Kill terminal output . . . . . . . . . . . . . 75 I020 ^P Not a TECO command . . . . . . . . . . . . . . 336 I021o ^Q Convert line arg into character arg . . . . . 308, 312 I021s ^Qx (String char) Use x literally . . . . . . . . 86 I022 ^R Not a TECO command . . . . . . . . . . . . . . 336 I023 ^S -(length) of last referenced string . . . . . 107 I023s ^S (Match char) Match separator char . . . . . . 87 I024 ^T ASCII value of next character typed . . . . . 107 I024n n^T Output ASCII character of value n . . . . . . 73 I025 ^U Kill command line . . . . . . . . . . . . . . 53 I025 ^Uq Put string into Q-reg q . . . . . . . . . . . 90 I025n n^Uq Put ASCII char "n" into Q-reg q . . . . . . 90 I026s ^Vx (String char) Force x to lower case . . . . . 86 I027s ^Wx (String char) Force x to upper case . . . . . 87 I030 ^X Search mode flag . . . . . . . . . . . . . . . 116 I030s ^X (Match char) Match any character . . . . . . . 87 I031 ^Y Equivalent to ".+^S,." . . . . . . . . . . . . 107 I033 ESC String and command terminator . . . . . . . . 52 I034 ^\ Not a TECO command . . . . . . . . . . . . . . 336 Standard TECO PAGE 337 Appendices I035 ^] Not a TECO command . . . . . . . . . . . . . . 336 I036 ^^x ASCII value of x . . . . . . . . . . . . . . 107 I037 ^_ Ones complement (logical NOT) . . . . . . . . 110 I041 ! Define label . . . . . . . . . . . . . . . . . 95 I042 " Start conditional . . . . . . . . . . . . . . . 101 I042< n"< Test for less than zero . . . . . . . . . . . 102 I042> n"> Test for greater than zero . . . . . . . . . 102 I042a n"A Test for alphabetic . . . . . . . . . . . . . 102 I042c n"C Test for symbol constituent . . . . . . . . . 102 I042d n"D Test for numeric . . . . . . . . . . . . . . 102 I042e n"E Test for equal to zero . . . . . . . . . . . 102 I042f n"F Test for false . . . . . . . . . . . . . . . 102 I042g n"G Test for greater than zero . . . . . . . . . 102 I042l n"L Test for less than zero . . . . . . . . . . . 102 I042n n"N Test for not equal to zero . . . . . . . . . 102 I042r n"R Test for alphanumeric . . . . . . . . . . . . 102 I042s n"S Test for successful . . . . . . . . . . . . . 102 I042t n"T Test for true . . . . . . . . . . . . . . . . 102 I042u n"U Test for unsuccessful . . . . . . . . . . . . 102 I042v n"V Test for lower case . . . . . . . . . . . . . 102 I042w n"W Test for upper case . . . . . . . . . . . . . 102 I043 Logical OR . . . . . . . . . . . . . . . . . . . 110 I044 $ Not a TECO command . . . . . . . . . . . . . . 336 I045 n%q Add n to Q-reg q and return result . . . . . 91 I046 & Logical AND . . . . . . . . . . . . . . . . . . 110 I047 ' End conditional . . . . . . . . . . . . . . . . 101 I051 ( Expression grouping . . . . . . . . . . . . . . 108 I052 ) Expression grouping . . . . . . . . . . . . . . 108 I052 * Multiplication . . . . . . . . . . . . . . . . 110 I052q *q Put last command into Q-reg q . . . . . . . . 126 I053 + Addition . . . . . . . . . . . . . . . . . . . 110 I054 , Argument separator . . . . . . . . . . . . . . 108 I055 - Subtraction or negation . . . . . . . . . . . . 110 I056 . Current pointer position . . . . . . . . . . . 105 I057 / Division . . . . . . . . . . . . . . . . . . . 110 I060 0-9 Digit . . . . . . . . . . . . . . . . . . . . 336 I072 : Make next command return a value . . . . . . . 84 I072= ::= Type in octal, no carriage return . . . . . . 111 I072= := Type in decimal, no carriage return . . . . . 111 I072a :: Make next search a compare . . . . . . . . . . 84 I072a :A Append one line to buffer . . . . . . . . . . 68 I072g :Gq Type Q-reg q on terminal . . . . . . . . . . 93 I072q :Qq Size of test in Q-reg q . . . . . . . . . . . 105 I072u :^Uq Append string to Q-reg q . . . . . . . . . . 90 I072v n:^Uq Append ASCII char "n" to Q-reg q . . . . 91 I072x n:Xq Append n lines to Q-reg q . . . . . . . . . 92 I074 n< Iterate n times . . . . . . . . . . . . . . . 94 I075 = Type in decimal . . . . . . . . . . . . . . . . 111 I075a == Type in octal . . . . . . . . . . . . . . . . 111 I076 > End iteration . . . . . . . . . . . . . . . . . 94 I077 ? Toggle trace mode . . . . . . . . . . . . . . . 125 I077e ? Type command string up to error . . . . . . . . 229 I100 @ Use alternate string delimiters . . . . . . . . 58 I101 A Append to buffer . . . . . . . . . . . . . . . 68 I101n nA ASCII value of char in buffer . . . . . . . . 105 Standard TECO PAGE 338 Appendices I102 B 0 - beginning of buffer . . . . . . . . . . . . 105 I103 nC Advance n characters . . . . . . . . . . . . . 71 I104 nD Delete n characters . . . . . . . . . . . . . 76 I105a EA Select secondary output stream . . . . . . . . 64 I105b EB Open input and output . . . . . . . . . . . . 60 I105c EC Close out (copy in to out and close) . . . . . 62 I105d ED Edit mode flag . . . . . . . . . . . . . . . . 117 I105f EF Close output file . . . . . . . . . . . . . . 62 I105g EG Close out and exit with command . . . . . . . 62 I105h EH Help level flag . . . . . . . . . . . . . . . 118 I105i EI Open indirect command file . . . . . . . . . . 64 I105k EK Kill output file . . . . . . . . . . . . . . . 63 I105n EN Wildcard lookup . . . . . . . . . . . . . . . 66 I105o EO Version of TECO . . . . . . . . . . . . . . . 108 I105p EP Select secondary input stream . . . . . . . . 64 I105r ER Open input file . . . . . . . . . . . . . . . 60 I105s ES Search verification flag . . . . . . . . . . . 118 I105t ET Type out control flag . . . . . . . . . . . . 119 I105u EU Case flagging flag . . . . . . . . . . . . . . 120 I105v EV Edit verify flag . . . . . . . . . . . . . . . 121 I105w EW Open output file . . . . . . . . . . . . . . . 60 I105x EX Close out and exit . . . . . . . . . . . . . . 62 I106n nFN Glocal string replace . . . . . . . . . . . . 83 I106r FR Replace last string . . . . . . . . . . . . . 79 I106s nFS Local string replace . . . . . . . . . . . . 83 I106t m,nFS Bounded local string replace . . . . . . 83 I107 Gq Get string from Q-reg q into buffer . . . . . 92 I107* G* Get last filespec string into buffer . . . . . 307 I107_ G_ Get last search string into buffer . . . . . . 308 I110 H Equivalent to "B,Z" . . . . . . . . . . . . . . 105 I111 I Insert text . . . . . . . . . . . . . . . . . . 78 I111n nI Insert ASCII character "n" . . . . . . . . . . 78 I112 nJ Move pointer to "n" . . . . . . . . . . . . . 71 I113 nK Kill n lines . . . . . . . . . . . . . . . . . 77 I113a m,nK Delete between m and n . . . . . . . . . . . 77 I114 nL Advance n lines . . . . . . . . . . . . . . . 72 I115 Mq Execute string in Q-reg q . . . . . . . . . . 93 I116 nN Global search . . . . . . . . . . . . . . . . 81 I117 O Go to label . . . . . . . . . . . . . . . . . . 96 I120 nP Advance n pages . . . . . . . . . . . . . . . 69 I120a m,nP Write out chars m to n . . . . . . . . . . . 69 I120w nPW Write buffer n times . . . . . . . . . . . . 69 I120x m,nPW Write out chars m to n . . . . . . . . . 69 I121 Qq Number in Q-reg q . . . . . . . . . . . . . . 93 I122 nR Back up n characters . . . . . . . . . . . . . 72 I123 nS Local search . . . . . . . . . . . . . . . . . 81 I124 nT Type n lines . . . . . . . . . . . . . . . . . 73 I124a m,nT Type from m to n . . . . . . . . . . . . . . 73 I125 nUq Put number n into Q-reg q . . . . . . . . . . 91 I126 nV Type n current lines . . . . . . . . . . . . . 73 I127 W Scope "watch" . . . . . . . . . . . . . . . . . 122 I130 nXq Put n lines into Q-reg q . . . . . . . . . . 91 I130a m,nXq Put characters m to n into Q-reg q . . . 91 I131 Y Read into buffer . . . . . . . . . . . . . . . 68 I132 Z End of buffer value . . . . . . . . . . . . . . 105 Standard TECO PAGE 339 Appendices I133 [q Q-register push . . . . . . . . . . . . . . . 93 I134 \ Value of digit string in buffer . . . . . . . . 106 I134n n\ Convert n to digits in buffer . . . . . . . . 112 I135 ]q Q-register pop . . . . . . . . . . . . . . . . 92 I136c ^ Interpret next cmd char as CTRL char . . . . . 58 I136s ^x (String char) Use x as CTRL char . . . . . . . 86 I137 n_ Global search without output . . . . . . . . . 81 I140 ` Not a TECO command . . . . . . . . . . . . . . 336 I141 a-z Treated the same as upper case A-Z . . . . . 336 I173 { Not a TECO command . . . . . . . . . . . . . . 336 I174 | Not a TECO command . . . . . . . . . . . . . . 336 I175 } Not a TECO command . . . . . . . . . . . . . . 336 I176 ~ Not a TECO command . . . . . . . . . . . . . . 336 I177 DEL Delete last character typed in . . . . . . . 52 O0 Introduction . . . . . . . . . . . . . . . . . . . . 5 O1 Chapter I: Introductory Commands . . . . . . . . . . 6 O100 1.0 Fundamentals . . . . . . . . . . . . . . . . . 6 O101 1.1 File Selection Commands . . . . . . . . . . . 9 O102 1.2 Input and Output Commands . . . . . . . . . . 14 O103 5.3 Pointer Positioning Commands . . . . . . . . . 15 O104 1.4 Type Out Commands . . . . . . . . . . . . . . 16 O105 1.5 Text Modification Commands . . . . . . . . . . 18 O106 1.6 Search Commands . . . . . . . . . . . . . . . 19 O107 1.7 Summary . . . . . . . . . . . . . . . . . . . 20 O108 1.8 Sample Editing Job . . . . . . . . . . . . . . 21 O2 Chapter II: Complete Command Summary . . . . . . . . 57 O200 2.00 Teco Character Set . . . . . . . . . . . . . 57 O201 2.01 File Specification Commands . . . . . . . . . 59 O202 5.02 Page Manipulation Commands . . . . . . . . . 68 O203 5.03 Buffer Pointer Manipulation Commands . . . . 70 O204 5.04 Text Type-out Commands . . . . . . . . . . . 73 O205 5.05 Deletion Commands . . . . . . . . . . . . . . 76 O206 5.06 Insertion Commands . . . . . . . . . . . . . 78 O207 5.07 Search Commands . . . . . . . . . . . . . . . 80 O208 5.08 Search Arguments . . . . . . . . . . . . . . 86 O209 5.09 Q-registers . . . . . . . . . . . . . . . . . 90 O210 5.10 Command Loops . . . . . . . . . . . . . . . . 94 O211 5.11 Branching Commands . . . . . . . . . . . . . 95 O212 5.12 Conditional Execution Commands . . . . . . . 101 O213 5.13 Numeric Arguments . . . . . . . . . . . . . . 104 O214 5.14 Mode Control Flags . . . . . . . . . . . . . 116 O215 5.15 Scope Commands . . . . . . . . . . . . . . . 122 O216 5.16 Programming Aids . . . . . . . . . . . . . . 124 O217 7.7 Error Messages . . . . . . . . . . . . . . . . 229 O218 5.18 Manipulating Large Pages . . . . . . . . . . 129 O219 5.19 Techniques and Examples . . . . . . . . . . . 130 Oa Appendix A . . . . . . . . . . . . . . . . . . . . . 256 Ob Appendix B . . . . . . . . . . . . . . . . . . . . . 261 Oc Appendix C . . . . . . . . . . . . . . . . . . . . . 268 OD Appendix D . . . . . . . . . . . . . . . . . . . . . 276 Od Appendix F . . . . . . . . . . . . . . . . . . . . . 290 Oe Appendix M . . . . . . . . . . . . . . . . . . . . . 315 Of Appendix N . . . . . . . . . . . . . . . . . . . . . 336 Standard TECO PAGE 340 Appendices Ref Version 29 . . . . . . . . . . . . . . . . . . . 57, 108 Ref Version 32 . . . . . . . . . . . . . . . . . . . 1