home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / TeX / rexx / nexterror.ced < prev    next >
Encoding:
Text File  |  1978-03-06  |  1.1 KB  |  58 lines

  1. /*RX    Skip to next TeX-error                        */
  2. /*     Idea: Take the filename and line-number of the current view,    */
  3. /*    replace .tex with .log. Go the the logfile and search the first    */
  4. /*    ^Jl. with a number greater than the current line number.    */
  5. /*                                    */
  6. /*    Georg Hessmann    (hes)    26-jul-91                */
  7.  
  8. options results
  9.  
  10. trace all
  11.  
  12. status 19    /* full filename */
  13. fullname=RESULT
  14.  
  15. basename = LEFT(fullname, LENGTH(fullname)-4)
  16. extension = translate(RIGHT(fullname, 4) , xrange('a','z'), xrange('A','Z'))
  17.  
  18. IF extension ~= ".tex" THEN DO
  19.     okay1 "I need a '.tex' file!"
  20.     exit 5
  21. END
  22.  
  23. logname = basename".log"
  24.  
  25. status 47
  26. currentline = RESULT+1
  27.  
  28. 'jump to file' "'"logname"'"
  29. IF 0 = RESULT THEN DO
  30.     open new
  31.     open '"'logname'"'
  32.     END
  33. 'beg of file'
  34.  
  35. number = 0
  36. found = 1
  37. DO WHILE(found & number <= currentline)
  38.       'Search for' "
  39. l."
  40.       found = RESULT
  41.       IF found THEN DO
  42.           'Right'
  43.           options results
  44.           'Status 55'        /* take the current line from CED */
  45.           parse var RESULT "l." number .
  46.       END
  47.  
  48. END
  49.  
  50. 'jump to file' "'"fullname"'"
  51. IF 0~= number & number > currentline THEN DO
  52.     jumpto number
  53.     beg of line
  54.     END
  55. ELSE DO
  56.     okay1 "No more errors."
  57. END
  58.  
  59.