Alistair,

The brackets in these statements:

var
  a, b: Boolean;

if (a) and not (b) then ...

and

if (a) and (not b) then ...

are irrelevent. Not has higher precedence than And so the not will always
apply before the and, the brackets aren't required. It doesn't matter if a
and b are boolean variables or boolean functions - the evaluation order is
the same.

I suspect there is something else going on which is causing your problem.

David.


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Alistair George
> Sent: Monday, 10 March 2003 1:13 PM
> To: Multiple recipients of list delphi
> Subject: [DUG]: coding
>
>
> Hi All.
> The following:
> if (DateSwitch) and not (RxCheckListBox6.Checked[2]) then
> CheckFileExist(VCLzip1.zipname);
> is not parsed correctly unless it is:
> if (DateSwitch) and (not RxCheckListBox6.Checked[2]) then
> CheckFileExist(VCLzip1.zipname);
>
> So does this mean that any boolean thusly declared:
>
> If not _acorrecttest_ then showmessage('Always false');
>
> //above is wrong but
>
> if (not _acorrecttest_) then showmessage('sometimes false');
>
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to