! Title: MODIFY.TES Last Edited: 2-MAR-91 rewritten for SQU 12-NOV-90 Jim Dempsey 22-APR-82 13:15:28 Created: 29-APR-80 ?? Copyright (c) 1982, 1990, an unpublished work by Network-Systems Design, Inc. Authors: Michael C. Bandy, James G. Dempsey Modified to run under OS/8. 4/82 -- MCB Modified to run under uTECO-86. 11/90 JGD ! !modify.tec! +0UL ! save list in buffer specified by entry arg ! @^A%Modify.tec Copyright (c) 1982, Network-Systems Design, Inc. Oshkosh, WI 54901 USA % 10W ! set display window height to 10 lines ! ! N.str - COMMAND TO GET NEXT FILE AND EXECUTE MODIFY CODE ! @^UN~ HK ! kill the buffer ! GL ! get the list ! J ! jump to first entry ! :@S%.%"F ! if entry not found (all entries have ".") ! @^A% End of the list; Here's the names of those files changed: % HK ! kill any trash (title lines etc) ! EK ! kill any pending output files ! XF ! kill residual list ! GC ! get the changed list ! J ! jump to front ! HT ! type out the list ! 0$^[ ! All done, exit macro with fail ! ' ! endif entry not found ! 0L ! go to front of line with "." ! @^A% File Name: % T ! display message and line with filespec ! @^UF%EK% ! build into F.str EK kill output file ! :@^UF%:EB% ! EK:EB eb to edit backup ! .,(^Q)-2:XF ! EK:EBfile.typ ! 27@:^UF%% ! EK:EBfile.typ$ ! ! F is built to open (re-open) file in list ! K ! kill out new entry ! HXL ! update list ! HK ! kill buffer ! MF"F F< ' ! iif open file fails restart N ! Y ! pull in first buffer ! MM ! perform edit Macro ! -1 ! exit with success unless M exits with .gt. 0 ! ~ ! O.str - COMMAND TO PUT THE CHANGED FILE OUT ! @^UO~ EC ! close output file ! G* ! get filspec buffer ! @I% % ! tack on a ! H:XC ! append to changed files list ! HK ! kill buffer ! MN ! go on to next file ! ~ ! Normal processing ! QL"E ! if list not already out there ! J ! start of buffer ! :@S~^M^J~"S ! if ! .-2,ZK ! kill to end of buffer ! J ! start of buffer again ! ' ! endif ! HX* ! put list name into filespec buffer ! HK ! kill buffer ! 1B ! switch to edit buffer 1 ! :::@ER%%"F ! if colon-anchored ER open fails ! 0B @^A%List not found % F> ! exit macro ! ' ! endif open fails ! Y ! fill the buffer ! | ! elseif list already out there ! 1B ! select buffer 1 ! ' ! endif (buffer 1 now has list) ! HXL ! put list into L.str ! 0B ! select buffer 0 ! HK ! kill buffer 0 ! HXC ! kill the changed list ! @I% Enter the Command to be done to each file. (will be stored in 'M') (end with Ctrl-Enter) % :@EI%gettext% ! get something that looks like a macro ! $ ! throw out delimiting char ! ^YXM ! copy macro to M ! HK ! kill buffer ! @^A% Note that the following registers are to be reserved: F -- File name of current file M -- Execution command -- Entered by user N -- Command to get next file and execute reg 'M' contents O -- Command to output buffer contents after changes L -- List of files to be modified C -- List of all files that have been output after changes When command stored in 'M', then type 'MN' to get first file -- if changes are to be saved type 'MO'. If not, typing 'MN' will clear buffer and the next file in the list will be brought in. %