RED - Richard's EDitor This was my first editor, written in CS2. This was a time before screen editors and Visual 200s: the choice was between Textronices or Bantams! On VAX was Paul McLellan's line ECCE, and this was generally regarded as a paragon of virtue, and was much better than any of the other versions of ECCE that existed (still is, for a lot of us). Why is it so good? It is very clean, regular consitent and adaptable. So why write RED? Curiosity mainly, and a feeling of being able to do better, particularly with control characters where it is still the best. At the time it made quite a stir, and a lot of features grudgingly added to VECCE can be traced to RED and the other Undergraduate Editors (FLOSSIE, which was reimplemented as IE, and BED). It is now up on the APM: type RMM:RED on BET to run it. It has been adapted to use PAM for parameters. It took about 1.5 hours to port, including restoring sections written in VAX in line assembler to Imp, adding PAM, and removing VAX file name conventions. Try porting VECCE in that time! Some other people involved: George Ross wrote the in-line assembler acceleration for the Move and Find commands. Peter Martin (now a freelance business micro consulant) wrote the copious user documentation (still on Archive). Mark Taunton (now working for Acorn) wrote some extra routines for file access on VAX. RED QUICK SHEET: Random extensions: All commands can be "negativised". As an alternative to * and -* these can be replaced with < > respectively. String parameters to commands can take the form of a list of ASCII values enclosed in square brackers: I [27, 23, 5] In addition to the ',' command, an underline is in effect a %exit from a set of brackets: very useful with commas and programming. Extra edit commands: A - Abstract Copies from the Noted Position into the Copy Buffer, works in both directions. H - Here Copies the contents of the Copy Buffer into the main buffer at the current position. N - Note Set the Noted Position at the current cursor position. The is indicated during printing by the presence of the Noted Marker. O - Over This finnaly made full status in VECCE after a long struggle. First appearance was in RED! Used like I. W - Wobble This command "wobbles" the cursor backwards and forwards character by character. In otherwords, W moves forward one character, including New Lines, and W- moves backwards. If the whole file is to be processed on a character-by-character basis this is a very useful command. Q - Q Register Operations. Q Registers are a set of 10 (0 to 9) integer variables. These can be used wherever a repeat count can be used, with the form $1 for register one. For example R$1 moves right by the contents of Q register 1. The Q command itself has the form: Q can be 0 to 9, or one of the special values ^ %, as for can be any valid RED repeat count, or one of the following special values: ^ - the buffer. When used as a value it means "the next character", when used as a register it means "insert". Can only be used with '='. % - the terminal. When used as a value it means read a character from the terminal, as a register it means output the repeat count as a character. Can only be used with '='. < - the number of characters to the left of the cursor on the current line. > - the number of characters to the right of the cursor on the current line. 'ch - this is the ASCII value for the character. Not that there is no closing quote. can be one of the following: = - assignment + - add to register - - subtract from register * - multiple / - integer divide < - less than > - greater than # - not equal to : - equal to The normal comand success qualifiers can be used, so to make Greater Than Or Equal to use: Q1<12\ for Register 1 >= 12. An example: q1=' ( q^=$1 q1+1 q1>'~\ )0 Inserts all the printable ASCII characters In the past Q registers have been used to implement a mini-screen editor, a peruse program, and a case flipper for Imp which left comments and strings untouched. I'll bet you didn't think you could parse Imp in ECCE!!! Special commands: Here Red goes wild! SetShow means that the command will show the current value if given no parameter, but sets it if given one. If a value is given it will always be preceeded by an equals. File means that the command must be followed by =file. %A - Abandon Edit %B - Backup %C - Close %D - Destination SetShow - default as on command line This changes the value of the output file name. %E - End Marker SetShow - default ** end ** This changes the value of the mark printed at the end of the file. %F - obey File File This is used to obey RED command files, very useful for setting up complex macros, or setting some of these millions of options. If a file RED_PROFILE exists in the current directory, this is "obeyed" at the start of the edit. An extra feature of this command is that it can control monitoring for duration of the obeying. The form is like %F2=file, where this enables full monitoring. The default is 0 for quiet. %G - Get Prompt SetShow - deafult : This modifies the value of the get prompt. %H - Here SetShow - default ** noted ** This modifies the value of the Noted Marker. %I - Input to copy buffer File Reads a file into the copy buffer. %J - Jack It In %K - Keyboard Toggle - default OFF Control characters are printed as their key names: <^L>. %L - Literal Toggle - default OFF Control characters are printed "literally" ie with no interpretion. Only useful if you are typing in escape sequences to a file! %M - case Matters Toggle - default OFF Toggles whether the Find related commands take case into account on matching. %N - Numerical Toggle - default OFF Prints control characters as their ASCII code: <13> for a Carriage Return. %O - Output Copy Buffer File Outputs the contents of the copy buffer to the given file. %P - Prompt SetShow - default > This changes the command prompt. %Q - Quit %R - Ranges This command is used to modify the default ranges on ranged commands. For example the F command normally has a find range of *, but D only has 1. This command changes that. It also changes the default repeat value for other commands, for example P could be set to always print 24 lines. Examples of its use are as follows: %RP=23 ! sets the default repeat on Print to 23. %RF ! shows the default range for Find. %S - Status Prints the status of all the options. %T - Termination SetShow - default : This is the character that terminates a get when it is the first thing on the line. %U - Unbounded lines Toggle - default OFF This allows Find, Insert etc to handle new lines. For short strings I can be used instead of G. %V - Version This prints the current version number of the editor. %W - Where SetShow - default ^ This sets or shows the cursor string. Try setting it to null! %0 - No Monitoring %1 - Normal Monitoring %2 - Full Monitoring #B - Begining Marker SetShow - default none To be symetrical it is possible to have a marker printed out at the begining of the file as well as the end. #C - Case Marking Toggle - default OFF For use on upper case onlt terminals - try it! #L - Line Numbered Toggle - default OFF The line number of each line is given for P. #Q - Q Register dump Prints the value of all the Q Registers.