Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11940
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | "Mayayana" <mayayana@invalid.nospam> |
| Newsgroups | microsoft.public.scripting.vbscript |
| Subject | Re: Is there a way to check the state of the error handler? |
| Date | Tue, 15 May 2018 11:53:02 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 38 |
| Message-ID | <pdevqd$1vs$1@dont-email.me> (permalink) |
| References | <2tcspbxl8haf.1tz7eicrk8vcl.dlg@40tude.net> <pdemhb$39e$1@dont-email.me> <1e1ewjv09ri80.1vvlpmkxaxv4z.dlg@40tude.net> |
| Injection-Date | Tue, 15 May 2018 15:53:49 -0000 (UTC) |
| Injection-Info | reader02.eternal-september.org; posting-host="68082213ddbd7d870fabc433164c31d5"; logging-data="2044"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GcpFLDHFlitDoJSFMpG1LnWn2iJ67AdM=" |
| Cancel-Lock | sha1:i6omqgSj9QTfiLp1yfEziQrllN0= |
| X-MimeOLE | Produced By Microsoft MimeOLE V6.00.2900.5512 |
| X-Newsreader | Microsoft Outlook Express 6.00.2900.5512 |
| X-Priority | 3 |
| X-MSMail-Priority | Normal |
| Xref | csiph.com microsoft.public.scripting.vbscript:11940 |
Show key headers only | View raw
"JJ" <jj4public@vfemail.net> wrote | It's a bit difficult to explain. Please see my reply to Auric message. | | Basically it's because it works like a C header files. i.e. each script | doesn't aware of each other, and may not make sense on its own. It'll only | make sense when combined with other scripts. I find error handling seems to "bubble up". In other words, an HTA Button1_onclick might have On Error Resume Next. That then calls another sub or function, which calls a 3rd, which calls a 4th. It all gets error-trapped. I've never tested to figure out the details. I guess you could do something like: Sub DoIt() On Error GoTo 0 ' code in sub On Error Resume Next End Sub According to the docs it doesn't matter when the sub ends, but if it bubbles up then GoTo 0 might also bubble up and thus need to be cleared. I tend to use another approach: If I need to test something I might comment out all error trapping until I figure out the problem. Though sometimes errors are expected, so that can be awkward. Once the code is pretty much finished, and I've made it as stable as possible with error trapping, I just add On Error Resume Next at the top of everything. My logic is that I've dealt with all the likely problems. Any problem that then might arise would be a fluke and it's probably going to do more harm than good to stop everything for such a problem.
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is there a way to check the state of the error handler? JJ <jj4public@vfemail.net> - 2018-05-15 13:04 +0700
Re: Is there a way to check the state of the error handler? "Auric__" <not.my.real@email.address> - 2018-05-15 06:55 +0000
Re: Is there a way to check the state of the error handler? JJ <jj4public@vfemail.net> - 2018-05-15 22:10 +0700
Re: Is there a way to check the state of the error handler? "Mayayana" <mayayana@invalid.nospam> - 2018-05-15 09:14 -0400
Re: Is there a way to check the state of the error handler? JJ <jj4public@vfemail.net> - 2018-05-15 22:22 +0700
Re: Is there a way to check the state of the error handler? "Mayayana" <mayayana@invalid.nospam> - 2018-05-15 11:53 -0400
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-15 17:26 +0200
Re: Is there a way to check the state of the error handler? JJ <jj4public@vfemail.net> - 2018-05-16 16:52 +0700
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-16 12:42 +0200
Re: Is there a way to check the state of the error handler? "Mayayana" <mayayana@invalid.nospam> - 2018-05-16 08:34 -0400
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-16 17:36 +0200
Re: Is there a way to check the state of the error handler? JJ <jj4public@vfemail.net> - 2018-05-19 00:03 +0700
Re: Is there a way to check the state of the error handler? "Mayayana" <mayayana@invalid.nospam> - 2018-05-18 13:18 -0400
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-18 20:15 +0200
Re: Is there a way to check the state of the error handler? "Mayayana" <mayayana@invalid.nospam> - 2018-05-18 15:12 -0400
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-19 11:23 +0200
Re: Is there a way to check the state of the error handler? "Mayayana" <mayayana@invalid.nospam> - 2018-05-19 10:28 -0400
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-19 22:19 +0200
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-18 20:06 +0200
Re: Is there a way to check the state of the error handler? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-18 23:27 +0200
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-19 12:15 +0200
Re: Is there a way to check the state of the error handler? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-19 21:30 +0200
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-19 22:21 +0200
Re: Is there a way to check the state of the error handler? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-19 22:32 +0200
Re: Is there a way to check the state of the error handler? "R.Wieser" <address@not.available> - 2018-05-20 11:06 +0200
Re: Is there a way to check the state of the error handler? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-20 12:09 +0200
csiph-web