KJ&3&g&ingxgizkx&uxoktzkj&zk~z&kjozux&.jui{sktzgzout/Zos&Igvvy"(x #>x"  wv  pT.protl on .ED - a character oriented text editor .hl 1 Introduction Once upon a time, there was the AM100.  This was before the days of the AM100/T even!  This was a nice little computer based on the WD16 CPU.  It had some rather nice software on it; most of which has been converted to the new 68000.  One of the programs which didn't get moved over to the new systems was EDIT.  EDIT was a "character oriented" text editor.  ED.LIT is EDIT for the new systems. Character-oriented text editors were originally designed to be used on non-CRT terminals.  Because these kinds of editors were designed to be used on hard copy terminals that do not permit fast display, the emphasis of such an editor is not on display, but on speed and power. Unfortunately, this also means that the user interface is a little cryptic.  The commands used to control ED (and editors like it) have been described as resembling "line noise" more than anything else.  One of the fun games we used to play in college was to try to figure out whose name would do the most interesting things when typed into the editor as a command string. Now that we have covered the bad side of ED, let's look at the good side.  It is a very powerful editor.  You can do things with ED which cannot be easily done with a screen oriented editor like AlphaVUE.  ED can also be used within a command file (or .DO file).  This leads to many interesting possibilities. Many editors of this type have existed through the years, and they are usually quite similar in operation and commands.  TECO is one of the predecessors to ED.  TECO is much larger, and much more powerful.  What we have in ED is a subset with some variations thrown in for good measure. For the remainder of this document, I have freely liberated portions of Alpha Micro's original EDIT documentation.  It seems that nobody has a copy of this anymore, so I am reviving it here. There are also some differences between ED and EDIT, so even if you remember how to use EDIT, it would be advisable to skim this document for the new stuff. .page 9 .hl 1 What really happens? When you edit a text file, ED brings a copy of the file into memory and allows you to make your editing changes to the copy in memory; then ED writes your changed file back out to the disk. ED maintains a pointer (called DOT) that points to your current position in the copy of the text file that is in memory.  Most commands that you give to ED reference this pointer to see what text to affect. .page 6 You do not see any of the text in memory unless you explicitly ask ED to display one or more lines of text.  You advance throughout the text in memory by using various commands to move DOT.  ED commands are one or two characters long, and some require arguments (eg: you follow the search command with a string of text for which to search). .hl 1 Editing a new file If you try to edit a file which does not exist, ED will create it for you. '.ED ABC.TXT (return) '[New file ABC.TXT] '* .hl 1 Editing an existing file You may use ED on any sequential file that contains ASCII characters.  To edit an existing file, type: '.ED filename (return) '* Where "filename" is the name of the file you want to edit.  The default extension is .M68.  After you press return, you see the ED prompt: *.  ED is now ready to accept commands.  DOT initially points to the first character in your file.  When you exit ED, the editor renames your original file to a .BAK extension, and saves your edited copy under the original file's name and extension. .hl 1 Really HUGE files On the AM100, you only had 32-48k of memory to work with.  This caused problems when editing files of any significant size, because you couldn't fit the whole thing into memory.  ED (and EDIT) was written with this in mind.  On the new systems, you will probably never run out of memory. If ED cannot load the entire file, it displays the number of free bytes remaining in memory when it comes up: '.ED HUGE.TXT '[2421 bytes free] '* When this happens, you will be editing the part in memory, and the rest remains on disk until you specifically access it with WHOLE file search or replace commands, or if you use the OUTPUT and APPEND commands. .hl 1 Special keys When entering text and commands to ED, you may use the RUB key (also labeled RUBOUT, DEL, DELETE, etc.) to erase single characters, and Control-U to erase an entire line of input.  ED itself has a group of commands that you must use to delete those characters and lines already part of the file you are editing. ED uses the Escape key (labeled on your keyboard as ESC, ALT MODE, etc.) rather than a RETURN as a command delimiter; this allows you to enter carriage returns as part of your text.  When you type an Escape to ED, you see the character displayed on your terminal as a dollar sign, $.  Whenever you see a $ in this document, the symbol indicates an Escape. Control-J moves DOT down one line, and displays that line. Control-K moves DOT up one line, and displays that line. Control-C is used to abort the processing of a command. .hl 1 Commands in general You may enter ED commands either in upper or lower case.  you may enter the commands one at a time, ending your input with two escapes.  For example: '*C$$ '* After the ED prompt symbol, *, we entered the Character advance command, "C", which moved DOT ahead in the file by one character position.  To tell ED that the command line was complete, we entered two escapes.  ED responds with another prompt to let us know that it is ready for another command. you may also enter commands as a group.  For example: '*LKT$$ The example above tells ED to move DOT to the beginning of the next (L)ine, (K)ill (delete) from DOT to the end of the current line, and (T)ype (display) the characters from DOT to the end of the current line. A line consists of all the characters between two carriage-return/linefeed pairs.  If you are moving DOT to the next line using "C" or "R" commands, remember to count the carriage return and linefeed at the end of each line. .page 4 Some commands take numeric arguments (eg: "3D" says delete the three characters after DOT); numeric arguments are decimal numbers, and always precede the command to which they apply. .page 19 If a command takes a text argument (eg: "Stext" says search for the word "text"), you must end the text with one or two Escapes. One Escape tells ED that the last command is complete, but that it may not yet take action upon the current input line.  Two Escapes tell ED to go ahead and act upon the current command line.  For example: '*IThe "I" command tells ED to insert text$10T$$ The command line begins with an Insert command, "I".  ED will insert into your text file (at the current DOT position) all text (including carriage returns) following the "I" command up to a single or a double Escape.  The single Escape above terminates the text entry string;  next is a display command, 10T, that tells ED to display the 10 lines of characters that occur after the current position of DOT.  The double Escapes tell ED to go ahead and act upon the entire string of commands.  you may enter as many lines of commands and text as you wish;  ED will not take action upon the input until you enter two Escapes. .hl 1 The ED commands Below is a complete list of the ED commands grouped by classification.  Remember, DOT is the pointer that marks your position in the file. .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 Displaying text .hl 3- "T" .......>.......|.......|.......|.......|.......|.......|.......|< 'TYPE - Displays the characters from DOT to the end of the 'line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nT" .......>.......|.......|.......|.......|.......|.......|.......|< 'TYPE - Displays "n" lines of characters starting from DOT. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "0T" .......>.......|.......|.......|.......|.......|.......|.......|< 'TYPE - Displays the characters from the beginning of the 'current line up to DOT. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-T" .......>.......|.......|.......|.......|.......|.......|.......|< 'TYPE - Displays the characters from the start of the 'previous line up to DOT. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-nT" .......>.......|.......|.......|.......|.......|.......|.......|< 'TYPE - Displays from the "nth" line behind DOT up to DOT. .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 DOT movement commands .page 3 .hl 3- "C" .......>.......|.......|.......|.......|.......|.......|.......|< 'CHARACTER ADVANCE - Moves DOT forward one character (eg: 'C$$) .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nC" .......>.......|.......|.......|.......|.......|.......|.......|< 'CHARACTER ADVANCE - Moves DOT forward by "n" characters '(eg: 3C$$) .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-nC" .......>.......|.......|.......|.......|.......|.......|.......|< 'CHARACTER ADVANCE - Moves DOT backward by "n" characters '(eg: -5C$$) .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "0C" .......>.......|.......|.......|.......|.......|.......|.......|< 'CHARACTER ADVANCE - Moves DOT backward to the beginning of 'the current line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "R" .......>.......|.......|.......|.......|.......|.......|.......|< 'REVERSE - Same as -C command. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nR" .......>.......|.......|.......|.......|.......|.......|.......|< 'REVERSE - Same as -nC command. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "0R" .......>.......|.......|.......|.......|.......|.......|.......|< 'REVERSE - Same as 0C command. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-R" .......>.......|.......|.......|.......|.......|.......|.......|< 'REVERSE - Same as C command. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-nR" .......>.......|.......|.......|.......|.......|.......|.......|< 'REVERSE - Same as nC command. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nJ" .......>.......|.......|.......|.......|.......|.......|.......|< 'JUMP - Jumps DOT immediately in front of the "nth" 'character in the data buffer. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "L" .......>.......|.......|.......|.......|.......|.......|.......|< 'LINE ADVANCE - Advances DOT to the beginning of the next 'line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nL" .......>.......|.......|.......|.......|.......|.......|.......|< 'LINE ADVANCE - Advances DOT forward "n" lines.  DOT is 'positioned at the start of the line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "0L" .......>.......|.......|.......|.......|.......|.......|.......|< 'LINE ADVANCE - Moves DOT back to the start of the current 'line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-L" .......>.......|.......|.......|.......|.......|.......|.......|< 'LINE ADVANCE - Moves DOT back to the start of the previous 'line. .page 4 .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-nL" .......>.......|.......|.......|.......|.......|.......|.......|< 'LINE ADVANCE - Moves DOT backward "n" lines from the 'current position of DOT, and positions DOT to the start of 'the line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "Linefeed (control-J)" .......>.......|.......|.......|.......|.......|.......|.......|< 'LINE ADVANCE AND TYPE - Typing a linefeed (control-J) 'performs the same function as LT$$, that is advances to 'the front of the next line, and displays that line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "Backspace (control-H, control-K)" .......>.......|.......|.......|.......|.......|.......|.......|< 'A backspace (control-H) or up-arrow (control-K) performs 'the same function as the -LT$$ command; that is, moves DOT 'back to the start of the previous line, and displays that 'line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "0J" .......>.......|.......|.......|.......|.......|.......|.......|< 'JUMP - Jumps DOT back to the beginning of the data buffer '(ie: back to the beginning of the portion of your file 'that is in memory). .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "ZJ" .......>.......|.......|.......|.......|.......|.......|.......|< 'JUMP - Jumps dot to the end of the buffer. .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 Inserting and Deleting text .hl 3- "Itext$" .......>.......|.......|.......|.......|.......|.......|.......|< 'INSERT - Inserts specified text into the file at the 'current position of DOT.  You may insert carriage returns 'and other special symbols except for those control 'characters discarded by AMOS in input (see SPECIAL INSERT 'below).  Remember that the text is not actually inserted 'until you type two Escapes.  For example: ...............>.......|.......|.......|.......|.......|....... /*IThis is all one /input;  all of the /characters, even the /carriage returns, can /be entered with one /insert command$$ /* .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nI" .......>.......|.......|.......|.......|.......|.......|.......|< 'SPECIAL INSERT - You may insert special control characters 'not usually accepted by ED, by preceding the I command 'with the decimal ASCII code of the character you want to 'insert (eg: 12I$$ inserts an ASCII character 12 - a 'form-feed). .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "D" .......>.......|.......|.......|.......|.......|.......|.......|< 'DELETE - Deletes the first character after DOT. .page 3 .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nD" .......>.......|.......|.......|.......|.......|.......|.......|< 'DELETE - Deletes the next "n" characters after DOT (eg: '3D$$) .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-D" .......>.......|.......|.......|.......|.......|.......|.......|< 'DELETE - Deletes the character just behind DOT (eg: -D$$) .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-nD" .......>.......|.......|.......|.......|.......|.......|.......|< 'DELETE - Deletes the previous "n" characters behind DOT '(eg: -20$$) .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "0D" .......>.......|.......|.......|.......|.......|.......|.......|< 'DELETE - Deletes characters from the beginning of the line 'up to DOT. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "HD" .......>.......|.......|.......|.......|.......|.......|.......|< 'DELETE - Deletes entire buffer; that is, deletes as much 'of the file as is in memory. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "K" .......>.......|.......|.......|.......|.......|.......|.......|< 'KILL - Kills (deletes) the characters from DOT to the end 'of the current line, including the carriage-return / 'linefeed pair at the end of the line. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nK" .......>.......|.......|.......|.......|.......|.......|.......|< 'KILL - Kills the next "n" lines of text past DOT. .......|.......|.......|.......|.......|.......|.....
.|.......|< .hl 3- "0K" .......>.......|.......|.......|.......|.......|.......|.......|< 'KILL - Kills from the beginning of the current line to 'DOT. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-K" .......>.......|.......|.......|.......|.......|.......|.......|< 'KILL - Kills from the beginning of the previous line to 'DOT. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "-nK" .......>.......|.......|.......|.......|.......|.......|.......|< 'KILL - Kills from the  start of the "nth" line behind DOT 'up to DOT itself. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "HK" .......>.......|.......|.......|.......|.......|.......|.......|< 'KILL - Kills the entire data buffer. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- ";text$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SEMICOLON INSERT - Performs the same function as the 'Itext$ command, except that a semicolon is placed at the 'start of the inserted text. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- ":text$" .......>.......|.......|.......|.......|.......|.......|.......|< 'COLON INSERT - Performs the same function as the Itext$ 'command, except that a colon is placed at the start of the 'inserted text. .page 4 .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "TABtext$" .......>.......|.......|.......|.......|.......|.......|.......|< 'TAB INSERT - Performs the same function as the Itext$ 'command, except that a tab character is placed at the 'start of the inserted text. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "SPACEtext$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SPACE INSERT - Performs the same function as the Itext$ 'command, except that a space is placed at the start of the 'inserted text. .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 Searching / Replacing text .hl 3 "Stext$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SEARCH - Searches the data buffer beginning with DOT for 'the first occurrence of "text"  Positions DOT just after '"text" if it finds it; otherwise it displays the message: '[Search failed], DOT is positioned to the front of the 'buffer, and the rest of the commands in the input string 'are aborted. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3 "nStext$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SEARCH - Same as Stext$, but ED searches for the "nth" 'occurrence of the search string "text". .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3 "S$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SEARCH - Same as Stext$ above, but ED uses the last search 'string entered. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3 "nS$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SEARCH - Same as nStext$, but uses the last search string 'entered. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3 "FSold$new$$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SEARCH AND REPLACE - Searches for "old" and replaces it 'with "new". .page 20 .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 Auxiliary buffers (Q-REGISTERS) .......>.......|.......|.......|.......|.......|.......|.......|< 'An auxiliary buffer is also known as a "Q-REGISTER" or '"Q-REG".  Auxiliary buffers are known as "scrap buffers" 'in other editors and word processors.  Usually, there is 'just one auxiliary buffer in an editor.  ED has 26; they 'are labeled A-Z.  These auxiliary buffers may contain more 'than one line of text. 'You can store arbitrarily large chunks of text for later 'use.  There is no specific limit on size, but you are 'limited by available memory. When you exit ED, the 'contents of the auxiliary buffers are lost.  No buffer 'will get cleared any other time unless you specifically 'store something new into it. 'Hint: If you have stored a massive amount of text in an 'auxiliary buffer, and you want that memory back, store a 'line with just a couple of characters on it.  This will 'replace the previous contents, and will release the 'memory. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "Xx" .......>.......|.......|.......|.......|.......|.......|.......|< 'SAVE - Saves, in auxiliary buffer "x", the characters from 'DOT to the end of the current line (x is a character from 'A-Z).  The previous contents of the auxiliary buffers are 'lost. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nXx" .......>.......|.......|.......|.......|.......|.......|.......|< 'SAVE - Saves "n" lines past DOT in auxiliary buffer "x". '(x is a character from A-Z). .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "Vx" .......>.......|.......|.......|.......|.......|.......|.......|< 'VERIFY - Verifies the contents of auxiliary buffer '"x".  x must be a character from A-Z.  Displays the 'contents of the specified buffer. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "Gx" .......>.......|.......|.......|.......|.......|.......|.......|< 'GET AUXILIARY - Gets auxiliary buffer "x". x must be a 'character from A-Z.  Inserts the buffer into the file at 'the current position of DOT.  DOT is moved forward the 'number of characters inserted. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "Mx" .......>.......|.......|.......|.......|.......|.......|.......|< 'EXECUTE Q-REG - Executes the contents of auxiliary buffer '"x" as ED commands. "x" must be a character from A-Z.  The 'trick with this one is to get ESC characters into the 'scrap buffer, as ED requires them when processing 'commands.  To do this, use the "nI" command when creating 'the text you are going to put into the buffer. .page 5 .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 Exiting from ED .hl 3- "E" .......>.......|.......|.......|.......|.......|.......|.......|< 'EXIT - Exit to monitor.  Outputs data buffer, and rest of 'the input file.  Renames original file to a .BAK 'extension, and saves the edited file under the original 'name and extension. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "EG" .......>.......|.......|.......|.......|.......|.......|.......|< 'EXIT AND GO - Exits to the monitor and processes the text 'file as is appropriate depending on the file's extension. 'An EG$$ command used on a .BAS file tells the monitor to 'COMPIL the program.  An EG$$ command on an .M68 file 'tells the monitor to M68 (assemble) that file.  Other 'extensions are supported also. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "EQ" .......>.......|.......|.......|.......|.......|.......|.......|< 'EXIT AND QUIT - Exits to the monitor, but doesn't make the 'editing changes you entered; the original file is left as 'is, untouched, and is not renamed to .BAK. .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 Commands for really HUGE files .hl 3- "A" .......>.......|.......|.......|.......|.......|.......|.......|< 'APPEND - Appends one or more records of the input file to 'the data buffer if there are at least 2000 free bytes of 'memory left, and DOT has not reached the end of file. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "O" .......>.......|.......|.......|.......|.......|.......|.......|< 'OUTPUT BUFFER TO DISK - Writes the current text in memory 'out to disk, leaving memory completely empty for more text 'to be entered, or more text to be loaded in from the input 'file with the (A)ppend command. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "Ntext$" .......>.......|.......|.......|.......|.......|.......|.......|< 'WHOLE FILE SEARCH - Searches the current data buffer, 'beginning at DOT, for the first occurrence of "text".  If 'the search within the current data buffer is not 'successful, ED writes that data buffer out to the disk, 'and brings in more text;  DOT is reset to the beginning of 'that buffer, and the search begins again.  This process 'continues until "text" is found, or until the end of the 'input file has been reached.  If "text" is found, DOT is 'positioned just after it;  if "text" is not found, ED 'displays an error message: [Search Failed], and any 'commands occurring in the input string after the search 'command are aborted. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nNtext$" .......>.......|.......|.......|.......|.......|.......|.......|< 'WHOLE FILE SEARCH - Same as above, except that search 'stops at the "nth" occurrence of "text" (eg: 10Nsilicon$). .page 4 .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "N$" .......>.......|.......|.......|.......|.......|.......|.......|< 'WHOLE FILE SEARCH - Same as Ntext$, except that it uses 'the last text string that you entered to a search command. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "nN$" .......>.......|.......|.......|.......|.......|.......|.......|< 'WHOLE FILE SEARCH - Same as nNtext$ except that the last 'search string entered is used. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "FNold$new$$" .......>.......|.......|.......|.......|.......|.......|.......|< 'SEARCH AND REPLACE - Same as FSold$new$$, but searches the 'entire file, rather on just the current data buffer. .......|.......|.......|.......|.......|.......|.......|.......|< .outline 2 Miscellaneous commands .hl 3- "F" .......>.......|.......|.......|.......|.......|.......|.......|< 'FREE MEMORY - Displays the number of free bytes left in 'your partition.  This command also displays other useful 'statistical information like the number of lines currently 'in memory. .page 15 .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "n<...>" .......>.......|.......|.......|.......|.......|.......|.......|< 'REPEATS - All of the commands within the angle brackets 'are repeated "n" times. Eg: 10<FSprimpt$print$>$$ tells ED 'to search for the word "primpt" and replace it with '"print" ten times.  All ED commands can be executed in a 'repeat, including other repeats.  The maximum nesting 'level for repeats is eight.  An error message and an abort 'occurs if you exceed the nesting limit;  search failures 'also abort repeats. 'If you omit "n", the group of commands repeat endlessly 'until an error occurs, or until a control-C is typed. 'Often used to replace ALL occurrences of an item (eg: '<FSregistrar$register$>$$). .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "#" .......>.......|.......|.......|.......|.......|.......|.......|< 'MODE - Display current mode settings. .......|.......|.......|.......|.......|.......|.......|.......|< .hl 3- "#x" .......>.......|.......|.......|.......|.......|.......|.......|< 'MODE - Specifies a change in the current mode settings. '"x" may be one of the following: ..........|...>|.......|.......|.......|.......|.......|.......|< *I - Upper / lower case IS NOT significant for search / .replace. *C - Upper / lower case IS significant for search / .replace. .......>.......|.......|.......|.......|.......|.......|.......|< .hl 3- "?" ..........|...>|.......|.......|.......|.......|.......|.......|< 'HELP - Display an abbreviated command list. .page 8 .......|.......|.......|.......|.......|.......|.......|.......|< .hl 1 Command files ED may be used from a command (or .DO) file.  To do this, you need to create a command file with ED commands in it.  As these commands must contain ESC characters, you have to be a bit tricky.  If you create the command file with ED (and why not?), use the special insert "27I" to insert an ESC at DOT. When you display a line in ED which contains an ESC, it will display as $. Here is a useful little command file called RIP.DO which searches any file, and displays every line which contains the specified string.  NOTE: As DO files use the dollar symbol in them, and we are using $ to represent the ESC character, we will use % instead of the dollar symbol for clarity. ':R 'ED %0 'H<S%1$0TT>$$EQ$$ To see all the print statements in a Basic program, you would type: RIP ABC.BAS PRINT Here is another version of the same command file which will display the line containing the search string, with the line above it.  Again, we use % to represent the dollar symbol. ':R 'ED %0 'H<S%1$-TT-99999KK>$$EQ$$ You might notice that this command file deletes huge chunks of text from the source file being scanned.  This is to solve the problem where a string is found on two lines in a row.  We don't want to see the first occurrence twice!  As we are quitting ED without saving (EQ), it is quite acceptable to seriously mangle the file while we are processing it.