[DUG] Enable CheckBox

Jeremy Coulter jscoulter at gmail.com
Wed Apr 28 07:35:17 NZST 2010


You really need to put a TRIM() around the DBEdit2.text because what happens
if someone puts a space in the edit box? It will look blank, but of course
it wont be, then you will not have the checkbox enabled.

 

Jeremy

 

From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Bob Pawley
Sent: Wednesday, 28 April 2010 03:51
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Enable CheckBox

 

Hi

 

The following works well and it is simple enough that I can almost
understand it.

 

Thanks everyone.

 

Bob

 

if DBEdit2.Text <> '' then
DBCheckBox4.Enabled := true
else
DBCheckBox4.Enabled := false

----- Original Message ----- 

From: Colin Johnsun <mailto:colin.adug at gmail.com>  

To: NZ Borland <mailto:delphi at delphi.org.nz>  Developers Group - Delphi List


Sent: Monday, April 26, 2010 5:53 PM

Subject: Re: [DUG] Enable CheckBox

 

Yeah, that was my thinking on the topic too! But you said it much better :) 

 

BTW, I'm wondering if Bob, the originator of this thread, wants to chime in
and let us know if any of these suggestions helped or not.

 

On 27 April 2010 10:34, Jolyon Smith <jsmith at deltics.co.nz> wrote:

Maybe it's just me, but "A doesn't equal B" surely reads more closely to the
real meaning than "not (A does equal B)".

 

Apart from anything else, the latter requires parentheses to avoid the
compiler getting confused and trying to do : "(Not A) equals (B)".  i.e. the
latter syntax is also to the compiler less close to the real meaning (since
it requires disambiguation).

 

>From a human perspective the scanning is more fluid:  A <> B, reads left to
right entirely as intended:  "A does not equal B".

 

NOT (A = B) on the other hand requires me to read it like a syntax tree
parser:  "NOT " . (OK, store the fact that I have to logically invert what
follows, keep a mental note of parentheses) . then what follows is "( A is
equal to B )" , right OK, so "A is equal to B inverted", i.e. A does not
equal B.

 

In other words, exactly what is menat literally and clearly when I write. A
<> B.

 

But as I say, maybe it's just me.

 

NOT (I think like a computer).

 

;)

 

  _____  

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100428/f1fc4a2d/attachment.html 


More information about the Delphi mailing list