Hi all,

just a tip for VBScript scripters which was biting me even though I didn't
know it.  it is, in all of my scripts, I have some form of the following
structure:

on error resume next
<statement which might have an error>
on error goto 0
if err.number <> 0 then
' do something about error
end if

it turns out that "on error goto 0" clears the error condition, so testing
on the err.number property afterwards is useless apparently.

so, it looks like the correct way to do this is:

on error resume next
<statement which might have an error>
if err.number <> 0 then
on error goto 0
' do something about error
end if
on error goto 0


Aaron, this was my test to see if loadClassInformation succeeded or not, so
in the cases where it did not, because of some odd condition such as the
application was still initializing, it looks to me like I wouldn't have
known it, and so would have thought loadClassInformation was sometimes
failing without an error.  How it failed on the second or third use of a
constant I can't explain, but I don't think there's a problem with
loadClassInformation any more.

Thanks to Gary Metzler for his help in tracing this down, and for working
with me on this error because he could reliably reproduce it.

Chip


Reply via email to