Re: Err.Description does not contain the full text of the error me
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Fri, 19 Sep 2008 09:58:52 +0200
"Chad Ullman" <ChadUllman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:85916340-E73A-40D5-ABFE-1EEB10BA63B0@xxxxxxxxxxxxxxxx
"Pegasus (MVP)" wrote:
Don't use belts and braces. The directive "Option explicit" is sufficient
to
trap undeclared variables - no need to pick them up with an "On Error"
statement.
I predicted this would be the first response to this question. Perhaps I
should have prefaced my questions with this disclaimer: Please don't
assume
I am making a rookie mistake. Yes, I know option explicit will resolve
the
error that is demonstrated, but the code I included is intended to throw
an
error to demonstrate the actual problem, namely the discrepancy between
the
error descriptions from the Err object and the WSH error dialog.
Here is some background:
We have a large set of libraries we have written for use with QTP (an
automated testing tool). I have a script that checks these libraries for
compilation errors. It does this by using Exec to run each script and
trapping any errors. When I get a "Variable is not defined" error, it
would
be far more helpful if it actually told me which variable is undefined,
rather then leaving me to hunt through a few hundred lines of code.
So again, does anyone know why the level of detail is different in the WSH
error dialog and the VBScript Err Object?
Chad
A further thought: Chasing undeclared variables in a VB Script file appears
to be a somewhat futile exercise because in many cases such variables do not
represent an error condition, just an oversight by the programmer that makes
no difference whatsoever to the execution of the program.
.
- Follow-Ups:
- Re: Err.Description does not contain the full text of the error me
- From: Chad Ullman
- Re: Err.Description does not contain the full text of the error me
- References:
- Err.Description does not contain the full text of the error messag
- From: Chad Ullman
- Re: Err.Description does not contain the full text of the error messag
- From: Pegasus \(MVP\)
- Re: Err.Description does not contain the full text of the error me
- From: Chad Ullman
- Err.Description does not contain the full text of the error messag
- Prev by Date: Re: Err.Description does not contain the full text of the error me
- Next by Date: Re: VBScript problem in running Stored Query
- Previous by thread: Re: Err.Description does not contain the full text of the error me
- Next by thread: Re: Err.Description does not contain the full text of the error me
- Index(es):
Relevant Pages
|