home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 531.lha / TurboText_Utils / FindDoc / NextAztecError.ttx < prev    next >
Encoding:
Text File  |  1991-07-04  |  1.2 KB  |  51 lines

  1. /* Get Next Error -- for Aztec C "Quick Fix" mode */
  2.  
  3. options results
  4.  
  5. /* look for a buffer named "AztecC.Err */
  6.  
  7. GetPort name AztecC.Err
  8. errport = RESULT
  9. if RC > 0 then do
  10.     say "Can't find error file!"
  11.     address command "Wait 6"
  12.     exit
  13. end
  14.  
  15. /* say 'errport = ' errport */
  16.  
  17. address value errport                    /* go the the AztecC.Err port */
  18. MoveDown                                /* move cursor down */
  19. GetLine                                    /* get the current line */
  20. errtext = RESULT                        /* the AztecC.err line */
  21.  
  22. if LENGTH(errtext) <= 0 then exit        /* if a NULL line, the do nothing... */
  23.  
  24. /* Umm, need to insert a check for line number... */
  25.  
  26. Parse var errtext errfile '>' errline ':' errcol ':' errtype ':' errnum ':' errdesc
  27.  
  28. GetPort name errfile
  29. fileport = RESULT
  30.  
  31. if (RC > 0) then do                        /* If the source file was not found... */
  32.     OpenDoc name errfile                /* Open a new window                */
  33.     fileport = RESULT                    /* get the port                        */
  34.     if RC > 0 then do                    /* if not there, then error            */
  35.         say "Couldn't open source file!"
  36.         address command "Wait 6"
  37.         exit
  38.         end
  39.     end
  40.  
  41. /* need to print the error line in the title bar... */
  42.  
  43. address value fileport
  44. IconifyWindow OFF
  45. Window2front
  46. ActivateWindow
  47. SetStatusBar errdesc
  48. Move errline 0
  49. MoveRight errcol
  50. exit
  51.