[comp.sys.amiga] Rexx script for CED

laba-2kc@web-2c.berkeley.edu (Sang Yup Kim) (08/13/89)

Somebody a while ago was asking for Cygnus Ed/Rexx scripts.  Anyway, here's
one.  I've found it useful enough to actually install it on CED.  What it
does is to look for an error file in memory, parse it, and then kick up the
correct file and jump to right line number.  (Yes, I'm a JOVE user) So far,
it only works on Lattice C 5.02, but it shouldn't be to hard to modify for
anything else.

BUGS
CygnusEd doesn't know that a file has been overwritten.  As a result, if you
write to the error file (by recompiling or re-making), it will not know
that.  As a result, after each new compile, you should quit out of the error
buffer.

Again, send all suggestions/modifications to:
Na Choon Piaw, laba-2kc@web.berkeley.edu

------------------------------- cut here ------------------------------
/* Copyright 1989 by Na Choon Piaw */
/* Freely distributable provided this header remains intact. */
/* program to read Lattice C 5.02 error files, load in the correct
   files, and go to the right line number.  */
ErrFile = 't:CC.ERR'
/* trace ?R */
options results
save all changes
if ~exists(ErrFile) then
   do
       okay1 'Error file not found'
       exit 5
   end
status 66
nowin = result
do i = 1 to nowin
   status 19
   if result = Errfile then
      do
         delete line
         call Nextline
         exit 0
      end
   next view
end
do i = 1 to nowin - 1
   quit
end
split view
open ErrFile
do i = 1 to 4
   shrink view
end
call Nextline
exit 0

Nextline:
procedure
status 17
if result <= 1 then
   do
      okay1 'No more Errors!'
      quit
      exit
   end   
beg of file
status 55
/* trace ?R */
parse var result filename lineno errtype errnum ':' err
if upper(errtype) ~= 'ERROR' & upper(errtype) ~= 'WARNING' then
   /* irrelevant stuff */
   do
      delete line
      call Nextline
      return
   end
Next View
status 21
if upper(result) ~= upper(filename) then
   open filename
jump to line lineno
return