File: MActec, Node: Top, Up: Macro HOW TO USE RSTS/E TECO INSTANT * Menu: * Make, - - - For creating a new ASCII file * Teco, - - - Access TECO to modify existing file * Exit, - - - Leaving Teco - the 'EX' command. * Entering And Leaving TECO:: * Inserting Text:: The 'I' command. * Deleting Text:: 'D' and 'K' commands: 'D' kills Characters while 'K' kills whole lines. LOOKING AT YOUR FILE * Type Out:: 'T' Command - helps to show pointer * Verification:: 'V' to verify the lines around your pointer * Whole type:: Types out entire file. Pointer unchanged. MOVING THROUGH FILE * Line Movement:: 'L' command * Character Movement:: 'C' command * Jump:: Move pointer to a numbered character position ZJ = Jump to end, 0J = Jump to start, 10j = jump to 10, etc. * Searching and Replacing:: The 'S', 'N', and 'FS' commands  Node: Entering and leaving Teco, Command to Create a 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. .MAC for MACRO-11 programs 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. 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. Page 7 Exit from TECO Normal Exit To exit from TECO and return to RSTS, 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 orginal file. In either case, this command is abolutely necessary in order to record your work in a permanent file. Change of Mind Exit In case you change your mind about your editing activity, 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 orginal file will remain unchanged in both content and extension name. COMMAND TO UPDATE AN EXISTING 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 repond with an asterisk (*) and wait for further instructions. At this point TECO will have 1) Open the file to be modified, 2) Place a copy of the file contents in the buffer area, 3) Builds a backup version of the original input file and store it under the filename and the extension .BAK. For the curious: (actually Teco Does not "build a backup file", but instead creates an empty file with the extension of your file, and when you exit TECO or use the "P" command it writes the new version of the file on it. It is only when you exit TECO that your old file is Renamed as a ".BAK" file. )  Node: Inserting Text, Up: Top, Prev: ENtering and leaving Teco, Next: Deleting Text The I Command (Insert) This command causes the specified string of characters to be inserted into the text buffer. The string is entered at the current position of the pointer, and the pointer is positioned immediately after the last character of the insertion. Command format: *Itext$ Where: I is the command character. text is the string of characters to be inserted into the buffer. Note that carriage return characters are also considered as part of 'text'. $ is a single escape () character to signify the end of the string to be inserted. In short, text between the character 'I' and the first escape character will be inserted. A second escape character will actually perform the insertion. Note that striking the escape key in TECO will cause the escape character.  Node: Deleting Text, uP: top, prev: inserting text, next: Type out The D Command (Delete) This command is used to delete CHARACTERS in the buffer. The specified number of characters preceding or following the current pointer position will be deleted. Command format: *nD Where n can be negative or positive. If n < 0, the n characters preceding the current pointer position are deleted. If n > 0, the n characters following the current pointer position are deleted. If n = 0, the command is ignored. Omitting n is equivalent to 1D and -D is equivalent to -1D. The K Command (Kill) This command is used to delete (kill) LINES in the buffer. Depending on the position of the pointer before this instruction is used, this command will delete partial and/or full line(s) in the buffer. Command format: *nK Where n can be negative, zero, or positive. If n < 0, the n lines preceding the current pointer position are deleted. If n = 0, the content of the buffer from the beginning of the line in which the pointer is located up to the pointer is deleted.  Node: Type Out, Up: top, Prev: deleting text, next: verification The T Command (Type) This command is used to type or print the contents of the text buffer starting from the current position up to and including the next line feed () character. The position of the pointer is left unchanged. Command format: *nT Where n can be negative, zero or positive: If n < 0, the n lines preceding the current pointer position are typed. If n = 0, text from the beginning of the line on which the pointer is located up the pointer is typed. If n > 0, the n lines following the current pointer position are typed. Omitting n is equivalent to 1T and -T is equivalent to -1T.  Node: Verification, Up: Top, Prev: Type Out, Next: Whole Type The V Command (Verify) This command will type out the entire line in which the pointer is located, regardless of the pointer position. It is a useful command to verify to current line. The pointer's position is left unchanged. Command format: *nV Where n, in this case, can only be a positive number. If n = 1, or omitted, it verifies the current line. If n > 1, the command will verify n-1 line(s) on each side of the current line.  Node: Whole Type, Up: Top, Prev: Verification, Next: Line Movement The HT Command (H means the wHole thing) Types out the entire content of the buffer regardless of the current position of the pointer. The pointer is left unchanged upon completion of the command. Command format: *HT  Node: Line Movement, Up: Top, Prev: Whole Type, Next: Character Movement The L Command (Line) Use this command to move the pointer to the beginning of the desired line. Command format: *nL Where n can be negative, zero, or positve. If n < 0, the pointer is moved backwards to the beginning of the nth complete line preceding its current position. If n = 0, the pointer is moved to the beginning of the line in which it is currently positioned. If n > 0, the pointer is advanced to the beginning of the nth line following its current position. Omitting n is equivalent to 1L and -L is equivalent to -1L.  Node: Character Movement, Up: Top, Prev: Line Movement, Next: Jump The C Command (Character) This command is used to move the pointer across characters. It is not limited to characters within a single line of text. Line boundaries, composed of carriage return and line feed characters, can be crossed with the C command. Command format: *nC Where n can be negative or positive. If n < 0, the pointer is moved backward across n characters. If n > 0, the pointer is moved forward across n characters. A value of zero for n will have no effect on the pointer position. Omitting n is equivalent to 1C and -C is equivalent to -1C.  Node: Searching and replacing, up: top, Prev: Jump If n > 0, the n lines following the current pointer position are deleted. Omitting n is equivalent to 1K and -K is equivalent to -1K. Page 10 The S Command (Search) This command is used to search for a string of characters starting from the current pointer position. If the string is found, the pointer is positioned after the last characters in 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 ('?SFH Search failure "string"'). Command format: *nStext$ Where n may be positive or negative If n < 0, it will search for the nth occurrence of the specific 'text' in the reverse direction. If n > 0, search for the nth occurrence of the specific 'text' in the forward direction. Values of 1 or -1 may be omitted. S is the command character. text is the string of characters to be searched for. The user must insure its uniqueness for successful searches. $ is a single escape character to signify the end of the string to be searched for. The FS Command (Search, if found, Replace) This command is a combination of several of the commands we have discussed so far. The FS command will search for a specified string of characters, once the string is found, the FS command will delete it and insert the indicated new text. Hence, the FS command is a combination of the S (search), D (delete), and I (insert) commands. Command format: *FStext1$text2$ Where: FS is the command. text1 is the string to be located and then deleted. Note the single escape character following it, which separates the first text string from the second text string. text2 is the string to be inserted in place of 'text1'. Again, a single escape character is necessary to delimit or signify the end of the string. If 'text2' is omitted, then the overall effect is find the string and delete it.  Page 11 SUMMARY OF TECO COMMANDS Command Format Result MAKE MAKE file.ext Creates a new ASCII file TECO TECO file.ext Access TECO to modify existing file EXIT EX Exit from TECO, closing all files INSERT Itext$ Insert 'text' into file TYPE nT Types out n line(s) before or after current pointer position. Pointer unchanged. VERIFY nV Verifies n-1 line(s) each side of current pointer position. Pointer unchanged. LINE nL Moves pointer between lines of text within the file. CHARACTER nC Moves pointer across characters within the file. JUMP J Moves pointer to position preceding the first character in the file. LAST JUMP ZJ Moves pointer to position after the last character in the file. WHOLE HT Types out entire file. Pointer unchanged. SEARCH nStext$ Searches for the nth occurrence of 'text' starting from current pointer position. If found, pointer is placed after 'text'. (Replace) SEARCH/ FStext1$text2$ Searches for 'text1'; deletes 'text1' and inserts 'text2' in its place. DELETE nD Deletes n characters before or after current pointer position. KILL nK Kills n lines before or after current pointer position.