Re: Form level Public Variables
From: Jens Neuhalfen (JNeuhalfen_at_akkaya.de)
Date: 08/11/04
- Next message: Neil: "DCOM Error 458 (again)"
- Previous message: Jens Neuhalfen: "Re: Reduce or Prevent Memory Leak in VB6"
- In reply to: Ian: "Form level Public Variables"
- Next in thread: Jeff Mandie: "Re: Form level Public Variables"
- Reply: Jeff Mandie: "Re: Form level Public Variables"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 11 Aug 2004 12:47:25 +0200
Hi Ian.
(inline comments)
> Hi
>
> I was hoping some one could give me a good reason not to use Form level
> Public variables.
Its called "encapsulation" *g*. Use "Property Get" /"Property
Let|Set" as wrapper for the variables.
One reason is that your form is totally unaware of changes made from
the outside. This can be anything from a minor nuisance to major
crash scenarios with added timing problems - and you don't want
that, let me assure you.
The other reason is that you somehow need to shield your properties
- for example a negative "depth" (whatever you should need that for).
>
> I cant think of a reason why I shouldn't.
>
> The reason I want to use them is that I have a few almost generic forms in
> my application with a few subtle differences depending on how and when they
> are displayed.
Well, this is a good design.
>
> Now to me creating a form level variable that will accept an indicator as to
> how the form should be displayed is rather useful.
> And then the variable then becomes a property of the form.
>
> Ian
HTH
Jens
>
>
- Next message: Neil: "DCOM Error 458 (again)"
- Previous message: Jens Neuhalfen: "Re: Reduce or Prevent Memory Leak in VB6"
- In reply to: Ian: "Form level Public Variables"
- Next in thread: Jeff Mandie: "Re: Form level Public Variables"
- Reply: Jeff Mandie: "Re: Form level Public Variables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|