home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 April / PCWorld_2000-04_cd.bin / Software / TemaCD / winedit / javaerr.wb_ < prev    next >
Text File  |  1998-05-26  |  3KB  |  77 lines

  1. ;--------------------------------------------------------------------;
  2. ; javaerror.wbt                                                      ;
  3. ;                                                                    ;
  4. ; Error parsing for Java SDK style output:                           ;
  5. ; "filename:lineno: text"                                            ;
  6. ;                                                                    ;
  7. ; 1.  If called with param1 == "@GetErrorWords", return              ;
  8. ;     a comma-delimited list of words which identify a line          ;
  9. ;     as containing an error. The Java SDK doesn't add a tag like    ;
  10. ;     "error" or "warning" so we'll just look for the '^' that       ;
  11. ;     points to the error column.                                    ;
  12. ;                                                                    ;
  13. ; 2.  Otherwise, parse the global variable @strLine to extract       ;
  14. ;     the file name and line number.  In this case, the filename     ;
  15. ;     is all the characters up to the colon character, and the       ;
  16. ;     line number is all of the following characters up to the       ;
  17. ;     next colon character.                                          ;
  18. ;                                                                    ;
  19. ;--------------------------------------------------------------------;
  20.  
  21. @ErrFile = ""   ; return value
  22. @ErrLine = 0    ; return value
  23. @ErrWords = ""  ; return value
  24.  
  25. ;--------------------------------------------------------------------;
  26. ;  Return the error words                                            ;
  27. ;--------------------------------------------------------------------;
  28. if param1 == "@GetErrorWords"
  29.     @ErrWords = "^"
  30.     exit
  31. endif
  32.  
  33. ;--------------------------------------------------------------------;
  34. ; extract the file name by searching for the ':' character           ;
  35. ;--------------------------------------------------------------------;
  36. finish = StrScan(@strLine, ":", 1, @FWDSCAN)
  37. if finish == 0 
  38.     exit
  39. endif
  40. strFile = strsub(@strLine,1,finish-1)
  41. if (FileExist(strFile))
  42.     @ErrFile = strFile
  43. else
  44.     ; the first colon was probably part of the pathname,
  45.     ; so keep looking
  46.     nextfinish = StrScan(@strLine,":",finish+1,@FWDSCAN)
  47.     if nextfinish != 0
  48.    strfile = strsub(@strLine,1,nextfinish-1)
  49.       if (FileExist(strFile))
  50.          @ErrFile = strFile
  51.          finish = nextfinish
  52.       endif
  53.    else
  54.       drop(strFile,finish,nextfinish)
  55.       exit
  56.    endif
  57. endif
  58.  
  59. ;--------------------------------------------------------------------;
  60. ; extract the line number, which follows the ':' character           ;
  61. ;--------------------------------------------------------------------;
  62. start = finish+1
  63. finish = StrScan(@strLine, ":", start, @FWDSCAN)
  64. if finish == 0
  65.     @ErrFile = ""
  66.     drop(strFile,start,finish)
  67.     exit
  68. endif
  69. Line = StrSub(@strLine,start,finish-start)
  70. if IsInt(Line)
  71.     @ErrLine = Line
  72. else
  73.     @ErrFile = ""
  74. endif
  75.  
  76. drop(Line,strFile,start,finish)
  77.