-*-TAGS-*-  File: Teco1, Node: Top, Up: (DIR)Editors TECO - TEXT EDITOR FOR RSTS/E TECO (TExt editor and COrrector) is a powerful editing program available under RSTS/E. It may be used to edit any form of ASCII next such as source program listings, data files, manuscripts and the like. TECO is a character oriented editor as opposed to a line oriented editor, meaning the user can address ( or have access to ) individual characters within a line of text. * Menu: * TECO Fundamentals:: * Access to TECO:: * Exit from TECO:: * Command Types: (Tecomd)Commands * Documentation on Teco:: * Summary of TECO commands:: * BASIC-PLUS editing:: * Miscellaneous: (Tmisc)Miscellaneous Most of the above menu items are from the Computer Center introductory publication "HOW TO USE RSTS/E TECO". They discuss a subset of the language which is sufficient for most user editing requirements.  File: Teco1, Node: Teco Fundamentals, UP: Top, Next: Access to Teco * Menu: * Text Components:: Everything nice; that's what little files are made of. * Buffer:: Teco's Buffer * Pointer:: Teco's 'placeholder' (or bookmark) * Command Conventions:: * Words of Wisdom::  File: Teco1, Node: Text Components, UP: Teco Fundamentals, Next: Buffer TECO considers text to be any string of ASCII characters. Text is broken down into units of pages, lines, and characters. Most user files, a BASIC-PLUS program for instance, can be considered to be a single page under TECO. This page , which may consist of several thousand characters, is further broken down into lines. Each line of text will always contain a line feed () character which is the last character in a line in TECO. File: Teco1, Node: Buffer, UP: Teco Fundamentals, Prev: Text Components, Next: Pointer TECO is capable of creating text files. During creation, TECO maintains a text buffer or scratch area. The user will be constructing the buffer contents from the terminal. Upon normal termination, the buffer contents are transferred to a permanent file. Once files are created, updates can be made much in the same fashion. A copy of the user file is brought into the buffer and modifications will be made directly to the buffer contents. Furthermore, the buffer will normally hold one page which may be the entire user file. Upon normal termination, TECO will replace the original file with the updated buffer contents.  File: Teco1, Node: Pointer, UP: Teco Fundamentals, Prev: Buffer, Next: Command Conventions In order to traverse the buffer, TECO maintains an imaginary position indicator called the pointer. The pointer is subject to movement in the forward or backward direction via commands the user enters. When TECO is first invoked, the pointer is always positioned at the beginning of the buffer. At any one time the pointer will either be located between two characters, before the first character in the buffer, or after the last character in the buffer. In other words, the pointer is never positioned on a character, but rather before or after. Most editing commands can be thought of as being pointer-dependent. That is to say, TECO commands will always operate relative to the current pointer position in the buffer area.  File: Teco1, Node: Command Conventions, UP: Teco Fundamentals, Prev: Pointer, Next: Words of Wisdom A TECO command consists of one or more 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. * Menu: * Numeric Arguments:: * Textual Arguments:: * Line Termination:: * Command Execution::  File: Teco1, Node: Numeric arguments, Up: Command Conventions Next: Textual Arguments A numeric argument is simply an integer value which is used to indicate the number of times a command should be performed, i.e., to move n characters to the left or right, or to move n lines forward or backward. If a command requires a numeric argument, the numeric argument always precedes the command. File: Teco1, Node: Textual arguments, Up: Command Conventions Prev: Numeric arguments, Next: Line Termination A textual argument is a string of characters. If a command requires a text argument, the text or string of characters always follows the command. Such a text string is terminated or 'delimited' by a special character called the escape () or altmode character. Note, however, that striking the escape character will cause a dollar sign ($) to echo back to your terminal.  File: Teco1, Node: Line Termination, Up: Command Conventions Prev: Textual Arguments, Next: Command Execution In TECO, each line in the buffer is terminated or ended with the line feed () character. As text is entered into the buffer from the keyboard, the user ends each line by typing a carriage return (as usual). TECO converts this carriage return into the carriage return / line feed combination which includes the line feed character required by TECO to terminate a line of text.  File: Teco1, Node: Command Execution, Up: Command Conventions Prev: Line Termination To actually execute a TECO command, two consecutive escape characters must be typed. These will be echoed back as two consecutive dollar signs ($$).  File: Teco1, Node: Words of Wisdom, Up: Teco Fundamentals Prev: Command Conventions The new TECO user should read the text on each command very carefully. The explanations are concise and mean what they say. Additionally, before using TECO, the new user should try a few exercises to make sure of the operation of the command. As nearly all characters, including a wide variety of control characters, are actual TECO commands, the user should apply caution while typing in commands. Somewhat disastrous results may occur otherwise.  File: Teco1, Node: Access To Teco, Up: Top Prev: Teco Fundamentals, Next: Exit from Teco There are many different ways to access the TECO editor. For most normal editing requirements, there are two main choices : * Menu: * Creating a file:: * Updating an existing file::  File: Teco1, NODE: Creating a file, Up: Access To Teco Next: Updating an existing file This should be used only if you wish to generate a new file under RSTS/E. Anytime you see the prompt 'Ready', type the following command : MAKE filename.ext Where: MAKE is the CCL (Concise Command Language) to call TECO to create a new file. filename is the name of the file you wish to create. A filename is from 1 to 6 alphanumeric characters. ext is the 1 to 3 alphanumeric characters following the period. It is recommended that the appropriate or a meaningful extension be used, i.e. .BAS for BASIC-PLUS programs .TXT for text files .DAT for data files Note that this command will destroy any existing file with the same name and extension. An appropriate message informing you of the effect will be printed should this be the case. The actual deletion will not take place until you exit from TECO; therefore you may type two CONTROL-C's at this point to prevent the previous file from being destroyed. (See section IV.) TECO will now respond with an asterisk (*) and wait for further editing commands. The asterisk symbol is the prompt character TECO prints to indicate that it is ready to accept commands. At this point, the following has been set up by TECO: . A buffer area . An output filename ----------- | Buffer | ---------- | area |-----> | Output | | | | file | ----------- ---------- | ----------------- | User Terminal | ----------------- All of the user originated text will be accumulated in the buffer area during file creation. User interaction with TECO will be through this buffer area. Upon normal termination, the appropriate command will send all of the current buffer contents to the output file thereby creating a permanent file for later use. Note BASIC-PLUS users please see: "BASIC USERS COMMANDS"  File: Teco1, Node: Updating an existing file, Up: Access to Teco Prev: Creating a file In order to make changes to an existing file with TECO, enter the following command: TECO filename.ext Where: filename is a valid RSTS/E filename. ext is the file extension. It must be included. TECO will assume no extension if it is not specified. Once invoked, TECO will respond with an asterisk (*) and wait for further instructions. At this point TECO will have performed the following functions: . Open the file to be modified (input file). . Place a copy of the first page of the file contents in the buffer area. --------- ---------- ---------- | Input | | Buffer | | Output | | file |-----> | area |----> | file | -------- ---------- --------- | | ----------------- | User Terminal | ----------------- User commands to modify, add or delete text will be done in the buffer area. The original input file is kept intact. Upon normal termination of an editing session TECO will do the following: a. Transfer the buffer contents to a second file called the output file. b. Assign to this output file the same name as the original unedited input file. (Extension included) c. Keep the original input file in the user directory as a backup version changing its extension to .BAK. The above only takes place when the user requests to exit TECO. If for any reason an editing session is terminated without the normal exit command, the original input file is unchanged. The creation of the output file and the renaming effect of the extension to .BAK only occur after the appropriate exit command.  File: Teco1, Node: Exit From Teco, Up: Top, Prev: Access to teco, Next: (Tecomd)Commands A. Normal Exit To exit from TECO and return to RSTS/E, enter the following in response to the prompting asterisk: *EX$$ If you were creating a file for the first time, this command will transfer the buffer contents to the output file. If you were making changes to an existing file, this command will transfer the buffer contents to the output file and rename the original file. In either case, this command is absolutely necessary in order to record your work in a permanent file. B. Change of Mind Exit In case you change your mind about your editing activities, two CONTROL-C's may be typed to exit TECO. In this case, none of the editing changes (if any) will go into effect, that is, the original file will remain unchanged in both content and extension name.  File: Teco1, Node: Documentation on Teco, Up: Top, Prev: (Tecomd)Commands Next: Summary of Teco Commands WHERE TO OBTAIN MORE INFORMATION The commands presented in this publication by no means exhaust the numerous TECO commands. This selected set of commands is intended for the novice user. TECO as presented here in this publication is simple and easy to use. Once the limitations of these commands are encountered, it is recommended that the TECO user read the TECO-11 USER'S MANUAL. In this document, the true power of TECO becomes apparent. It is a highly versatile and complex editing tool that can be considered a programming language in its own right. In fact, the INFO program through which you are reading this is written in TECO. The TECO-11 Text Editor and Corrector for the PDP-11 User's Manual, Version 29, is an on-line document obtainable through your computer center. It is recommended that all TECO users purchase the TECO Pocket Guide AV-D530A-TK which is available from Digital Equipment Corporation or the local campus bookstore. This publication is an invaluable and inexpensive 'instant' reference. Additionally, the computer center has a limited supply of manuals for TECO Version 36, which is the current version of TECO (as of this writing).  File: Teco1, Node: Summary of TECO commands, Up: Top Previous: Documentation on Teco, Next: Basic-Plus Editing COMMAND SUMMARY Command Format Result MAKE MAKE file.ext Create a new ASCII file TECO TECO file.ext Access TECO to modify existing file. EXIT EX Exit TECO session, closing all files. Normal exit. INSERT Itext$ Inserts 'text' into buffer area TYPE nT Types out n line(s) before or after current pointer position. Pointer unchanged. VERIFY nV Verifies (prints) n-1 line(s) each side of current pointer position. Pointer unchanged. LINE nL Moves pointer between lines of text within the buffer. CHARACTER nC Moves pointer across characters within the buffer. JUMP J Moves pointer to position preceding first character in the buffer. ZJ ZJ Moves pointer to position after the last character in the buffer. HT HT Types out entire buffer contents. Pointer unchanged. DELETE nD Deletes n characters before or after current pointer position. KILL nK Kills n lines before or after current pointer position. SEARCH nStext$ Searches for the nth occurrence of 'text' in the forward or reverse direction starting from current pointer position. If found, pointer is placed after 'text'. SEARCH/ FStext1$text2$ Searches for 'text1', deletes REPLACE 'text1' and inserts 'text2' in its place.  File: Teco1, Node: BASIC-PLUS editing, Up: Top Prev: Summary of Teco Commands Access to TECO differs for BASIC-PLUS users depending on the line continuation convention. a. Ampersand/Carriage Return line continuation In EXTEND mode, the preferred continuation of a statement is performed by typing an ampersand followed by a carriage return, ( & ). When in BASIC-PLUS, readibility can be improved by tabbing the ampersand/carriage return combination over to the right margin. This lines up the ampersands. Access to TECO using this line continuation convention is simply: MAKE filename.ext TECO filename.ext or if you wish TECO to line up the ampersands in column 72, for example, the access would be: MAKE filename.ext /72 TECO filename.ext /72 b. Line Feed line continuation In NO EXTEND mode, statements are continued on the next line by typing a line feed, (), at the end of the line. This actually performs a line feed/carriage return operation. The appropriate access to TECO for this line continuation convention is : MAKE filename.ext / TECO filename.ext / The effect of the switch (slash) is that on input of the line feed, (), TECO will automatically insert a carriage return preceding the line feed.  File: Teco1, Node: Credit Compiled by: Wigberto Yu Computer Center Academic Applications California State University, Northridge Northridge, California June 1979 Converted to INFO format: October 1981 by Michael Bloom  TAGS: :SGAT Top:17 Teco Fundamentals:939 Text Components:1235 Buffer:1770 Pointer:2551 Command Conventions:3432 Numeric arguments:3869 Textual arguments:4293 Line Termination:4822 Command Execution:5347 Words of Wisdom:5609 Access To Teco:6197 Creating a file:6498 Updating an existing file:8619 Exit From Teco:10411 Documentation on Teco:11350 Summary of TECO commands:12711 BASIC-PLUS editing:14237 Credit:15631