This file contains informal notes about TECO-C. It includes bugs and ideas for improvements. The tecoc command, when used without the -c switch, doesn't create the files elegantly. It first complains about not being able to open the input file. The fix for this must be put into IniOpn. All system calls must correctly handle being interrupted by control-C. Page 228 of "Unix Programmer's Manual, Volume 1" talks about this a little. Each system call should check for errors, but should not treat control-Cs as an error. If type ^C while it's executing a macro, get "Operation completed under control-C" and a dollar sign! if you type a control-C while help is being displayed, you get two prompts Control-C works fine at command splits. Checks need to be inserted everywhere commands do loops on command arguments. For instance, 23p needs a check in the loop that calls singlep. Does ExeCtT do the right thing when it's read with no wait and the user types control-C? The ^EUq string build construct behaves differently than the TECO-11 algorithm for a special case: if the character in the q-register is a ^E. The command "5uas^EUA$" will search for ^E in TECO-11 and will fail in TECO-C. ZFrSrc exists only because I was playing with SCANC on a VAX. Delete the VAX-specific code and then merge what's left with BakSrc, using SIncrm in the loops. This is much cleaner. Local q-registers need to be tested further. When you do an HT or 500t, it pauses before starting output. Why? CBf, SBf, TBf, ZBf do not expand? Finish creation of TSTPW.TEC, a test case that demonstrates that ZWRITE mimics TECO-11 for all cases of the edit buffer/gap and all cases of line termination: FF, VT, CR/LF, $/CR/LF, and GapBeg and GapEnd. open SOFDEV.RNO for reading, do _glossary$v$$ and see junk. Also, do rt -r notes.rno and then y$$y$$ and see an extra blank line at the bottom of the buffer. DATE.TEC causes death TypBuf needs to buffer output before sending it In ChkMng and TmpEI, a 256-byte buffer is used. Is there a better size? Use TRNLNM instead of TRNLOG in ZINIT and ZEXEEI. Make a general-purpose logical name translation procedure to be used by both? If say "rt -p tstcss", then it exits. If say "MUNG tstcss", it doesn't. File COMMANDS.TXT has several "not implemented" lines that aren't right Add help text for E%q and EQq to hlp file. When doing a backwards search for a string, the whole string must be completely "before" the edit buffer gap for the search to succeed. In other words, if you are sitting in the middle of a string and do a backwards search for the string, you won't find it. This is not true in Teco-11. BldStr is used by commands other than search commands, yet it reports the "illegal search string" error sometimes. It looks like the error messages from TECO-11 aren't really correct. Need an error message like "illegal string build construct" or something. The error message "illegal ^E command in search string" would be better if it were "illegal ^E construct in search string" If you search for a string using a match control construct and the search fails, the "?SRH Search failure "xxx"" error message shows the match control construct with a <> surrounding it. TECO-11 does not. In Teco-11, the EG command uses the BldStr-like routine to build its string. Teco-c should call BldStr from ZExeEG. The macro system needs to be carefully checked. If do 8192ET, then a null command string with just two escapes won't "work". Need to hit three, and then get an error. Scan Appendix C of TECO-11 manual for goodies. In ZExeEI: 1. status != RMS$_NORMAL in ZRedEI does not error gracefully. 2. If find $$ in the middle of the read buffer, can't continue after executing the string. 3. EI buffer won't expand. 4. File closure on error on ^C ? ExeCSt was changed to do CBfPtr < CStEnd instead of CBfPtr <= CStEnd. Track and check. Why clear q-register stack in Zinit if it's been statically initialized in TECOC? Page 5 of TECO.LST shows ET and ED encodings. Compare/contrast In ExeFGt, if we're not in a loop, should behave as if we're . We're not doing that now. Put in If (MstTop) { CBfPtr = CStEnd; return(SUCCESS); } into the code before the first return(FAILURE). on the VAX, deal with disk quota overflow. Larry Kilgallen described the handling of this: when you get a disk quota exceeded, just issue the identical $PUT call again to exploit overdraft. This doesn't work for creating files. date and time (^B and ^H) commands work under VAX/VMS. They will work differently under other systems. Make a standard? say jz10v instead of zj10v and the two TECO's behave differently Normal TECO handles two numbers in a row differently than TECO-C does. TECO-C dies with a debugging message!!! use register variables use declaration of variables within blocks try use of () funnyness to see if can get away from using Execut see if type casts are superflous in places. C already does it? The September 1984 issue of Scientific American has an article by Niklaus Wirth that describes a fast searching algorithm. Use it? The entire ", ', <, >, O system should be checked. CmdMod should be checked. Is MovGap right? The W command is stubbed out now. For debugging, ExeW exists, SkpE skips over EG, EJ, EM, EN and EZ as if they were valid commands. the code for INCCBP and the other places where ++CBfPtr happens needs the MStTop test to be changed. Now, if a UTC should be reported, it's not. It returns SUCCESS! ExeO needs it's handling of CBfPtr to be fixed. There aren't checks against CStEnd, and the last "--CBfPtr" may be wrong. shouldn't CBfPtr be renamed CStPtr? It would relate better to CStBeg, CStEnd, etc. help subsystem works on VAX, won't on another machine ??? marks unfinished stuff. Get rid of them. Same with calls to ExeNYI. DoEvEs doesn't implement the ES flag exactly like the manual says DoEvEs has a system-dependent structure (UDummy) the free function is an int on the VAX, void on the SAGE standard input and standard output are not used to communicate with the terminal. UNIX people may expect that they are. This rules out using TECO-C in a pipe-oriented manner. Use DbgDCh instead of ZDspCh in ErrMsg for passed string displaying difference between EchoIt, TypChr, EchoIt, CharOut? COLON sounds like a character identifier. So does ATSIGN. ChrFuncs requires DefChars memory overflow 100000t skipping commands is NOT finished. In help, for errors, trace down the possible ways the code can print each error message. Some of them are unobvious. Give an explanation of all the ways an error can be generated to help a user figure out his error. change (blah == FAILURE) to (blah FAILED) Page 92 of the manual lists two informational messages. The 16 bit of the ET mode control flag suppresses informational messages. These messages are neither generated nor suppressed by TECO-C. Doing an "ERfilename$" puts the expanded filespec in the filespec buffer. Under TECO-11, doing a subsequent "ER$" to change I/O streams does not wipe out the filespec buffer. It does in TECO-C. For all the xxxBeg, xxxEnd, xxxPtr things, change all the comments to xxxBeg; /* first char of xxx buffer */ xxxEnd; /* last char of xxx buffer */ xxxPtr; /* last char of xxx, plus 1 */ check the MOBY MUNGER. It mentions lots of bugs in other TECOs. Some of the bugs are esoteric and quite possibly exist in TECO-C Is ZChrIt really necessary? nulls are not stripped from input. VAX TPU is able to read a file that is currently locked by another user, which is useful for looking at BATCH log files while a BATCH job is running. TECO-C can't. I looked at the microfiche code to see how TPU does it. It seems to try to open the file, and if it gets RMS$_FLK, then it tries to open the file again after setting the UPI bit in FAB$SHR. This means that it is supposed to do block I/O to the file. I couldn't find the place where actual file reading is done (it's in $fileio, which is in TPU$CAL_MODULE, which I couldn't find.) Does TPU do block I/O (section mapping?) The following commands are not yet implemented in TECO-C W video scope control ^Y equivalent to ".+^S,." EL open log file ^F return value in console switch register nEC control memory management The following commands are not implemented in TECO-C, and probably never will be, as they require operating system features that cannot be assumed by a portable TECO. EZ zero output tape EJ set or return environment characteristics EM position magnetic tape In addition, most of the commands defined in Appendix C of the manual (Incompatible, Obsolete and System-Specific Commands) are not implemented. 3. Error messages which include a a string argument, like ?SRH Search failure "text" where the string between quotes is the string that couldn't be found, are sensitive to the argument. If the string contains non-printing characters, they are output and can cause strange effects on the screen. Version 1.0 will do what the manual says (on page 3) and convert non-printing characters to readble form. 10. The ^R command (set or return radix) supports the 8, 10 and 16 radices. TECO-C parses command-line numeric arguments using the current radix. This can make command execution confusing for radix 16. Consider the command string "14A=$$", which returns the ascii value of the 14th character after the character pointer. If the radix is 16, the "A" is parsed as part of the number, and the ascii value of a completely different character will be returned. This is a trade-off. TECO-11 always parses command-line arguments using radix 10. This destroys TECO's utility as a calculator for hexadecimal. I believe access to a base 16 calculator is more important than possible user confusion. Thus, be careful if you want to change TECO's radix. Remember to change it back. Also note that if you use TECO-C as a hexadecimal calculator, you must preceed hexadecimal numbers which start with one of the letters A-F with a 0 in order to make TECO-C parse the number correctly. 12. You won't get "%Superseding file" messages. 13. The command buffer size is now a constant 10000 bytes. If you type in more than 10000 characters in a single command string, TECO-C will exit. This is the first thing that will change in the next version. Differences between TECO-C and TECO-11: EO returns 100+ s^n$ gives "invalid search argument", TECO-11 does nothing on ^Z^Z^Z, the third ^Z isn't echoed by TECO-11, but it is by TECO-C 8192ET is not documented in TECO-11 default directory is TECO$MACROS for EI command TECO-C won't allow HP or HPW when edit buffer is empty TECO-C supports q-register I/O commands E% and EQ, TECO-11 doesn't TECO-C does case sensitivity correctly, not with bit checking, so TECO-C does not consider "`","{","|","}" and "~" to be equivalent to "@","[","\","]" and "^", respectively. The -P, -Y, and -N commands, which are implemented in TECO-11 V39, are not yet implemented in TECO-C. TECO-11 supports switches on file name arguments to commands like ER, EB, etc. TECO-C does not. TECO-11 supports files with nonstandard record formats (like FORTRAN carriage control). TECO-C does not.