home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 April
/
PCWorld_2000-04_cd.bin
/
Software
/
TemaCD
/
winedit
/
mserror.wb_
< prev
next >
Wrap
Text File
|
1998-05-26
|
3KB
|
69 lines
;--------------------------------------------------------------------;
; mserror.wbt ;
; ;
; Error parsing for Microsoft style output: ;
; "filename(lineno):text" ;
; ;
; This script is included only as a template for you to use in ;
; creating a custom error parsing script, since Microsoft style ;
; output is handled internally by WinEdit. ;
; ;
; 1. If called with param1 == "@GetErrorWords", return ;
; a comma-delimited list of words which identify a line ;
; as containing an error. In Microsoft style output that ;
; would be "error,warning". ;
; ;
; 2. Otherwise, parse the variable @strLine to extract the filename ;
; and line number. In this case, the filename is all the ;
; characters up to the opening parenthesis, and the line number ;
; is all of the following characters up to the closing ;
; parenthesis. ;
; ;
;--------------------------------------------------------------------;
@ErrFile = "" ; return value
@ErrLine = 0 ; return value
@ErrWords = "" ; return value
;--------------------------------------------------------------------;
; Return the error words ;
;--------------------------------------------------------------------;
if param1 == "@GetErrorWords"
@ErrWords = "error,warning"
exit
endif
;--------------------------------------------------------------------;
; extract the file name by searching for the '(' character ;
;--------------------------------------------------------------------;
finish = StrScan(@strLine, "(", 0, @FWDSCAN)
if finish == 0
exit
endif
strFile = strsub(@strLine,1,finish-1)
if (FileExist(strFile))
@ErrFile = strFile
else
drop(strFile,finish)
exit
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
strLine = StrSub(@strLine,start,finish-start)
if IsInt(strLine)
@ErrLine = strLine
else
@ErrFile = ""
endif
drop(strLine,strFile,start,finish)