Re: Error trapping
From: Stan Hilliard (usenetreplyMS_at_samplingplansNOTSPAM.com)
Date: 09/06/04
- Next message: alpine: "Re: API to get the Local IP from VB 6.0"
- Previous message: Stan Hilliard: "Re: Dictionary Object and FSO versions"
- In reply to: Russ Holsclaw: "Re: Error trapping"
- Next in thread: Larry Serflaten: "Re: Error trapping"
- Reply: Larry Serflaten: "Re: Error trapping"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 05 Sep 2004 23:40:32 -0500
On Sun, 5 Sep 2004 16:23:19 -0600, "Russ Holsclaw"
<russ@holsclaw.nyet> wrote:
>> if I do something like this:
>>
>> on error goto errhandler
>> Form1.show
>>
>> What errors will be catched?
>> All errors relating to the loading and displaying of the form
>or even errors
>> that occour in routines of controls on the form like
>command1_click?
>
>The effect of an On Error is limited to errors that are raised in
>the procedure that contains it, or in procedures that it calls.
>
>Generally when you load a form, the program that does the loading
>usually finishes executing before anything else happens in the
>form's procedures.
>
>I would have expected, therefore, that maybe if the form were
>shown modally, that unhandled errors in the form might be raised
>back in the procedure that showed the form. However, that doesn't
>seem to be the case.
>
>I tried this experimentally, and the error handler in the routine
>that contain the "form2.show vbModal" statement didn't get
>invoked when an error in the form was raised.
>
>So, it appears that each form needs to handle its own errors.
>
>My own preferred style of programming, however, never really runs
>into that situation. I generally let the "Load" and "show"
>actions of a form happen within that form's own methods, rather
>than those of an external form.
How do you do that?
>That's just because I like to
>make the showing, loading, and unloading of a form, as well as
>handling the contents and events of the form, the responsibility
>of the form module itself, so as to more fully "encapsulate" the
>form as an object, as seen by other parts of the program.
- Next message: alpine: "Re: API to get the Local IP from VB 6.0"
- Previous message: Stan Hilliard: "Re: Dictionary Object and FSO versions"
- In reply to: Russ Holsclaw: "Re: Error trapping"
- Next in thread: Larry Serflaten: "Re: Error trapping"
- Reply: Larry Serflaten: "Re: Error trapping"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|