home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 April
/
PCWorld_2000-04_cd.bin
/
Software
/
TemaCD
/
winedit
/
javaerr.wb_
< prev
next >
Wrap
Text File
|
1998-05-26
|
3KB
|
77 lines
;--------------------------------------------------------------------;
; javaerror.wbt ;
; ;
; Error parsing for Java SDK style output: ;
; "filename:lineno: text" ;
; ;
; 1. If called with param1 == "@GetErrorWords", return ;
; a comma-delimited list of words which identify a line ;
; as containing an error. The Java SDK doesn't add a tag like ;
; "error" or "warning" so we'll just look for the '^' that ;
; points to the error column. ;
; ;
; 2. Otherwise, parse the global variable @strLine to extract ;
; the file name and line number. In this case, the filename ;
; is all the characters up to the colon character, and the ;
; line number is all of the following characters up to the ;
; next colon character. ;
; ;
;--------------------------------------------------------------------;
@ErrFile = "" ; return value
@ErrLine = 0 ; return value
@ErrWords = "" ; return value
;--------------------------------------------------------------------;
; Return the error words ;
;--------------------------------------------------------------------;
if param1 == "@GetErrorWords"
@ErrWords = "^"
exit
endif
;--------------------------------------------------------------------;
; extract the file name by searching for the ':' character ;
;--------------------------------------------------------------------;
finish = StrScan(@strLine, ":", 1, @FWDSCAN)
if finish == 0
exit
endif
strFile = strsub(@strLine,1,finish-1)
if (FileExist(strFile))
@ErrFile = strFile
else
; the first colon was probably part of the pathname,
; so keep looking
nextfinish = StrScan(@strLine,":",finish+1,@FWDSCAN)
if nextfinish != 0
strfile = strsub(@strLine,1,nextfinish-1)
if (FileExist(strFile))
@ErrFile = strFile
finish = nextfinish
endif
else
drop(strFile,finish,nextfinish)
exit
endif
endif
;--------------------------------------------------------------------;
; extract the line number, which follows the ':' character ;
;--------------------------------------------------------------------;
start = finish+1
finish = StrScan(@strLine, ":", start, @FWDSCAN)
if finish == 0
@ErrFile = ""
drop(strFile,start,finish)
exit
endif
Line = StrSub(@strLine,start,finish-start)
if IsInt(Line)
@ErrLine = Line
else
@ErrFile = ""
endif
drop(Line,strFile,start,finish)