Home General

RAP - Condition with Integer value

edited March 2011 in General
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é

Comments

  • edited March 2011
    Hi Marius,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.