TECO News + TECO News + TECO News Paul D. Clayton I wish to welcome aboard Greg Steinkuhler as the new TECO co-ordinator for newsletter articles. If anyone has articles, questions or suggestions please contact Greg. It is felt that if the product groups have their own co-ordinator for newsletter articles, the published articles will be more valuable. Greg's address is shown below. Greg Steinkuhler 1118 Hickory Trail West Palm Beach, Florida 33411 --------------------------------------------------------------------- There has been some interest in a CRT based TECO editor for RSX-11 operating systems. As I was glancing over the directory for the Fall '80 DECUS RSX/IAS SIG tape I came accross an entry for such a program that appears to fit the bill. I make no guarantees about the program and suggest it as a possible solution to a problem. The cover for the user guide is shown below. The account number VTECO is under is [370,110]. The tape should be gotten from your local RSX/IAS LUG. Use in good health and let the rest of us know how it is. !!! A Full Screen Text Editor Based on TECO VTECO (Video TECO) A Full Screen Text Editor Based on TECO Bernstein and J.W.Lewis Corporate Research and Development Center General Electric Subject: A Full Screen Text Editor Based on TECO Introduction This document describes VTECO, an advanced CRT-based TEXT editor for RSX11M, RSX11M-PLUS, and VAX/VMS systems. The VTECO editor is a program, written in the TECO language, to create and modify files while working from a screen "window" into the file. It was derived from the DECUS RSX11M V34 TECO distribution. Additional editing functions were added (including a "help" key); the function key syntax was cleaned up; complete documentation was prepared; and support for other terminals was introduced. Currently, VTECO runs under RSX11M (V3.0-3.2), RSX11M-PLUS (V1.0), and VAX/VMS with DEC VT52 and VT100, Lear Siegler ADM-3A and ADM-42, InterTube III, and Datamedia Elite 1520A terminals. USERS GUIDE FOR VTECO + USERS GUIDE FOR VTECO + USERS GUIDE FOR VTECO 1.0 OVERVIEW Video TECO is a full screen text editor for CRT terminals. Various editing commands are provided via a set of function keys. No knowledge of TECO is necessary to use VTECO. All of the usual TECO facilities are available in addition to screen-oriented editing commands. The VTECO editor maintains an image of a portion of the file being edited on the CRT screen. After each editing command is performed, the screen is updated to reflect the changes made. Characters and lines can be inserted, deleted, and copied any place on the screen. Characters typed are inserted on the screen (and in the file) at the point preceding the cursor. Editing commands are performed by pressing the control key and striking one of the other keys. Commands include: character insert/delete, line insert/delete/pick/put, search, cursor motion left/down/up/right, and move to page top/bottom. Like standard TECO, Video TECO works on the file in segments called pages. If the file contains form-feeds, then the pages are delineated by form-feeds. If the file does not contain form feeds, then the pages are fixed length chunks. Pages are processed sequentially. Small files which will fit in memory are treated as one page. 2.0 USAGE The editor is invoked by the MCR commands: > OLD filename ; to edit an existing file > OLD * ; to edit file used in previous session > NEW filename ; to create a new file If the filename is omitted, VTEC will prompt for one. For example: > OLD File: filename VTECO understands two switches; they are: /RO -- Open a file for read only /DT[:type] -- specify terminal type The /RO switch is specified to read and display a file, but not change it. All editing functions appear to work normally in this mode, but upon terminating the editing session, the file's previous contents are restored. The /RO switch is also valid when changing a file from within VTECO with the command. Examples: >OLD filename/RO ; Open filename for read-only >OLD */RO ; Open the previously edited file for read-only access The /DT switch allows the user to specify the terminal type to be used for the editing session. By specifying the /DT switch with no argument, VTECO prompts the user for all known terminal types. The prompt is of the form, "Is your terminal a xxxxxxxxx?". The proper reply to this question is a single letter, Y or N. A return defaults to N. If the reply is negative, another such question is asked. This procedure is repeated until there are no more terminal types to try. When an affirmative answer is given, VTECO uses the specified terminal type and remembers the answer in the user's directory. The same terminal type is used for subsequent sessions unless overridden with the /DT switch. The /DT switch may also be given an argument, which is a 3-character code for the user's terminal type. Currently supported values are: /DT:V52 -- DEC VT52 /DT:V1H -- DEC VT100 in ANSI mode /DT:A42 -- Lear Siegler ADM-42 /DT:A3A -- Lear Siegler ADM-3A /DT:IVT -- InterTube III Video Terminal /DT:ELI -- Datamedia Elite 1520A Note that under RSX-11M version 3.2, VTECO attempts to determine the terminal type directly from the operating system. If the terminal type is unknown, the above procedure is invoked. In some installations, VTECO may be installed as the system standard editorinvoked by the command "EDIT". In this case, VTECO is invoked by one of the commands: > EDIT filename ; to edit an existing file > EDIT/CREATE filename ; to create a new file > EDIT * ; to edit the file used in the previous session > EDIT/TECO filename ; to edit using standard TECO > EDIT/MAKE filename ; to create a new file with standard TECO > EDIT/MUNG filename,argument ; to run a TECO macro > EDIT/EDI filename ; to edit a file using the EDI editor > EDIT/EDT filename ; to edit a file using the EDT editor > EDIT/SLP filespecs ; to edit a file using the SLP editor > EDIT/USING:editor filespecs ; to edit a file using a custom editor The system manager should be aware of which procedure is used on your system. If in doubt, simply type EDIT on a CRT terminal. If the "EDI>" prompt appears, then VTECO is invoked with the names OLD and NEW. After invoking VTECO, the first page of the file is automatically read into the TECO memory buffer and the first screenful of the file is written onto the CRT screen. At this point the terminal leaves MCR mode and enters Video TECO terminal mode. In VTECO mode, all control characters (and RUB) are interpreted as editor commands and all other characters are entered directly into the file. A picture of the control keys and their functions can be obtained by typing the command. The terminal remains in Video TECO mode until the ctrl(Z) command is typed. Then VTECO updates the file being edited and the terminal returns to MCR mode. 3.0 EDITOR COMMANDS: Cursor Motion The cursor is a graphical indication of the position of the TECO character pointer. Nearly all of the editing functions act on the characters at or near the current cursor position. The cursor can be moved left, down, up, or right by typing the labeled arrow keys on the keyboard to move as far as possible in any given direction (i.e., to the beginning of line, bottom of page, top of page, or end of line), type the ESC key before typing the cursor motion command. VTECO maintains an image of the text surrounding the current cursor position on the terminal screen. VTECO attempts to maintain a fixed line position for the cursor near the center of the screen. Up or down cursor motion causes the screen to scroll up or down. On terminals without full scrolling capability, the cursor will move up or down the full height of the screen. A scroll or rewrite will occur where necessary to keep the cursor on screen. If a cursor right motion off the right end of a line is attempted, the cursor will move to the start of the next line. If the line becomes too long for the screen, the image of the line will be split on the screen, with a "new line" character indicating the start of continuation lines. If motion off the left end of a line with the command is attempted, the cursor will move to the end of the previous line. To change the position of the cursor line on the screen (without moving the cursor relative to the text), the screen can be rewritten using the command. 4.0 EDITOR COMMANDS: Characters The simplest editor function is character insertion. Every nonfunction character typed is inserted just before the current cursor position. As in RSX11M MCR mode for CRTs, typing the RUB key deletes the character preceding the cursor. To remove characters at the current cursor position, type the command. 5.0 EDITOR COMMANDS: Lines Lines or groups of lines can be deleted (the command), inserted (the command), copied into the buffer (the command), and copied back into the file (the command). Any text deleted by the command is also saved in the buffer. All of these commands take a count argument which is entered by typing the ESC command key, then the numbers in the count, and finally the affected command key. For the , , and commands, the count indicates the number of lines affected. For the command, the count indicates the number of times the contents of the buffer is to be copied into the file. A zero or negative count to the command indicates that the contents of the buffer are to be copied into the file. When performing consecutive or commands, each new line is added to the buffer. Therefore, the user need not count the number of lines to operate on. Each command will cause the cursor to move down one line. Used in this fashion, the command sequence is equivalent to 3. NOTE Because the and buffers are maintained in CPU memory, both buffers are limited in size and large or commands (more than about a thousand characters) may lead to a VTECO "?memory overflow" error message and an exit from the VTECO macro to TECO. However, there is no cause for panic, because none of the file will be lost. Typing the four keys "M I ESC ESC" will restart VTECO (see the UNUSUAL CONDITIONS section). 6.0 EDITOR COMMANDS: Pages and Files VTECO works on the file in chunks called pages (which have nothing to do with terminal screen pages or file system pages). These pages are processed sequentially, so that the page stored in CPU memory is the only portion of the file which can be modified. To move to the next page in the file, type the command; to move to the first page of the file, type the command; to move to the last page of the file, type the command. Sometimes the page break may fall in an inconvenient location (like the middle of a paragraph). To force page breaks in particular locations, type the character ctrl/L to insert form feeds at those locations. Because the active TECO page is stored in CPU memory and NOT on the disk, it can be lost if the system crashes and it should be protected by typing the command occasionally (see the UNUSUAL CONDITIONS section). Note that the sequence is a save command, and returns the editor to the same position in the file. Several different files can be accessed in one VTECO session by using the command to move from one file to another. If the indicated file does not exist, then VTECO will ask the user if he wishes to create a new file with that name. To examine a file without changing it, append the switch "/RO" to the file name and the file will be processed in READ-ONLY mode. Both the and text buffers are preserved when VTECO moves from file to file so that a user can move or copy chunks of one file to other files. However, because these text buffers are stored in CPU memory, the number of characters involved in and commands is limited. Large and commands must be split into sequences of smaller ones. To leave VTECO, type the ctrl(Z) command. The current file will be written out, the name of the current file saved in the file "DEFFIL.TEC;1", and the current terminal type will be saved in the file "TTYPE.TEC;1". To execute a one-line MCR command after leaving VTECO, type the key. Then, after writing the current file out to disk, VTECO will display the prompt "MCR:" and the MCR command can be entered. This MCR command is saved in the file "MCRFIL.CMD;1". In subsequent VTECO sessions, if the command is terminated with no text (i.e. a second is entered immediately following the first) then this MCR command will be executed after VTECO exits. MCR command files are particularly useful for compiling and executing programs. 7.0 EDITOR COMMANDS: Using TECO (For TECO Hackers) Occasionally, some editing functions are best performed using the TECO editor directly. Short TECO command strings can be entered by typing the ESC key before typing the key. After the prompt string appears at the top of the screen, enter the TECO command and terminate it by typing the ESC key twice. VTECO remembers this command and executes it again every time the command key is typed. A number of TECO commands are useful. (In the following TECO commands the "$" indicates the ESC key. All other characters are to be taken literally.) To replace the next 10 instances of STRING1 in the current page with STRING2, enter 10$$ To define a user TECO command which will insert a string (or even a group of lines) the number of times given by a numeric argument, enter the user TECO command Q5$$ Then, every time the command is typed with a numeric argument, VTECO will insert STRING that many times. For a more extended TECO session, execution of the VTECO macro can be terminated by typing the ctrl(C) command. The terminal will then enter standard TECO mode. To return to VTECO, type the four keys M I ESC ESC. WARNING VTECO uses Q0-Q9, QA, and QI. Modifying these Q-registers will make re-entry to video TECO impossible. 8.0 Arguments to Editor Commands Some editing commands can take numeric arguments (usually a count of the number of times the function is to be performed). Noncontrol keys also can take a numeric argument (the character is inserted that many times). The numeric argument is entered BEFORE the function to be performed by typing the ESC command. To leave argument entry mode without performing an editing command, type the ESC key again. If the key is pressed and no numbers are typed, then the numeric argument is taken to be #0. In most cases this represents a special function. For example, with the cursor commands , , , and a 0 argument means: move to beginning-of-line, end-of-page, beginning-of-page, and end-of-line. Four commands (, , , and ) also take string arguments. After the prompt (e.g., "File: ") appears at the top of the screen, the desired string can be entered (terminated by , which is not considered part of the string). To leave string entry mode, type the ESC key twice. Any command which accepts a string argument, if given a numeric argument of 0, will force entry of a new string. For example, if a previous string search for the string "xyz" has been performed, the keystroke will cause a search for the same string. However, the sequence will cause a prompt for a new string. 9.0 Editor Commands (Commands marked by * take numeric arguments) Command Description Execute a user TECO string. (0 = enter new string) Enter a numeric argument to the following function key. * Remove characters at the current cursor position (0 = remove argument of last search) * Search forward in the current page for a character string. * Search forward in file for a character string. * Enter the next character into the text without interpretation. Move to beginning of file (0 = save). Move to end of file (0 = find mark). * Delete lines. (0 = delete to end). Also copies the lines into the text buffer. * Insert lines. * Copy lines into the buffer. Copy text from the buffer into the file (0 = copy text from the buffer). * Write out current page and get next page. * Rewrite terminal screen with cursor on indicated line. Write out the file and exit to MCR (0 = leave mark and exit). Perform a mcr command and exit if successful. Exit to TECO. Return to VTECO with M I ESC ESC. Edit another file (/ro = read-only). If the file does not exist, VTECO will create it on request. Print out the edit comands and summary on the screen.