Re: Set the CheckBox.Checked without the OnClick being called
- From: John Dough <nobody@xxxxxxxxxxxxxxx>
- Date: Fri, 08 Jun 2007 03:43:44 -0400
On Fri, 08 Jun 2007 01:06:42 -0500, Rob Kennedy <me3@xxxxxxxxxxx>
wrote:
You have a variable dictating whether an object's method should do anything
-- it should be a member of the class, not a global variable sitting by
itself without any connection to anything else.
You connect it to whatever you want...
It's not like Delphi is going to start assigning random values to your
global variable at random intervals while your program is running...
When you have a global variable, any code at any location in your
program can modify its value.
Well yes, but only when the programmer modifies it. This is no
different from any other variable. If you assign it a wrong value,
then it'll be wrong regardless of whether your variable is global or
inside the class.
If you find while testing that it has the
wrong value, there are many potential code paths to investigate.
I don't see how it's any different.
If I'm assigning a value to a global variable 15 times throughout my
program, then that means there are 15 places where there could be a
potential problem.
Whereas if I put that same variable inside a class and assign values
to it the same 15 times throughout my program, then there will still
be 15 different places for potential problems.
You've gained nothing by declaring your variable inside a class in
terms of debugging difficulty. You make other gains (most notably in
memory management) for variables that consume a lot of memory, but if
it's something as simple as a global boolean, then it's irrelevant.
.
- Follow-Ups:
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Maarten Wiltink
- Re: Set the CheckBox.Checked without the OnClick being called
- References:
- Set the CheckBox.Checked without the OnClick being called
- From: Fons
- Re: Set the CheckBox.Checked without the OnClick being called
- From: John Dough
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Rob Kennedy
- Re: Set the CheckBox.Checked without the OnClick being called
- From: John Dough
- Re: Set the CheckBox.Checked without the OnClick being called
- From: Rob Kennedy
- Set the CheckBox.Checked without the OnClick being called
- Prev by Date: Re: Set the CheckBox.Checked without the OnClick being called
- Next by Date: Runescape Guide: quick tips on makin mone
- Previous by thread: Re: Set the CheckBox.Checked without the OnClick being called
- Next by thread: Re: Set the CheckBox.Checked without the OnClick being called
- Index(es):
Relevant Pages
|