Re: Wondering what you think about snippets like these?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"McKirahan" <News@xxxxxxxxxxxxx> wrote in message
news:89udnVqNW-qbXWvbnZ2dnUVZ_i2dnZ2d@xxxxxxxxxxxxxx
"Al Dunbar" <AlanDrub@xxxxxxxxxxxxxxxxxxx> wrote in message
news:#BlW1Zh$HHA.4584@xxxxxxxxxxxxxxxxxxxxxxx

[snip]

With using "On Error Resume Next" you can't detect errors by
testing the "Err" object.

Erm, isn't that precisely why the statement exists - so that the error
does
not abort the script before it gets to our code for testing the result?

[snip]

Not sure what you're suggesting.

The OP did not use "On Error Resume Next" but was testing the
Err object in the "Function GetErrorInfo".

Sorry, I missed that little detail in his script, and made a faulty
assumption, not noticing that you actually meant to say:

With_OUT_ using "On Error Resume Next" you can't detect errors by
testing the "Err" object.

Mind you, this is perhaps one area where the use of functions can complicate
things, as there are times when you want errors to resume next and times
when you don't.


/Al


From the VBScript documentation:

On Error Statement
Description:

Enables or disables error-handling.

Remarks

If you don't use an On Error Resume Next statement anywhere in your code,
any run-time error that occurs can cause an error message to be displayed
and code execution stopped.




.



Relevant Pages