[DUG] Enable CheckBox

Rogério Martins rogmartins at gmail.com
Wed Apr 28 07:55:08 NZST 2010


try this:

DBCheckBox4.Enabled := not DBEdit2.Field.IsNull;

2010/4/27 Bob Pawley <rjpawley at shaw.ca>

>  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 <colin.adug at gmail.com>
> *To:* NZ Borland Developers Group - Delphi List <delphi at delphi.org.nz>
> *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
>
>
> _______________________________________________
> 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/20100427/0f99a397/attachment-0001.html 


More information about the Delphi mailing list