HOW TO SETUP TECO TECO is an old editor and not well suited to today's environment yet there are things you can do with TECO that you can do with no other editor (or only with great difficulty). With the function key enhancements described below and a good macro library TECO becomes very usable. Some of the things that set TECO apart are its ability to edit any size file, do complicated repetitions (n), use of regular expressions and conditional execution. I've found the best way to set up TECO is to put TECO.EXE in my utility directory (which is in my path) and put all the indirect files (.TEC), including TECO.INI, in a separate directory say \TEC and put the following in the autoexec.bat file: APPEND /E APPEND C:\TEC This allows TECO to find the indirect files no matter what the current directory. If you want to edit a .TEC set up this way it is best to cd \TEC first since TECO won't know where to write the changed file (the MSDOS APPEND command is only good for reading). ** Note: Not documented elsewhere is the fact that you can get a printout of the file you're editing with EWprn$EC$$. Also, if you just want a printout of the text buffer you might try EWprn$PWEF$$. You need the EF to flush PCTECO's internal file buffer. Note that many *text* editors append a ^Z when closing the file, if you do not delete this ^Z the device output commands will choke since they are text file devices. Teco could care less about ^Z and does not append one. In this package you will find: README.1ST ! this file ! BETA.DOC ! defunct beta instructions ! TECO.EXE ! the executable written in TP 5.5 ! TECO.INI ! startup macro file ! MAKE.BAT ! batch file for the make function ! MUNG.BAT ! batch file for the mung function ! FLAGS.DOC ! documentation of TECO flags ! COMMANDS.DOC ! documentation of TECO commands ! REVISION.DOC ! revision history ! TECO.EXE The simplified command line for TECO is TECO [ [ filespec1 [ filespec2 ] ] | @filespec1 ] On startup TECO executes the following :ERTECO.INI$"S Y HXW HK MW HXW$$ which reads your TECO.INI init macro into the text buffer, if present, puts it into q-register W and executes it (mw) and releases the macro space (hxw). Also on startup TECO loads the Text Buffer with a macro to parse your command line, puts your command line in the FileSpec Register and then loads into the Command Buffer and executes the following HXY HKG* HXZ HK :EITECO$$ This puts the command line parsing macro in Q-register Y (HXY), clears the Text Buffer (HK), puts the contents of the FileSpec Register into the Text Buffer (G*), copies the Text Buffer into Q-register Z (HXZ), clears the Text Buffer (HK) and then executes, as an Indirect File, TECO.TEC if present in the default directory. It then executes MY$$ which parses your command line (if not null) which opens all requested files. (All $ symbols represent , of course). For example, if you just type (at the DOS prompt) >TECO it starts with no files open and you must explicitly use the EW, etc command to save anything you enter with the I or ^I command. Or you could use the ER and Y command to read in a file, modify it and then use the EW command to save it. (With an EX or EC, of course). Typing >TECO filespec1 is equivalent to typing at the DOS prompt >TECO *EBfilespec1$Y$$ (the * is TECO's prompt). If you type >TECO filespec1 filespec2 you get >TECO *ERfilespec1$EWfilespec2$Y$$ on the other hand >TECO @filespec1 is equivalent to >TECO *EIfilespec1$$ TECO.TEC The EI command is used to run indirect files as commands. If the file has the extension [.TEC] it need not be specified in the EI command so the TECO.TEC file would be run by *EIteco$$ except that this is a default name and is run automagically at startup. Remember, the EI command does not start execution of the the named file, the double does. So if your EI command is not at the end of a macro the sequencing you were expecting may not occur. No TECO.TEC file is supplied with this version of PCTECO. OTHER WAYS TO START TECO MAKE.BAT If you type >MAKE filespec1 this is equivalent to >TECO *EWfilespec1$ MUNG.BAT If you type >MUNG filespec1 a long text string with fewer than 9 spaces this is equivalent to >TECO *Ia long text string with fewer than 9 spaces$EIfilespec1$$ and I will leave it to your imagination on how to use this. (BTW, MUNG is an acronym for Mung Until No Good which is what will happen if your .TEC file isn't perfect). If you don't wish to use the batch files you may get the same result with: >TECO make filespec1 or >TECO mung filespec1 any spaced string but make and mung in these must be lower case. You may rename MAKE.BAT and MUNG.BAT to anything you like (incase, e.g., you are using MAKE for something else) or modify them to point to appropriate directories. I put MUNG.BAT and MAKE.BAT in my \BATCH directory which is also in the path. INITIAL SETUP AND TECO.INI FILE PCTECO has a special flag (EZ) not found in other incarnations of TECO. The purpose of this flag is to allow setting of certain MSDOS characteristics such as text color and display mode. (See FLAGS.DOC for a complete description). The supplied TECO.INI file sets this flag to suit my tastes. If you don't want these settings put TECO.INI where TECO can't find it or change it to your liking. THE PC KEYBOARD MACROS The following keyboard macros are explained in terms of their effective TECO action. [DArr] or [LF](^J) - LT [UArr] or [BS](^H) - -LT [PgDn] - nTnL (where n is number of lines on your screen-1) [PgUp] - -nLnT (see above for n) ^[Home] - J^A[^A.:=^A]^M^J^A (goes to beginning of text buffer and verifies we're at beginning [0]) ^[End] - ZJ^A[^A.:=^A]^M^J^A (goes to end of text buffer and prints number of chars in text buffer) [Home] - 0L [End] - L-2C [RArr] - C [LArr] - -C ^[RArr] - S^N^S$S^S$-S^N^S (goto end of next 'word', ES off) ^[LArr] - -S^S$-S^N^S (goto end of previous 'word', ES off) [DEL] - D NB: These macros are most useful with the EV and ES flag set so that you can see the effect of the action. If you don't wish to use these immediates it would be best if you turned off ev and es (0es0ev). The supplied init file (TECO.INI) makes EV show the tilde and the ES show the pipe/or symbol. Also note that these macros are spliced into the current command string (except [BS] and [LF]) so that constructs like e.g., j[PgDn] will work. These macros have a double escape at the end so they will only work at the end of a command string. FUNCTION KEYS You can define your own keyboard macros by loading the Q-registers. The function keys (F1 - F10) now execute macros stored in Q-registers 1-9,0, respectively. To use simply load your macros in the desired Q-register either manually or through an indirect file. When a function key is pressed TECO executes Mq$$ where q is in [0..9]. The supplied init file TECO.INI loads Q-register 1 with a macro to give dir *.* each time F1 is pressed. Well, this should get you started. I hope you have as much fun playing with the real, infamous, old and dangerous TECO again as I have had! It has all the features and all the dangers of the *original*. Of course, it goes without saying that if you trash your entire system by a single misplaced keystroke there will be no whining. This IS TECO afterall. BTW, don't forget the ? command. If you get an error message type ? immediately to see where in the command the problem occured. Also you can preceed any command or macro with a ? which activates the trace feature and can be quite helpful at times (and quite confusing at others). Have Fun! north@nosc.mil Mark H. North 1826 Galveston St. San Diego, CA 92110 Res: 619-275-3465 5pm to 7am PT Ofc: 619-553-6761 8am to 4pm PT If a catastrophic catastrophy occurs this version of TECO is programmed to remove all references to my identity from your disk and insert the current address of DECUS. 8^) No warrantees expressed or implied, etc blah blah. This is FREEWARE. Although I retain the copyright you may use or give away PCTECO. However, you may not sell it nor include it in any package for sale.