home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / programs / amiga / pastex / rexx / nexterror.ced < prev    next >
Text File  |  1991-07-26  |  1KB  |  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' "l."
  39.       found = RESULT
  40.       IF found THEN DO
  41.           'Right'
  42.           options results
  43.           'Status 55'        /* take the current line from CED */
  44.           parse var RESULT "l." number .
  45.       END
  46.  
  47. END
  48.  
  49. 'jump to file' "'"fullname"'"
  50. IF 0~= number & number > currentline THEN DO
  51.     jumpto number
  52.     beg of line
  53.     END
  54. ELSE DO
  55.     okay1 "No more errors."
  56. END
  57.  
  58.