what about the following. Move it away from strings and make it numbers :-)<br><br>Control.Enabled := Length(Text) <> 0; <br><br>Jeremy<br><br><br><br><div class="gmail_quote">On Tue, Apr 27, 2010 at 12:34 PM, Jolyon Smith <span dir="ltr"><<a href="mailto:jsmith@deltics.co.nz">jsmith@deltics.co.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size: 11pt;">Maybe
it’s just me, but “A doesn’t equal B” surely reads more
closely to the <i>real meaning</i> than “not (A does equal B)”.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt;">Apart
from anything else, the latter <b>requires</b> 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).</span></p>
<p class="MsoNormal"><span style="font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt;">From
a human perspective the scanning is more fluid: A <> B, reads left
to right entirely as intended: “A does not equal B”.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt;">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.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt;">In
other words, exactly what is menat literally and clearly when I write… A
<> B.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt;">But
as I say, maybe it’s just me.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt;">NOT
(I think like a computer).</span></p>
<p class="MsoNormal"><span style="font-size: 11pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt;">;)</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(153, 51, 102);"> </span></p>
<div style="border-width: medium medium medium 1.5pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; padding: 0cm 0cm 0cm 4pt;">
<div>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a> [mailto:<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a>] <b>On Behalf
Of </b>David O'Brien<br>
<b>Sent:</b> Tuesday, 27 April 2010 11:54 a.m.<div><div></div><div class="h5"><br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> Re: [DUG] Enable CheckBox</div></div></span></p>
</div>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ">Mainly because it makes me think about the real meaning when
looking at the code again </span><span style="font-size: 11pt; font-family: Wingdings; color: rgb(31, 73, 125);" lang="EN-NZ">J</span><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ">.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ"> </span></p>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a> [mailto:<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a>] <b>On Behalf
Of </b>Colin Johnsun<br>
<b>Sent:</b> Tuesday, 27 April 2010 11:47 a.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> Re: [DUG] Enable CheckBox</span></p>
</div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
<p class="MsoNormal"><span lang="EN-NZ">I like David's version but why not get rid
of the "not" to:</span></p>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ">DBCheckBox4.Enabled := DBEdit2.Text
<> '';</span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ">Cheers,</span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
<div>
<p class="MsoNormal"><span lang="EN-NZ">On 27 April 2010 09:40, Ian Drower <<a href="mailto:idrower@gmail.com" target="_blank">idrower@gmail.com</a>> wrote:</span></p>
<div>
<p class="MsoNormal"><span lang="EN-NZ">Hi Bob<br>
I'd use <br>
if DBEdit2.Text <> '' then<br>
DBCheckBox4.Enabled := true<br>
else<br>
DBCheckBox4.Enabled := false<br>
<br>
Ian</span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"><br>
<br>
<br>
On 27/04/2010 10:52 a.m., David O'Brien wrote: </span></p>
</div>
</div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ">Why the four quotes in the
false and a space in the true?</span><span lang="EN-NZ"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ"> </span><span lang="EN-NZ"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ">I would use something like:</span><span lang="EN-NZ"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ"> </span><span lang="EN-NZ"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">DBCheckBox4.Enabled := not (DBEdit2.Text =
'') ;</span><span lang="EN-NZ"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-NZ"> </span><span lang="EN-NZ"></span></p>
<div>
<div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0cm 0cm; border-color: -moz-use-text-color;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a>
[<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">mailto:delphi-bounces@delphi.org.nz</a>]
<b>On Behalf Of </b>Bob Pawley<br>
<b>Sent:</b> Tuesday, 27 April 2010 10:39 a.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> [DUG] Enable CheckBox</span><span lang="EN-NZ"></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">Hi</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">I am attempting to enable a checkbox only
when a DBEdit has a value. (Disabled when no string in DBEdit.)</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">Following is my code which disables the
CheckBox after a delete from the DBEdit.</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">But it is not enabled when I add a string
to the DBEdit.</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">------</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">procedure TForm4.DBEdit2Change(Sender:
TObject);<br>
begin</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ"> if<br>
DBEdit2.Text = ' '</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ"> then<br>
DBCheckBox4.Enabled := True</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ"> Else if DBEdit2.Text = ''''</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ"> then<br>
DBCheckBox4.Enabled := False ;</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">end;</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">Thanks for any help.</span><span lang="EN-NZ"></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-NZ">Bob</span><span lang="EN-NZ"></span></p>
</div>
</div>
</div>
</div>
<pre><span lang="EN-NZ"> </span></pre><pre><span lang="EN-NZ">_______________________________________________</span></pre><pre><span lang="EN-NZ">NZ Borland Developers Group - Delphi mailing list</span></pre><pre><span lang="EN-NZ">Post: <a href="mailto:delphi@delphi.org.nz" target="_blank">delphi@delphi.org.nz</a></span></pre>
<pre><span lang="EN-NZ">Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a></span></pre><pre><span lang="EN-NZ">Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz" target="_blank">delphi-request@delphi.org.nz</a> with Subject: unsubscribe</span></pre>
</blockquote>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
<p class="MsoNormal"><span lang="EN-NZ"><br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@delphi.org.nz" target="_blank">delphi@delphi.org.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz" target="_blank">delphi-request@delphi.org.nz</a>
with Subject: unsubscribe</span></p>
</div>
<p class="MsoNormal"><span lang="EN-NZ"> </span></p>
</div>
</div>
</div></div></div>
</div>
</div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br>