RAP - Condition with Integer value
Hello,
I use Delphi2009 and RBuilder 12.03.
In Designer, when adding this code in event
procedure ReportBeforeOpenDataPipelines;
var
mInt1: Integer;
mInt2: Integer;
begin
mInt1 := -1;
mInt2 := -1;
if ( (mInt1 <> -1) and (mInt2 <> -1) ) then
ShowMessage('<> -1')
else
ShowMessage('= -1');
end;
the message showed is '<> -1'.
Thanks in advance.
Marius Céré
I use Delphi2009 and RBuilder 12.03.
In Designer, when adding this code in event
procedure ReportBeforeOpenDataPipelines;
var
mInt1: Integer;
mInt2: Integer;
begin
mInt1 := -1;
mInt2 := -1;
if ( (mInt1 <> -1) and (mInt2 <> -1) ) then
ShowMessage('<> -1')
else
ShowMessage('= -1');
end;
the message showed is '<> -1'.
Thanks in advance.
Marius Céré
This discussion has been closed.
Comments
I tested this and was able to recreate the issue. I will take a look at
the problem however it seems it is caused by the outside parenthesis
around the case statement.
As a workaround removing the outside parenthesis solves the problem.
if (mInt1 <> -1) and (mInt2 <> -1) then
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com