Re: Set the CheckBox.Checked without the OnClick being called



John Dough wrote:

Oh come on...now you're just being silly.
It makes absolutely no difference whether you compare it to true or
false, or if you simple call it by "if not".

A comparison to True can produce a wrong result, when a semi-boolean type (WordBool...) is compared, or when somebody forced an non-boolean value into a boolean variable. Even if this will never happen in your own code <BG>, other people have other skills or habits, and they may wonder why your pattern doesn't work for them.


Or with even clearer flow of code:

if RunClickEvent then begin
showmessage('This is only shown when needed...');
end;


Why is that any clearer?

Some people ban the use of Exit, with reasonable arguments. I tend to use Exit myself, but in at least one case I wondered why the code, added to the end of a subroutine, was not always executed - due to an Exit hidden somewhere in the preceding code :-(

DoDi
.



Relevant Pages

  • Re: Memo change update -notify user
    ... Personally I do the whole thing in a DO WHILE loop and actually compare the ... two strings each time the user exits. ... > I guess I could change the Continue,Update,Return to after exit of the ... > memoedit but if the user wants to continue I would have to re-enter the ...
    (comp.lang.clipper)
  • Re: Interstate 90 through new york
    ... >> some confusion initially and all the exit numbers in ads and on business cards have ... Milepost the Thruway starting at the south end of the ... To compare NY state with Oregon is not a good ...
    (misc.transport.road)
  • Re: can u suggest me to do better than this?
    ... from ns2 simulations. ... and then i had to compare the 2nd column of each '-' and 'r' pairs of ... then in an ENDI'd loop check if the results satisfy ... you just have to do the check while you do the compare and exit if ...
    (comp.lang.awk)
  • Re: Interstate 90 through new york
    ... > states switch from sequential-based to milepost-based exit numbers in ... but to compare NY with any of the other states numbering or ... Unless you are a real road geek, no one knows where the 0 mile post is ... exit numbering unlike I-90 and I-87 in NY state. ...
    (misc.transport.road)
  • Re: Set the CheckBox.Checked without the OnClick being called
    ... 06:07:32, John Dough wrote: ... It makes absolutely no difference whether you compare it to true or ... if BooleanExpression then ... -- Groucho Marx ...
    (comp.lang.pascal.delphi.misc)